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