-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzombie_escape.sma
12188 lines (10567 loc) · 373 KB
/
zombie_escape.sma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
new const ZP_CUSTOMIZATION_FILE[] = "zombieplague.ini"
new const ZP_EXTRAITEMS_FILE[] = "zp_extraitems.ini"
new const ZP_ZOMBIECLASSES_FILE[] = "zp_zombieclasses.ini"
// Limiters for stuff not worth making dynamic arrays out of (increase if needed)
const MAX_CSDM_SPAWNS = 128
const MAX_STATS_SAVED = 64
/*================================================================================
Customization ends here! Yes, that's it. Editing anything beyond
here is not officially supported. Proceed at your own risk...
=================================================================================*/
#define NEMESIS_SCREAM "zombie_plague/nemesis2.wav"
#include <zmvip>
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <levels>
#include <dhudmessage>
/*================================================================================
[Constants, Offsets, Macros]
=================================================================================*/
// Plugin Version
new const PLUGIN_VERSION[] = "4.3 Fix5a"
// Customization file sections
enum
{
SECTION_NONE = 0,
SECTION_ACCESS_FLAGS,
SECTION_PLAYER_MODELS,
SECTION_WEAPON_MODELS,
SECTION_GRENADE_SPRITES,
SECTION_SOUNDS,
SECTION_AMBIENCE_SOUNDS,
SECTION_BUY_MENU_WEAPONS,
SECTION_EXTRA_ITEMS_WEAPONS,
SECTION_HARD_CODED_ITEMS_COSTS,
SECTION_WEATHER_EFFECTS,
SECTION_SKY,
SECTION_LIGHTNING,
SECTION_ZOMBIE_DECALS,
SECTION_KNOCKBACK,
SECTION_OBJECTIVE_ENTS,
SECTION_SVC_BAD
}
// Access flags
enum
{
ACCESS_ENABLE_MOD = 0,
ACCESS_ADMIN_MENU,
ACCESS_MODE_INFECTION,
ACCESS_MODE_NEMESIS,
ACCESS_MODE_SURVIVOR,
ACCESS_MODE_SWARM,
ACCESS_MODE_MULTI,
ACCESS_MODE_PLAGUE,
ACCESS_MAKE_ZOMBIE,
ACCESS_MAKE_HUMAN,
ACCESS_MAKE_NEMESIS,
ACCESS_MAKE_SURVIVOR,
ACCESS_RESPAWN_PLAYERS,
ACCESS_ADMIN_MODELS,
ACCESS_MODE_SNIPER,
ACCESS_MAKE_SNIPER,
MAX_ACCESS_FLAGS
}
// Task offsets
enum (+= 100)
{
TASK_MODEL = 2000,
TASK_TEAM,
TASK_SPAWN,
TASK_BLOOD,
TASK_AURA,
TASK_BURN,
TASK_NVISION,
TASK_FLASH,
TASK_CHARGE,
TASK_SHOWHUD,
TASK_MAKEZOMBIE,
TASK_WELCOMEMSG,
TASK_THUNDER_PRE,
TASK_THUNDER,
TASK_AMBIENCESOUNDS
}
// IDs inside tasks
#define ID_MODEL (taskid - TASK_MODEL)
#define ID_TEAM (taskid - TASK_TEAM)
#define ID_SPAWN (taskid - TASK_SPAWN)
#define ID_BLOOD (taskid - TASK_BLOOD)
#define ID_AURA (taskid - TASK_AURA)
#define ID_BURN (taskid - TASK_BURN)
#define ID_NVISION (taskid - TASK_NVISION)
#define ID_FLASH (taskid - TASK_FLASH)
#define ID_CHARGE (taskid - TASK_CHARGE)
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
// BP Ammo Refill task
#define REFILL_WEAPONID args[0]
// For weapon buy menu handlers
#define WPN_STARTID g_menu_data[id][1]
#define WPN_MAXIDS ArraySize(g_primary_items)
#define WPN_SELECTION (g_menu_data[id][1]+key)
#define WPN_AUTO_ON g_menu_data[id][2]
#define WPN_AUTO_PRI g_menu_data[id][3]
#define WPN_AUTO_SEC g_menu_data[id][4]
// For player list menu handlers
#define PL_ACTION g_menu_data[id][0]
// For remembering menu pages
#define MENU_PAGE_ZCLASS g_menu_data[id][5]
#define MENU_PAGE_EXTRAS g_menu_data[id][6]
#define MENU_PAGE_PLAYERS g_menu_data[id][7]
// For extra items menu handlers
#define EXTRAS_CUSTOM_STARTID (EXTRA_WEAPONS_STARTID + ArraySize(g_extraweapon_names))
// Menu selections
const MENU_KEY_AUTOSELECT = 7
const MENU_KEY_BACK = 7
const MENU_KEY_NEXT = 8
const MENU_KEY_EXIT = 9
// Hard coded extra items
enum
{
EXTRA_NVISION = 0,
EXTRA_ANTIDOTE,
EXTRA_MADNESS,
EXTRA_INFBOMB,
EXTRA_WEAPONS_STARTID
}
// Game modes
enum
{
MODE_NONE,
MODE_INFECTION,
MODE_NEMESIS,
MODE_SURVIVOR,
MODE_SWARM,
MODE_SNIPER,
MODE_MULTI = 0,
MODE_PLAGUE
}
// ZP Teams
const ZP_TEAM_NO_ONE = 0
const ZP_TEAM_ANY = 0
const ZP_TEAM_ZOMBIE = (1<<0)
const ZP_TEAM_HUMAN = (1<<1)
const ZP_TEAM_NEMESIS = (1<<2)
const ZP_TEAM_SURVIVOR = (1<<3)
const ZP_TEAM_SNIPER = (1<<4)
new const ZP_TEAM_NAMES[][] = {"ZOMBIE , HUMAN", "ZOMBIE", "HUMAN", "ZOMBIE , HUMAN", "NEMESIS",
"ZOMBIE , NEMESIS", "HUMAN , NEMESIS", "ZOMBIE , HUMAN , NEMESIS",
"SURVIVOR", "ZOMBIE , SURVIVOR", "HUMAN , SURVIVOR", "ZOMBIE , HUMAN , SURVIVOR",
"NEMESIS , SURVIVOR", "ZOMBIE , NEMESIS , SURVIVOR", "HUMAN , NEMESIS, SURVIVOR",
"ZOMBIE , HUMAN , NEMESIS , SURVIVOR", "SNIPER", "ZOMBIE , SNIPER",
"HUMAN , SNIPER", "HUMAN , SNIPER , SURVIVOR", "ZOMBIE , HUMAN , SNIPER", "NEMESIS , SNIPER",
"ZOMBIE , NEMESIS, SNIPER", "HUMAN, NEMESIS, SNIPER", "ZOMBIE , HUMAN , NEMESIS , SNIPER",
"ZOMBIE , HUMAN , NEMESIS , SURVIVOR , SNIPER"}
// Zombie classes
const ZCLASS_NONE = -1
// HUD messages
const Float:HUD_EVENT_X = -1.0
const Float:HUD_EVENT_Y = 0.17
const Float:HUD_INFECT_X = 0.05
const Float:HUD_INFECT_Y = 0.45
const Float:HUD_SPECT_X = 0.6
const Float:HUD_SPECT_Y = 0.8
const Float:HUD_STATS_X = -1.0
const Float:HUD_STATS_Y = 0.85
// Hack to be able to use Ham_Player_ResetMaxSpeed (by joaquimandrade)
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame
// CS Player PData Offsets (win32)
const PDATA_SAFE = 2
const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
const OFFSET_CSTEAMS = 114
const OFFSET_CSMONEY = 115
const OFFSET_CSMENUCODE = 205
const OFFSET_FLASHLIGHT_BATTERY = 244
const OFFSET_CSDEATHS = 444
const OFFSET_MODELINDEX = 491 // Orangutanz
// CS Player CBase Offsets (win32)
const OFFSET_ACTIVE_ITEM = 373
// CS Weapon CBase Offsets (win32)
const OFFSET_WEAPONOWNER = 41
// Linux diff's
const OFFSET_LINUX = 5 // offsets 5 higher in Linux builds
const OFFSET_LINUX_WEAPONS = 4 // weapon offsets are only 4 steps higher on Linux
// CS Teams
enum
{
FM_CS_TEAM_UNASSIGNED = 0,
FM_CS_TEAM_T,
FM_CS_TEAM_CT,
FM_CS_TEAM_SPECTATOR
}
new const CS_TEAM_NAMES[][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }
// Some constants
const HIDE_MONEY = (1<<5)
const UNIT_SECOND = (1<<12)
const DMG_HEGRENADE = (1<<24)
const IMPULSE_FLASHLIGHT = 100
const USE_USING = 2
const USE_STOPPED = 0
const STEPTIME_SILENT = 999
const BREAK_GLASS = 0x01
const FFADE_IN = 0x0000
const FFADE_STAYOUT = 0x0004
const PEV_SPEC_TARGET = pev_iuser2
// Max BP ammo for weapons
new const MAXBPAMMO[] = { -1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120,
30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100 }
// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, -1, 7, -1, 30, 30, -1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, -1, 7, 30, 30, -1, 50 }
// Amount of ammo to give when buying additional clips for weapons
new const BUYAMMO[] = { -1, 13, -1, 30, -1, 8, -1, 12, 30, -1, 30, 50, 12, 30, 30, 30, 12, 30,
10, 30, 30, 8, 30, 30, 30, -1, 7, 30, 30, -1, 50 }
// Ammo IDs for weapons
new const AMMOID[] = { -1, 9, -1, 2, 12, 5, 14, 6, 4, 13, 10, 7, 6, 4, 4, 4, 6, 10,
1, 10, 3, 5, 4, 10, 2, 11, 8, 4, 2, -1, 7 }
// Ammo Type Names for weapons
new const AMMOTYPE[][] = { "", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato", "", "9mm", "57mm", "45acp",
"556nato", "556nato", "556nato", "45acp", "9mm", "338magnum", "9mm", "556natobox", "buckshot",
"556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm" }
// Weapon IDs for ammo types
new const AMMOWEAPON[] = { 0, CSW_AWP, CSW_SCOUT, CSW_M249, CSW_AUG, CSW_XM1014, CSW_MAC10, CSW_FIVESEVEN, CSW_DEAGLE,
CSW_P228, CSW_ELITE, CSW_FLASHBANG, CSW_HEGRENADE, CSW_SMOKEGRENADE, CSW_C4 }
// Primary and Secondary Weapon Names
new const WEAPONNAMES[][] = { "", "P228 Compact", "", "Schmidt Scout", "", "XM1014 M4", "", "Ingram MAC-10", "Steyr AUG A1",
"", "Dual Elite Berettas", "FiveseveN", "UMP 45", "SG-550 Auto-Sniper", "IMI Galil", "Famas",
"USP .45 ACP Tactical", "Glock 18C", "AWP Magnum Sniper", "MP5 Navy", "M249 Para Machinegun",
"M3 Super 90", "M4A1 Carbine", "Schmidt TMP", "G3SG1 Auto-Sniper", "", "Desert Eagle .50 AE",
"SG-552 Commando", "AK-47 Kalashnikov", "", "ES P90" }
// Weapon entity names
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
"weapon_ak47", "weapon_knife", "weapon_p90" }
// CS sounds
new const sound_flashlight[] = "items/flashlight1.wav"
new const sound_buyammo[] = "items/9mmclip1.wav"
new const sound_armorhit[] = "player/bhit_helmet-1.wav"
// Explosion radius for custom grenades
const Float:NADE_EXPLOSION_RADIUS = 240.0
// HACK: pev_ field used to store additional ammo on weapons
const PEV_ADDITIONAL_AMMO = pev_iuser1
// HACK: pev_ field used to store custom nade types and their values
const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_INFECTION = 1111
const NADE_TYPE_NAPALM = 2222
const NADE_TYPE_FROST = 3333
const NADE_TYPE_FLARE = 4444
const PEV_FLARE_COLOR = pev_punchangle
const PEV_FLARE_DURATION = pev_flSwimTime
// Weapon bitsums
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
// Allowed weapons for zombies (added grenades/bomb for sub-plugin support, since they shouldn't be getting them anyway)
const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_C4)
// Classnames for separate model entities
new const MODEL_ENT_CLASSNAME[] = "player_model"
new const WEAPON_ENT_CLASSNAME[] = "weapon_model"
// Menu keys
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
// Ambience Sounds
enum
{
AMBIENCE_SOUNDS_INFECTION = 0,
AMBIENCE_SOUNDS_NEMESIS,
AMBIENCE_SOUNDS_SURVIVOR,
AMBIENCE_SOUNDS_SNIPER,
AMBIENCE_SOUNDS_SWARM,
AMBIENCE_SOUNDS_PLAGUE,
MAX_AMBIENCE_SOUNDS
}
// Admin menu actions
enum
{
ACTION_ZOMBIEFY_HUMANIZE = 0,
ACTION_MAKE_NEMESIS,
ACTION_MAKE_SURVIVOR,
ACTION_MAKE_SNIPER,
ACTION_RESPAWN_PLAYER,
ACTION_MODE_SWARM,
ACTION_MODE_MULTI,
ACTION_MODE_PLAGUE
}
// Custom forward return values
const ZP_PLUGIN_HANDLED = 97
/*================================================================================
[Global Variables]
=================================================================================*/
new suankimap[64]
// Player vars
new g_zombie[33] // is zombie
new g_nemesis[33] // is nemesis
new g_survivor[33] // is survivor
new g_firstzombie[33] // is first zombie
new g_lastzombie[33] // is last zombie
new g_lasthuman[33] // is last human
new g_frozen[33] // is frozen (can't move)
new Float:g_frozen_gravity[33] // store previous gravity when frozen
new g_nodamage[33] // has spawn protection/zombie madness
new g_respawn_as_zombie[33] // should respawn as zombie
new g_nvision[33] // has night vision
new g_nvisionenabled[33] // has night vision turned on
new g_zombieclass[33] // zombie class
new g_zombieclassnext[33] // zombie class for next infection
new g_flashlight[33] // has custom flashlight turned on
new g_flashbattery[33] = { 100, ... } // custom flashlight battery
new g_canbuy[33] // is allowed to buy a new weapon through the menu
new g_ammopacks[33] // ammo pack count
new g_damagedealt_human[33] // damage dealt as human (used to calculate ammo packs reward)
new g_damagedealt_zombie[33] // damage dealt as zombie (used to calculate ammo packs reward)
new Float:g_lastleaptime[33] // time leap was last used
new Float:g_lastflashtime[33] // time flashlight was last toggled
new g_playermodel[33][32] // current model's short name [player][model]
new g_menu_data[33][8] // data for some menu handlers
new g_ent_playermodel[33] // player model entity
new g_ent_weaponmodel[33] // weapon model entity
new g_burning_duration[33] // burning task duration
new g_sniper[33] // is sniper
new g_assassin[33] // is assassin
new Float:g_buytime[33] // used to calculate custom buytime
new bullets[33]
// Game vars
new g_pluginenabled // ZP enabled
new g_newround // new round starting
new g_endround // round ended
new g_nemround // nemesis round
new g_sniperround // sniper round
new g_survround // survivor round
new g_swarmround // swarm round
new g_plagueround // plague round
new g_modestarted // mode fully started
new g_lastmode // last played mode
new g_scorezombies, g_scorehumans, g_gamecommencing // team scores
new g_spawnCount, g_spawnCount2 // available spawn points counter
new Float:g_spawns[MAX_CSDM_SPAWNS][3], Float:g_spawns2[MAX_CSDM_SPAWNS][3] // spawn points data
new g_lights_i // lightning current lights counter
new g_lights_cycle[32] // current lightning cycle
new g_lights_cycle_len // lightning cycle length
new Float:g_models_targettime // for adding delays between Model Change messages
new Float:g_teams_targettime // for adding delays between Team Change messages
new g_MsgSync2, g_status_sync // message sync objects
new g_trailSpr, g_exploSpr, g_flameSpr, g_smokeSpr, g_glassSpr // grenade sprites
new g_ExploSprFrost, g_iFlareFrost, g_ExploSprFire, g_iFlareFire // Grenades Sprites added
new g_modname[32] // for formatting the mod name
new g_freezetime // whether CS's freeze time is on
new g_maxplayers // max players counter
new g_czero // whether we are running on a CZ server
new g_hamczbots // whether ham forwards are registered for CZ bots
new g_fwSpawn, g_fwPrecacheSound // spawn and precache sound forward handles
new g_infbombcounter, g_antidotecounter, g_madnesscounter // to limit buying some items
new g_arrays_created // to prevent stuff from being registered before initializing arrays
new g_lastplayerleaving // flag for whenever a player leaves and another takes his place
new g_switchingteam // flag for whenever a player's team change emessage is sent
new g_buyzone_ent // custom buyzone entity
new g_lightning, g_smoke
new g_buycountround[33] // buy count for a player in a round
// Message IDs vars
new g_msgScoreInfo, g_msgNVGToggle, g_msgScoreAttrib, g_msgAmmoPickup, g_msgScreenFade,
g_msgDeathMsg, g_msgSetFOV, g_msgFlashlight, g_msgFlashBat, g_msgTeamInfo, g_msgDamage,
g_msgHideWeapon, g_msgCrosshair, g_msgSayText, g_msgScreenShake, g_msgCurWeapon
// Some forward handlers
new g_fwRoundStart, g_fwRoundEnd, g_fwUserInfected_pre, g_fwUserInfected_post,
g_fwUserHumanized_pre, g_fwUserHumanized_post, g_fwUserInfect_attempt,
g_fwUserHumanize_attempt, g_fwExtraItemSelected, g_fwUserUnfrozen,
g_fwUserLastZombie, g_fwUserLastHuman, g_fwDummyResult
// Temporary Database vars (used to restore players stats in case they get disconnected)
new db_name[MAX_STATS_SAVED][32] // player name
new db_ammopacks[MAX_STATS_SAVED] // ammo pack count
new db_zombieclass[MAX_STATS_SAVED] // zombie class
new db_slot_i // additional saved slots counter (should start on maxplayers+1)
// Extra Items vars
new Array:g_extraitem_name // caption
new Array:g_extraitem_cost // cost
new Array:g_extraitem_team // team
new g_extraitem_i // loaded extra items counter
// For extra items file parsing
new Array:g_extraitem2_realname, Array:g_extraitem2_name, Array:g_extraitem2_cost,
Array:g_extraitem2_team, Array:g_extraitem_new
// Zombie Classes vars
new Array:g_zclass_name // caption
new Array:g_zclass_info // description
new Array:g_zclass_modelsstart // start position in models array
new Array:g_zclass_modelsend // end position in models array
new Array:g_zclass_playermodel // player models array
new Array:g_zclass_modelindex // model indices array
new Array:g_zclass_clawmodel // claw model
new Array:g_zclass_hp // health
new Array:g_zclass_spd // speed
new Array:g_zclass_grav // gravity
new Array:g_zclass_kb // knockback
new Array:g_zclass_lvl // level
new g_zclass_i // loaded zombie classes counter
// For zombie classes file parsing
new Array:g_zclass2_realname, Array:g_zclass2_name, Array:g_zclass2_info,
Array:g_zclass2_modelsstart, Array:g_zclass2_modelsend, Array:g_zclass2_playermodel,
Array:g_zclass2_modelindex, Array:g_zclass2_clawmodel, Array:g_zclass2_hp,
Array:g_zclass2_spd, Array:g_zclass2_grav, Array:g_zclass2_kb, Array:g_zclass2_lvl, Array:g_zclass_new
// Customization vars
new g_access_flag[MAX_ACCESS_FLAGS], Array:model_nemesis, Array:model_survivor, Array:model_human,
Array:model_admin_zombie, Array:model_admin_human, Array:g_modelindex_human,
Array:g_modelindex_nemesis, Array:g_modelindex_survivor, g_same_models_for_all,
Array:g_modelindex_admin_zombie, Array:g_modelindex_admin_human, model_vknife_human[64],
model_vknife_nemesis[64], model_vweapon_survivor[64], model_grenade_infect[64],
model_grenade_fire[64], model_grenade_frost[64], model_grenade_flare[64],
model_vknife_admin_human[64], model_vknife_admin_zombie[64],
sprite_grenade_trail[64], sprite_grenade_ring[64], sprite_grenade_fire[64],
sprite_grenade_smoke[64], sprite_grenade_glass[64], Array:sound_win_zombies,
Array:sound_win_humans, Array:sound_win_no_one, Array:sound_win_zombies_ismp3,
Array:sound_win_humans_ismp3, Array:sound_win_no_one_ismp3, Array:zombie_infect, Array:human_death,
Array:zombie_pain, Array:nemesis_pain, Array:zombie_die, Array:zombie_fall,
Array:zombie_miss_wall, Array:zombie_hit_normal, Array:zombie_hit_stab, g_ambience_rain,
Array:zombie_madness, Array:sound_nemesis, Array:sound_survivor,
Array:sound_swarm, Array:sound_multi, Array:sound_plague, Array:grenade_infect,
Array:grenade_infect_player, Array:grenade_fire, Array:grenade_fire_player,
Array:grenade_frost, Array:grenade_frost_player, Array:grenade_frost_break,
Array:grenade_flare, Array:sound_antidote, Array:sound_thunder, g_ambience_sounds[MAX_AMBIENCE_SOUNDS],
Array:sound_ambience1, Array:sound_ambience2, Array:sound_ambience3, Array:sound_ambience4,
Array:sound_ambience5, Array:sound_ambience1_duration, Array:sound_ambience2_duration,
Array:sound_ambience3_duration, Array:sound_ambience4_duration,
Array:sound_ambience5_duration, Array:sound_ambience1_ismp3, Array:sound_ambience2_ismp3,
Array:sound_ambience3_ismp3, Array:sound_ambience4_ismp3, Array:sound_ambience5_ismp3,
Array:g_primary_items, Array:g_secondary_items, Array:g_additional_items,
Array:g_primary_weaponids, Array:g_secondary_weaponids, Array:g_extraweapon_names,
Array:g_extraweapon_items, Array:g_extraweapon_costs, g_extra_costs2[EXTRA_WEAPONS_STARTID],
g_ambience_snow, g_ambience_fog, g_fog_density[10], g_fog_color[12], g_sky_enable,
Array:g_sky_names, Array:lights_thunder, Array:zombie_decals, Array:g_objective_ents,
Float:g_modelchange_delay, g_set_modelindex_offset, g_handle_models_on_separate_ent,
Float:kb_weapon_power[31] = { -1.0, ... }, Array:zombie_miss_slash, g_force_consistency,
Array:model_sniper, Array:g_modelindex_sniper, model_vawp_sniper[64],
Array:sound_sniper, Array:sound_ambience6, Array:sound_ambience6_duration,
Array:sound_ambience6_ismp3, m_spriteTexture
// CVAR pointers
new cvar_lighting, cvar_zombiefov, cvar_plague, cvar_plaguechance, cvar_zombiefirsthp,
cvar_removemoney, cvar_thunder, cvar_zombiebonushp, cvar_nemhp, cvar_nem, cvar_surv,
cvar_nemchance, cvar_deathmatch, cvar_nemglow, cvar_customnvg, cvar_hitzones, cvar_humanhp,
cvar_nemgravity, cvar_flashsize, cvar_ammodamage_human, cvar_ammodamage_zombie,
cvar_zombiearmor, cvar_survpainfree, cvar_nempainfree, cvar_nemspd, cvar_survchance,
cvar_survhp, cvar_survspd, cvar_humanspd, cvar_swarmchance, cvar_flashdrain,
cvar_zombiebleeding, cvar_removedoors, cvar_customflash, cvar_randspawn, cvar_multi,
cvar_multichance, cvar_infammo, cvar_swarm, cvar_ammoinfect, cvar_toggle,
cvar_knockbackpower, cvar_freezeduration, cvar_triggered, cvar_flashcharge,
cvar_firegrenades, cvar_frostgrenades, cvar_survgravity, cvar_logcommands, cvar_survglow,
cvar_humangravity, cvar_spawnprotection, cvar_nvgsize, cvar_flareduration, cvar_zclasses,
cvar_extraitems, cvar_showactivity, cvar_humanlasthp, cvar_nemignorefrags, cvar_warmup,
cvar_flashdist, cvar_flarecolor, cvar_survignorefrags, cvar_fireduration, cvar_firedamage,
cvar_flaregrenades, cvar_knockbackducking, cvar_knockbackdamage, cvar_knockbackzvel,
cvar_multiratio, cvar_flaresize, cvar_spawndelay, cvar_extraantidote, cvar_extramadness,
cvar_extraweapons, cvar_extranvision, cvar_nvggive, cvar_preventconsecutive, cvar_botquota,
cvar_buycustom, cvar_zombiepainfree, cvar_fireslowdown, cvar_survbasehp, cvar_survaura,
cvar_nemignoreammo, cvar_survignoreammo, cvar_nemaura, cvar_extrainfbomb, cvar_knockback,
cvar_fragsinfect, cvar_fragskill, cvar_fragskillnemesis, cvar_humanarmor, cvar_zombiesilent, cvar_removedropped,
cvar_plagueratio, cvar_blocksuicide, cvar_knockbackdist, cvar_nemdamage, cvar_leapzombies,
cvar_leapzombiesforce, cvar_leapzombiesheight, cvar_leapzombiescooldown, cvar_leapnemesis,
cvar_leapnemesisforce, cvar_leapnemesisheight, cvar_leapnemesiscooldown, cvar_leapsurvivor,
cvar_leapsurvivorforce, cvar_leapsurvivorheight, cvar_nemminplayers, cvar_survminplayers,
cvar_respawnonsuicide, cvar_respawnafterlast, cvar_leapsurvivorcooldown, cvar_statssave,
cvar_swarmminplayers, cvar_multiminplayers, cvar_plagueminplayers, cvar_adminmodelshuman,
cvar_adminmodelszombie, cvar_nembasehp, cvar_blockpushables, cvar_respawnworldspawnkill,
cvar_madnessduration, cvar_plaguenemnum, cvar_plaguenemhpmulti, cvar_plaguesurvhpmulti,
cvar_survweapon, cvar_plaguesurvnum, cvar_infectionscreenfade, cvar_infectionscreenshake,
cvar_infectionsparkle, cvar_infectiontracers, cvar_infectionparticles, cvar_infbomblimit,
cvar_allowrespawnsurv, cvar_flashshowall, cvar_allowrespawninfection, cvar_allowrespawnnem,
cvar_allowrespawnswarm, cvar_allowrespawnplague, cvar_survinfammo, cvar_nemknockback,
cvar_nvgcolor[3], cvar_nemnvgcolor[3], cvar_humnvgcolor[3], cvar_flashcolor[3],
cvar_snipercolor[3], cvar_surv_aura[3],cvar_assassinnvgcolor[3], cvar_flashcolor2[3],
cvar_hudicons, cvar_respawnzomb, cvar_respawnhum, cvar_respawnnem, cvar_respawnsurv,
cvar_startammopacks, cvar_randweapons, cvar_antidotelimit, cvar_madnesslimit,
cvar_adminknifemodelshuman, cvar_adminknifemodelszombie, cvar_keephealthondisconnect,
cvar_buyzonetime, cvar_huddisplay, cvar_maxbuyround,
cvar_sniper, cvar_sniperchance, cvar_sniperminplayers, cvar_sniperdamage, cvar_sniperhp,
cvar_sniperglow, cvar_sniperbasehp, cvar_sniperpainfree, cvar_sniperinfammo, cvar_sniperspd,
cvar_respawnsniper, cvar_snipergravity, cvar_sniperaura, cvar_sniperfraggore,
cvar_sniperignorefrags, cvar_sniperignoreammo, cvar_allowrespawnsniper,cvar_surv_aura_radius ,
cvar_leapsniper, cvar_leapsniperforce, cvar_leapsniperheight, cvar_leapsnipercooldown, cvar_sniperauraradius
// Cached stuff for players
new g_isconnected[33] // whether player is connected
new g_isalive[33] // whether player is alive
new g_isbot[33] // whether player is a bot
new g_currentweapon[33] // player's current weapon id
new g_playername[33][32] // player's name
new Float:g_zombie_spd[33] // zombie class speed
new Float:g_zombie_knockback[33] // zombie class knockback
new g_zombie_classname[33][32] // zombie class name
#define is_user_valid_connected(%1) (1 <= %1 <= g_maxplayers && g_isconnected[%1])
#define is_user_valid_alive(%1) (1 <= %1 <= g_maxplayers && g_isalive[%1])
#define is_user_valid(%1) (1 <= %1 <= g_maxplayers)
// Cached CVARs
new g_cached_customflash, g_cached_zombiesilent, g_cached_leapzombies, g_cached_leapnemesis,
g_cached_leapsurvivor, Float:g_cached_leapzombiescooldown, Float:g_cached_leapnemesiscooldown,
Float:g_cached_leapsurvivorcooldown, g_cached_leapsniper, Float:g_cached_leapsnipercooldown, Float:g_cached_buytime
/*================================================================================
[Natives, Precache and Init]
=================================================================================*/
public plugin_natives()
{
// Player specific natives
register_native("zp_get_user_zombie", "native_get_user_zombie", 1)
register_native("zp_get_user_nemesis", "native_get_user_nemesis", 1)
register_native("zp_get_user_survivor", "native_get_user_survivor", 1)
register_native("zp_get_user_first_zombie", "native_get_user_first_zombie", 1)
register_native("zp_get_user_last_zombie", "native_get_user_last_zombie", 1)
register_native("zp_get_user_last_human", "native_get_user_last_human", 1)
register_native("zp_get_user_zombie_class", "native_get_user_zombie_class", 1)
register_native("zp_get_user_next_class", "native_get_user_next_class", 1)
register_native("zp_set_user_zombie_class", "native_set_user_zombie_class", 1)
register_native("zp_get_user_ammo_packs", "native_get_user_ammo_packs", 1)
register_native("zp_set_user_ammo_packs", "native_set_user_ammo_packs", 1)
register_native("zp_get_zombie_maxhealth", "native_get_zombie_maxhealth", 1)
register_native("zp_get_user_batteries", "native_get_user_batteries", 1)
register_native("zp_set_user_batteries", "native_set_user_batteries", 1)
register_native("zp_get_user_nightvision", "native_get_user_nightvision", 1)
register_native("zp_set_user_nightvision", "native_set_user_nightvision", 1)
register_native("zp_infect_user", "native_infect_user", 1)
register_native("zp_disinfect_user", "native_disinfect_user", 1)
register_native("zp_make_user_nemesis", "native_make_user_nemesis", 1)
register_native("zp_make_user_survivor", "native_make_user_survivor", 1)
register_native("zp_respawn_user", "native_respawn_user", 1)
register_native("zp_force_buy_extra_item", "native_force_buy_extra_item", 1)
register_native("zp_get_user_sniper", "native_get_user_sniper", 1)
register_native("zp_make_user_sniper", "native_make_user_sniper", 1)
register_native("zp_override_user_model", "native_override_user_model", 1)
// Round natives
register_native("zp_has_round_started", "native_has_round_started", 1)
register_native("zp_is_nemesis_round", "native_is_nemesis_round", 1)
register_native("zp_is_survivor_round", "native_is_survivor_round", 1)
register_native("zp_is_swarm_round", "native_is_swarm_round", 1)
register_native("zp_is_plague_round", "native_is_plague_round", 1)
register_native("zp_get_zombie_count", "native_get_zombie_count", 1)
register_native("zp_get_human_count", "native_get_human_count", 1)
register_native("zp_get_nemesis_count", "native_get_nemesis_count", 1)
register_native("zp_get_survivor_count", "native_get_survivor_count", 1)
register_native("zp_is_sniper_round", "native_is_sniper_round", 1)
register_native("zp_get_sniper_count", "native_get_sniper_count", 1)
// External additions natives
register_native("zp_register_extra_item", "native_register_extra_item", 1)
register_native("zp_register_zombie_class", "native_register_zombie_class", 1)
register_native("zp_get_extra_item_id", "native_get_extra_item_id", 1)
register_native("zp_get_zombie_class_id", "native_get_zombie_class_id", 1)
register_native("zp_get_zombie_class_info", "native_get_zombie_class_info", 1)
}
public plugin_precache()
{
// Register earlier to show up in plugins list properly after plugin disable/error at loading
register_plugin("Zombie Plague", PLUGIN_VERSION, "MeRcyLeZZ")
// To switch plugin on/off
register_concmd("zp_toggle", "cmd_toggle", _, "<1/0> - Enable/Disable Zombie Plague (will restart the current map)", 0)
cvar_toggle = register_cvar("zp_on", "1")
// Plugin disabled?
if (!get_pcvar_num(cvar_toggle)) return;
g_pluginenabled = true
// Initialize a few dynamically sized arrays (alright, maybe more than just a few...)
model_human = ArrayCreate(32, 1)
model_nemesis = ArrayCreate(32, 1)
model_survivor = ArrayCreate(32, 1)
model_admin_human = ArrayCreate(32, 1)
model_admin_zombie = ArrayCreate(32, 1)
g_modelindex_human = ArrayCreate(1, 1)
g_modelindex_nemesis = ArrayCreate(1, 1)
g_modelindex_survivor = ArrayCreate(1, 1)
g_modelindex_admin_human = ArrayCreate(1, 1)
g_modelindex_admin_zombie = ArrayCreate(1, 1)
sound_win_zombies = ArrayCreate(64, 1)
sound_win_zombies_ismp3 = ArrayCreate(1, 1)
sound_win_humans = ArrayCreate(64, 1)
sound_win_humans_ismp3 = ArrayCreate(1, 1)
sound_win_no_one = ArrayCreate(64, 1)
sound_win_no_one_ismp3 = ArrayCreate(1, 1)
zombie_infect = ArrayCreate(64, 1)
human_death = ArrayCreate(64, 1)
zombie_pain = ArrayCreate(64, 1)
nemesis_pain = ArrayCreate(64, 1)
zombie_die = ArrayCreate(64, 1)
zombie_fall = ArrayCreate(64, 1)
zombie_miss_slash = ArrayCreate(64, 1)
zombie_miss_wall = ArrayCreate(64, 1)
zombie_hit_normal = ArrayCreate(64, 1)
zombie_hit_stab = ArrayCreate(64, 1)
zombie_madness = ArrayCreate(64, 1)
sound_nemesis = ArrayCreate(64, 1)
sound_survivor = ArrayCreate(64, 1)
sound_swarm = ArrayCreate(64, 1)
sound_multi = ArrayCreate(64, 1)
sound_plague = ArrayCreate(64, 1)
grenade_infect = ArrayCreate(64, 1)
grenade_infect_player = ArrayCreate(64, 1)
grenade_fire = ArrayCreate(64, 1)
grenade_fire_player = ArrayCreate(64, 1)
grenade_frost = ArrayCreate(64, 1)
grenade_frost_player = ArrayCreate(64, 1)
grenade_frost_break = ArrayCreate(64, 1)
grenade_flare = ArrayCreate(64, 1)
sound_antidote = ArrayCreate(64, 1)
sound_thunder = ArrayCreate(64, 1)
sound_ambience1 = ArrayCreate(64, 1)
sound_ambience2 = ArrayCreate(64, 1)
sound_ambience3 = ArrayCreate(64, 1)
sound_ambience4 = ArrayCreate(64, 1)
sound_ambience5 = ArrayCreate(64, 1)
sound_ambience1_duration = ArrayCreate(1, 1)
sound_ambience2_duration = ArrayCreate(1, 1)
sound_ambience3_duration = ArrayCreate(1, 1)
sound_ambience4_duration = ArrayCreate(1, 1)
sound_ambience5_duration = ArrayCreate(1, 1)
sound_ambience1_ismp3 = ArrayCreate(1, 1)
sound_ambience2_ismp3 = ArrayCreate(1, 1)
sound_ambience3_ismp3 = ArrayCreate(1, 1)
sound_ambience4_ismp3 = ArrayCreate(1, 1)
sound_ambience5_ismp3 = ArrayCreate(1, 1)
g_primary_items = ArrayCreate(32, 1)
g_secondary_items = ArrayCreate(32, 1)
g_additional_items = ArrayCreate(32, 1)
g_primary_weaponids = ArrayCreate(1, 1)
g_secondary_weaponids = ArrayCreate(1, 1)
g_extraweapon_names = ArrayCreate(32, 1)
g_extraweapon_items = ArrayCreate(32, 1)
g_extraweapon_costs = ArrayCreate(1, 1)
g_sky_names = ArrayCreate(32, 1)
lights_thunder = ArrayCreate(32, 1)
zombie_decals = ArrayCreate(1, 1)
g_objective_ents = ArrayCreate(32, 1)
g_extraitem_name = ArrayCreate(32, 1)
g_extraitem_cost = ArrayCreate(1, 1)
g_extraitem_team = ArrayCreate(1, 1)
g_extraitem2_realname = ArrayCreate(32, 1)
g_extraitem2_name = ArrayCreate(32, 1)
g_extraitem2_cost = ArrayCreate(1, 1)
g_extraitem2_team = ArrayCreate(1, 1)
g_extraitem_new = ArrayCreate(1, 1)
g_zclass_name = ArrayCreate(32, 1)
g_zclass_info = ArrayCreate(32, 1)
g_zclass_modelsstart = ArrayCreate(1, 1)
g_zclass_modelsend = ArrayCreate(1, 1)
g_zclass_playermodel = ArrayCreate(32, 1)
g_zclass_modelindex = ArrayCreate(1, 1)
g_zclass_clawmodel = ArrayCreate(32, 1)
g_zclass_hp = ArrayCreate(1, 1)
g_zclass_spd = ArrayCreate(1, 1)
g_zclass_grav = ArrayCreate(1, 1)
g_zclass_kb = ArrayCreate(1, 1)
g_zclass_lvl = ArrayCreate(1, 1)
g_zclass2_realname = ArrayCreate(32, 1)
g_zclass2_name = ArrayCreate(32, 1)
g_zclass2_info = ArrayCreate(32, 1)
g_zclass2_modelsstart = ArrayCreate(1, 1)
g_zclass2_modelsend = ArrayCreate(1, 1)
g_zclass2_playermodel = ArrayCreate(32, 1)
g_zclass2_modelindex = ArrayCreate(1, 1)
g_zclass2_clawmodel = ArrayCreate(32, 1)
g_zclass2_hp = ArrayCreate(1, 1)
g_zclass2_spd = ArrayCreate(1, 1)
g_zclass2_grav = ArrayCreate(1, 1)
g_zclass2_kb = ArrayCreate(1, 1)
g_zclass2_lvl = ArrayCreate(1, 1)
g_zclass_new = ArrayCreate(1, 1)
model_sniper = ArrayCreate(32, 1)
g_modelindex_sniper = ArrayCreate(1, 1)
sound_sniper = ArrayCreate(64, 1)
sound_ambience6 = ArrayCreate(64, 1)
sound_ambience6_duration = ArrayCreate(1, 1)
sound_ambience6_ismp3 = ArrayCreate(1, 1)
m_spriteTexture = precache_model("sprites/dot.spr")
// Allow registering stuff now
g_arrays_created = true
// Load customization data
load_customization_from_files()
new i, buffer[100]
// Load up the hard coded extra items
native_register_extra_item2("NightVision", g_extra_costs2[EXTRA_NVISION], ZP_TEAM_HUMAN)
native_register_extra_item2("T-Virus Antidote", g_extra_costs2[EXTRA_ANTIDOTE], ZP_TEAM_ZOMBIE)
native_register_extra_item2("Zombie Madness", g_extra_costs2[EXTRA_MADNESS], ZP_TEAM_ZOMBIE)
native_register_extra_item2("Infection Bomb", g_extra_costs2[EXTRA_INFBOMB], ZP_TEAM_ZOMBIE)
// Extra weapons
for (i = 0; i < ArraySize(g_extraweapon_names); i++)
{
ArrayGetString(g_extraweapon_names, i, buffer, charsmax(buffer))
native_register_extra_item2(buffer, ArrayGetCell(g_extraweapon_costs, i), ZP_TEAM_HUMAN)
}
// Custom player models
for (i = 0; i < ArraySize(model_human); i++)
{
ArrayGetString(model_human, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_human, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
for (i = 0; i < ArraySize(model_nemesis); i++)
{
ArrayGetString(model_nemesis, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_nemesis, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
for (i = 0; i < ArraySize(model_survivor); i++)
{
ArrayGetString(model_survivor, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_survivor, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
for (i = 0; i < ArraySize(model_admin_zombie); i++)
{
ArrayGetString(model_admin_zombie, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_admin_zombie, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
for (i = 0; i < ArraySize(model_admin_human); i++)
{
ArrayGetString(model_admin_human, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_admin_human, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
for (i = 0; i < ArraySize(model_sniper); i++)
{
ArrayGetString(model_sniper, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_sniper, engfunc(EngFunc_PrecacheModel, buffer))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
// Precache modelT.mdl files too
copy(buffer[strlen(buffer)-4], charsmax(buffer) - (strlen(buffer)-4), "T.mdl")
if (file_exists(buffer)) engfunc(EngFunc_PrecacheModel, buffer)
}
// Custom weapon models
engfunc(EngFunc_PrecacheModel, model_vknife_human)
engfunc(EngFunc_PrecacheModel, model_vknife_nemesis)
engfunc(EngFunc_PrecacheModel, model_vweapon_survivor)
engfunc(EngFunc_PrecacheModel, model_grenade_infect)
engfunc(EngFunc_PrecacheModel, model_grenade_fire)
engfunc(EngFunc_PrecacheModel, model_grenade_frost)
engfunc(EngFunc_PrecacheModel, model_grenade_flare)
engfunc(EngFunc_PrecacheModel, model_vknife_admin_human)
engfunc(EngFunc_PrecacheModel, model_vknife_admin_zombie)
engfunc(EngFunc_PrecacheModel, model_vawp_sniper)
// Custom sprites for grenades
g_trailSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_trail)
g_exploSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_ring)
g_flameSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_fire)
g_smokeSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_smoke)
g_glassSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_glass)
g_ExploSprFrost = precache_model("sprites/ze_wwdp_grenade/buz_kurukafa.spr")
g_iFlareFrost = precache_model("sprites/ze_wwdp_grenade/buz_parcacigi.spr")
g_ExploSprFire = precache_model("sprites/ze_wwdp_grenade/ates_kurukafa.spr")
g_iFlareFire = precache_model("sprites/ze_wwdp_grenade/ates_parcacigi.spr")
// Custom sounds
for (i = 0; i < ArraySize(sound_win_zombies); i++)
{
ArrayGetString(sound_win_zombies, i, buffer, charsmax(buffer))
if (ArrayGetCell(sound_win_zombies_ismp3, i))
{
format(buffer, charsmax(buffer), "sound/%s", buffer)
engfunc(EngFunc_PrecacheGeneric, buffer)
}
else
{
engfunc(EngFunc_PrecacheSound, buffer)
}
}
for (i = 0; i < ArraySize(sound_win_humans); i++)
{
ArrayGetString(sound_win_humans, i, buffer, charsmax(buffer))
if (ArrayGetCell(sound_win_humans_ismp3, i))
{
format(buffer, charsmax(buffer), "sound/%s", buffer)
engfunc(EngFunc_PrecacheGeneric, buffer)
}
else
{
engfunc(EngFunc_PrecacheSound, buffer)
}
}
for (i = 0; i < ArraySize(sound_win_no_one); i++)
{
ArrayGetString(sound_win_no_one, i, buffer, charsmax(buffer))
if (ArrayGetCell(sound_win_no_one_ismp3, i))
{
format(buffer, charsmax(buffer), "sound/%s", buffer)
engfunc(EngFunc_PrecacheGeneric, buffer)
}
else
{
engfunc(EngFunc_PrecacheSound, buffer)
}
}
for (i = 0; i < ArraySize(zombie_infect); i++)
{
ArrayGetString(zombie_infect, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(human_death); i++)
{
ArrayGetString(human_death, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_pain); i++)
{
ArrayGetString(zombie_pain, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(nemesis_pain); i++)
{
ArrayGetString(nemesis_pain, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_die); i++)
{
ArrayGetString(zombie_die, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_fall); i++)
{
ArrayGetString(zombie_fall, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_miss_slash); i++)
{
ArrayGetString(zombie_miss_slash, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_miss_wall); i++)
{
ArrayGetString(zombie_miss_wall, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_hit_normal); i++)
{
ArrayGetString(zombie_hit_normal, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_hit_stab); i++)
{
ArrayGetString(zombie_hit_stab, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(zombie_madness); i++)
{
ArrayGetString(zombie_madness, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(sound_nemesis); i++)
{
ArrayGetString(sound_nemesis, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(sound_survivor); i++)
{
ArrayGetString(sound_survivor, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(sound_swarm); i++)
{
ArrayGetString(sound_swarm, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(sound_multi); i++)
{
ArrayGetString(sound_multi, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(sound_plague); i++)
{
ArrayGetString(sound_plague, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_infect); i++)
{
ArrayGetString(grenade_infect, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_infect_player); i++)
{
ArrayGetString(grenade_infect_player, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_fire); i++)
{
ArrayGetString(grenade_fire, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_fire_player); i++)
{
ArrayGetString(grenade_fire_player, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_frost); i++)
{
ArrayGetString(grenade_frost, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_frost_player); i++)
{
ArrayGetString(grenade_frost_player, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < ArraySize(grenade_frost_break); i++)