Mr-Co0L

Untitled

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