Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.40 KB | None | 0 0
  1. //* Includes */
  2.  
  3. #include < amxmodx >
  4. #include < cstrike >
  5. #include < fakemeta_util >
  6. #include < fakemeta >
  7. #include < hamsandwich >
  8. #include < csx >
  9. #include < engine >
  10. #include < dhudmessage >
  11. #include < amxmisc >
  12. #include < fun >
  13.  
  14. /* Natives */
  15.  
  16. native get_user_cash( const index );
  17. native set_user_cash( const index, cash );
  18.  
  19. native remove_sgdrill( const index );
  20. native give_sgdrill( const index );
  21.  
  22. native set_glow();
  23. native remove_glow();
  24.  
  25. native is_running_vote( const index );
  26.  
  27. native give_pumpkin__( const index );
  28. native remove_pumpkin__( const index );
  29.  
  30. native get_cannon( const index );
  31. native remove_cannon( const index );
  32.  
  33. /* Defines */
  34.  
  35. #define TASKID_VOTE 1500
  36. #define TASKID_TIMER 1501
  37. #define TASKID_MESSAGE 1502
  38. #define TASKID_CLIENTMSG 1503
  39. #define g_mCountdownTask2 1615
  40.  
  41. #define MAX_AMMO 75
  42. #define RELOAD_TIME 10.0
  43. #define TIME_LEFT 40
  44.  
  45. /* Enums */
  46.  
  47. #define MAX_PLAYERS 32
  48. #define Keysasd (1<<0) // Keys: 1
  49.  
  50. native remove_speargun( index );
  51. native give_speargun( index );
  52.  
  53. enum _:g_mDaysData{
  54.  
  55. DAY_FREE,
  56. DAY_NIGHT,
  57. DAY_SHARK,
  58. DAY_WAR,
  59. DAY_PWAR,
  60. DAY_KNIFE,
  61. DAY_BOX,
  62. DAY_GUNGAME,
  63. DAY_TUG,
  64. DAY_DEAGLE,
  65. DAY_PDEAGLE,
  66. DAY_PSHOT,
  67. DAY_HEG,
  68. DAY_PHEG,
  69. DAY_SNIPERS,
  70. DAY_DODGEBALL,
  71. DAY_LASER,
  72. DAY_ZOMBIE,
  73. DAY_AWP,
  74. DAY_SHOTGUN,
  75. DAY_DM,
  76. DAY_SPEARGUN,
  77. DAY_TACTICAL,
  78. DAY_PUMPKIN,
  79. DAY_CANNON,
  80. DAY_SGDRILL,
  81. DAY_1HPBOXDAY,
  82. DAY_HEADSHOT
  83. };
  84.  
  85. new const szPrefix[ ] = "Top Jailbreak";
  86.  
  87. new const iWeaponEntName[][] = {
  88. "weapon_knife",
  89. "weapon_hegrenade",
  90. "weapon_smokegrenade",
  91. "weapon_flashbang",
  92. "weapon_deagle",
  93. "weapon_m4a1",
  94. "weapon_ak47",
  95. "weapon_awp",
  96. "weapon_m249",
  97. "weapon_shield",
  98. "weapon_famas",
  99. "weapon_elite"
  100. };
  101.  
  102. new const iWeaponNum[] = {
  103. CSW_KNIFE,
  104. CSW_HEGRENADE,
  105. CSW_SMOKEGRENADE,
  106. CSW_FLASHBANG,
  107. CSW_DEAGLE,
  108. CSW_M4A1,
  109. CSW_AK47,
  110. CSW_AWP,
  111. CSW_M249,
  112. CSW_KNIFE,
  113. CSW_FAMAS,
  114. CSW_ELITE
  115. };
  116.  
  117. new const iGunEntName[][] = {
  118. "weapon_glock18",
  119. "weapon_usp",
  120. "weapon_deagle",
  121. "weapon_elite",
  122. "weapon_mac10",
  123. "weapon_m3",
  124. "weapon_xm1014",
  125. "weapon_mp5navy",
  126. "weapon_awp",
  127. "weapon_scout",
  128. "weapon_m4a1",
  129. "weapon_ak47",
  130. "weapon_m249",
  131. "weapon_knife",
  132. "weapon_hegrenade"
  133. };
  134.  
  135. new const iGunNum[] = {
  136. CSW_GLOCK18,
  137. CSW_USP,
  138. CSW_DEAGLE,
  139. CSW_ELITE,
  140. CSW_MAC10,
  141. CSW_M3,
  142. CSW_XM1014,
  143. CSW_MP5NAVY,
  144. CSW_AWP,
  145. CSW_SCOUT,
  146. CSW_M4A1,
  147. CSW_AK47,
  148. CSW_M249,
  149. CSW_KNIFE,
  150. CSW_HEGRENADE
  151. };
  152.  
  153. /* Array's & String's */
  154.  
  155. new szViewer[ ][ ] ={
  156.  
  157. "Sunday",
  158. "Monday",
  159. "Tuesday",
  160. "Wednesday",
  161. "Thursday",
  162. "Friday",
  163. "Special Day"
  164. };
  165.  
  166. new szDays[ g_mDaysData ][ ] ={
  167.  
  168. "Freeday",
  169. "NightCrawler Day",
  170. "Shark Day",
  171. "War Day",
  172. "Prisoners War Day",
  173. "Knife Day",
  174. "Box Day",
  175. "Gun Game Day",
  176. "Tug Day",
  177. "Deagle Day",
  178. "Power Deagle Day",
  179. "Power ShotGun Day",
  180. "Grenades Day",
  181. "Power Grenades Day",
  182. "Snipers Day",
  183. "Dodgeball Day",
  184. "Laser Day",
  185. "Zombie Day",
  186. "Awp Day",
  187. "ShotGun Day",
  188. "DeadMatch Day",
  189. "SpearGun Day",
  190. "Tactical Knifes Throwing Day",
  191. "Pumpkin Grenade Day",
  192. "Cannon Day",
  193. "Sgdrill Day",
  194. "1 Hp Box Day",
  195. "HeadShot Day"
  196.  
  197.  
  198. };
  199.  
  200. new g_mModels[ ][ ] ={
  201.  
  202. "models/AMXX/JB/LR/p_dodgeball.mdl",
  203. "models/AMXX/JB/LR/v_dodgeball.mdl",
  204. "models/AMXX/JB/LR/w_dodgeball.mdl"
  205. };
  206.  
  207. new g_iModels[ ][ ] ={
  208.  
  209. "models/AMXX/JB/Days/v_laser.mdl",
  210. "models/AMXX/JB/Days/p_laser.mdl"
  211. };
  212.  
  213. new g_iSounds[ ][ ] ={
  214.  
  215. "AMXX/JB/Days/laser_fire.wav",
  216. "AMXX/JB/Days/laser_hit.wav"
  217. };
  218.  
  219. new g_iZombie[ ] = "models/AMXX/JB/Days/v_zombieday.mdl";
  220. new g_iVote[ ] = "AMXX/JB/Days/specialday.mp3";
  221.  
  222. new g_mSound[ ] = "weapons/g_bounce.wav";
  223.  
  224. new g_mSprite[ ] = "sprites/AMXX/flame.spr";
  225.  
  226. new szMap[ 32 ], szItem[ 256 ], szAttacker[ 33 ][ 128 ];
  227. new GunLevel[33],XpLevel[33];
  228. new CountDie[33]
  229.  
  230.  
  231. /* Variables */
  232.  
  233. new iDay = -1, iRound, g_iMaxPlayers, iTaskid, dVoteMenu, dOption[ 4 ], dVotes[ 4 ], dCount, dVoters, g_iMinutes = 5, g_iSeconds = 0;
  234. new g_mTrail, g_mBlood, g_mDay;
  235.  
  236. /* Integers & Floats */
  237.  
  238. new Float: g_iOrigin[ 32 ][ 3 ], Float: fnAttack[ 33 ], Float: fnTime[ 33 ], g_mAmmo[ 33 ], Float: g_fCount;
  239. new g_iTimer[ 33 ], Float: fnAttackTime[ 33 ], g_iDays[ 33 ];
  240.  
  241. /* Booleans */
  242.  
  243. new bool: bVoted[ 33 ], bool: bVote, bool: bAttacker, bool: bTimeleft;
  244. new bool:iGunGame;
  245. new bool:TofesetDay,TofesetT[32]
  246.  
  247. new iBallsThrown[ MAX_PLAYERS + 1 ];
  248.  
  249.  
  250. native give_tactical( index );
  251. native remove_tactical( index );
  252.  
  253. public plugin_init()
  254. {
  255. register_plugin( "JailBreak Days", "1.0", "Built by Rejack || Edit by @.TheBomB`" );
  256.  
  257.  
  258. /* Client Commands */
  259. register_clcmd( "say /days", "CmdDays" );
  260. register_clcmd( "say /fd", "CmdStartFreeday" );
  261. register_clcmd( "drop", "CmdDrop" );
  262.  
  263. /* Events */
  264. register_event( "CurWeapon", "evCurWeapon", "b" );
  265. register_event( "DeathMsg", "evDeathMsg", "a" );
  266.  
  267. /* Log Events */
  268. register_logevent( "evRoundStart", 2, "1=Round_Start" );
  269.  
  270. /* Messages */
  271. register_message( get_user_msgid( "SendAudio" ), "MsgAudio" );
  272. register_message( get_user_msgid( "TextMsg" ), "MsgText" );
  273.  
  274. /* Touch */
  275. register_touch( "*", "player", "PlayerInteract" );
  276. register_touch( "grenade", "*", "BallInteract" );
  277.  
  278.  
  279. /* Forwards */
  280. register_forward( FM_Touch, "FwdTouch" );
  281. register_forward( FM_SetModel, "FwdSetModel", 0 );
  282. register_forward( FM_EmitSound, "FwdEmitSound", 0 );
  283. register_forward( FM_PlayerPreThink, "FwdPreThink" );
  284.  
  285.  
  286.  
  287. /* Ham Forwards */
  288. RegisterHam( Ham_TakeDamage, "player", "FwdTakeDamage", true );
  289. RegisterHam( Ham_Use, "func_button", "FwdUseButton" );
  290. RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );
  291. RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );
  292. RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "FwdWeaponPrimaryAttack" );
  293. RegisterHam( Ham_Killed, "player", "FwdHamPlayerKiller", 1)
  294.  
  295. /* Think */
  296. register_think( "grenade", "FwdThinkGrenade" );
  297.  
  298. /* Others */
  299. get_mapname( szMap, charsmax( szMap ) );
  300.  
  301. g_iMaxPlayers = get_maxplayers();
  302.  
  303. }
  304.  
  305. public plugin_natives(){
  306.  
  307. register_library( "DaysLibrary" );
  308.  
  309. register_native( "is_day", "_is_day" );
  310. register_native( "is_running_vote", "_running_vote" );
  311. register_native( "get_ruuning_day", "_get_day" );
  312. register_native( "get_round", "_get_round" );
  313. register_native( "get_running_day_speargun", "_speargun" );
  314. register_native( "get_running_day_throwing_knifes","_throwing" );
  315. register_native( "get_running_day_pumpkin", "_pumpkin" );
  316. register_native( "get_running_day_cannon", "_cannon" );
  317. register_native( "get_running_day_sgdrill", "_sgdrill" );
  318. }
  319.  
  320.  
  321. public _pumpkin( plugin, params )
  322. return g_mDay == DAY_PUMPKIN ? true : false;
  323.  
  324. public _speargun( plugin, params )
  325. return g_mDay == DAY_SPEARGUN ? true : false;
  326.  
  327. public _throwing( plugin, params )
  328. return g_mDay == DAY_TACTICAL ? true : false;
  329.  
  330. public _cannon( plugin, params )
  331. return g_mDay == DAY_CANNON ? true : false;
  332.  
  333. public _sgdrill( plugin, params )
  334. return g_mDay == DAY_SGDRILL ? true : false;
  335.  
  336.  
  337. public _is_day( plugin, params )
  338. {
  339. if ( g_mDay == -1 )
  340. return false;
  341.  
  342. return true;
  343. }
  344.  
  345. public _running_vote( plugin, params )
  346. return ( bVote && dCount > 0 ) ? true : false;
  347.  
  348. public _get_day( plugin, params )
  349. return g_mDay;
  350.  
  351. public _get_round( plugin, params )
  352. return iDay;
  353.  
  354. public plugin_precache(){
  355. new file[32]
  356. if( !file_exists( file ) )
  357. log_amx( "kovez lo kayam %s", file );
  358. else
  359. precache_model( file );
  360.  
  361.  
  362. for ( new i; i < sizeof g_mModels; i++ )
  363. precache_model( g_mModels[ i ] );
  364.  
  365. for ( new i; i < sizeof g_iModels; i++ ){
  366.  
  367. precache_model( g_iModels[ i ] );
  368.  
  369. precache_sound( g_iSounds[ i ] );
  370. }
  371. precache_model( g_iZombie );
  372.  
  373. precache_model( "models/player/JailBreakZM/JailBreakZM.mdl" );
  374.  
  375. precache_sound( g_mSound );
  376. precache_sound( g_iVote );
  377.  
  378. g_mTrail = precache_model( g_mSprite );
  379. g_mBlood = precache_model( "sprites/blood.spr" );
  380. }
  381.  
  382. public CmdStartFreeday( const client )
  383. {
  384. if ( get_user_flags( client ) & ADMIN_KICK || is_user_alive( client ) && cs_get_user_team( client ) == CS_TEAM_CT )
  385. {
  386. if ( g_mDay > -1 )
  387. return ColorPrint( client, "^3Error: ^1A Day Has Already ^3Started^4." );
  388.  
  389. if ( bVote )
  390. return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4.." );
  391.  
  392. CmdStartDay( 0 );
  393.  
  394. return ColorPrint( 0, "^1%s: ^3%s ^1Started a ^3Freeday ^4!", (get_user_flags( client ) & ADMIN_KICK) ? "ADMIN " : "", szName( client ) );
  395. }
  396.  
  397. return ColorPrint( client, "You have no access to this." );
  398. }
  399.  
  400. public CmdDays( client )
  401. {
  402.  
  403. if ( !( get_user_flags( client ) & ADMIN_KICK ) )
  404. return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
  405.  
  406. if ( g_mDay > -1 )
  407. return ColorPrint( client, "^3Error: ^1A Day Has Already ^3Started^4." );
  408.  
  409. if ( bVote )
  410. return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
  411.  
  412. formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wDays \yMenu\d:", szPrefix );
  413.  
  414. new Menu = menu_create( szItem, "SubDays" );
  415.  
  416. menu_additem( Menu, "Start Special Day^n" );
  417.  
  418. formatex( szItem, charsmax( szItem ), "Selected Day\d: \r%s", szDays[ g_iDays[ client ] ] );
  419.  
  420. menu_additem( Menu, szItem );
  421.  
  422. menu_additem( Menu, "Start \yDays" );
  423.  
  424. menu_display( client, Menu );
  425.  
  426. return 1;
  427. }
  428.  
  429. public SubDays( client, Menu, Item )
  430. {
  431. if ( !( get_user_flags( client ) & ADMIN_KICK ) )
  432. return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
  433.  
  434. if ( g_mDay > -1 )
  435. return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
  436.  
  437. if ( bVote )
  438. return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
  439.  
  440. if ( Item == MENU_EXIT )
  441. {
  442. menu_destroy( Menu );
  443.  
  444. return 1;
  445. }
  446.  
  447. switch ( Item )
  448. {
  449. case 0:
  450. {
  451. CmdReceiveVotes();
  452.  
  453. return ColorPrint( 0, "ADMIN: ^3%s ^1Has Started Special Day^4 !", szName( client ) );
  454. }
  455.  
  456. case 1:
  457. return CmdChooseDays( client );
  458.  
  459. case 2:
  460. {
  461. CmdStartDay( g_iDays[ client ] );
  462.  
  463. return ColorPrint( 0, "ADMIN: ^3%s ^1Has Started ^4%s", szName( client ), szDays[ g_iDays[ client ] ] );
  464. }
  465. }
  466.  
  467. menu_destroy( Menu );
  468.  
  469. return 1;
  470. }
  471.  
  472. public CmdChooseDays( client )
  473. {
  474. if ( !( get_user_flags( client ) & ADMIN_KICK ) )
  475. return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
  476.  
  477. if ( g_mDay > -1 )
  478. return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
  479.  
  480. if ( bVote )
  481. return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
  482.  
  483. formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wSelect a Day^n\wPage\d:\r", szPrefix );
  484.  
  485. new Menu = menu_create( szItem, "SubChooseDays" );
  486.  
  487. for ( new i; i < sizeof szDays; i++ )
  488. menu_additem( Menu, szDays[ i ] );
  489.  
  490. menu_setprop( Menu, MPROP_EXITNAME, "Back" );
  491.  
  492. menu_display( client, Menu );
  493.  
  494. return 1;
  495. }
  496.  
  497. public SubChooseDays( client, Menu, Item )
  498. {
  499. if ( !( get_user_flags( client ) & ADMIN_KICK ) )
  500. return ColorPrint( client, "^3Error: ^1You Don't Have Access To This Command^4." );
  501.  
  502. if ( g_mDay > -1 )
  503. return ColorPrint( client, "^3Error: ^1Day Has Already ^3Started^4." );
  504.  
  505. if ( bVote )
  506. return ColorPrint( client, "^3Error: ^1You Currently Canno't Start a Day^4." );
  507.  
  508. if ( Item == MENU_EXIT )
  509. {
  510. menu_destroy( Menu );
  511.  
  512. CmdDays( client );
  513.  
  514. return 1;
  515. }
  516.  
  517. g_iDays[ client ] = Item;
  518.  
  519. return CmdDays( client );
  520. }
  521.  
  522. /* Vote Days */
  523.  
  524. public CmdReceiveVotes()
  525. {
  526. GiveItem(0, "weapon_knife" );
  527.  
  528. if ( bVote )
  529. return 1;
  530.  
  531. for ( new i; i < sizeof dOption; i++ )
  532. dOption[ i ] = random( g_mDaysData );
  533.  
  534. for ( new i; i < sizeof dOption; i++ )
  535. {
  536. if ( IsItemExists( dOption[ i ], i ) )
  537. return CmdReceiveVotes();
  538. }
  539.  
  540. for ( new i = 1; i < g_iMaxPlayers; i++ )
  541. {
  542. if ( !is_user_connected( i ) )
  543. continue;
  544.  
  545. bVoted[ i ] = false;
  546. }
  547.  
  548. dCount = 18;
  549.  
  550. arrayset( dVotes, 0, sizeof dVotes );
  551.  
  552. dVoters = 0;
  553.  
  554. bVote = true;
  555.  
  556. client_cmd( 0, "mp3 play ^"sound/%s^"", g_iVote );
  557.  
  558. CmdVoteMenu();
  559.  
  560. return 1;
  561. }
  562.  
  563.  
  564. public CmdVoteMenu()
  565. {
  566. if ( !bVote )
  567. return 1;
  568.  
  569. if ( dCount < 1 )
  570. {
  571. CmdEndVote();
  572.  
  573. return 1;
  574. }
  575.  
  576. static Players[ 32 ], iNum/*, iPer*/;
  577.  
  578. get_players( Players, iNum, "ch" );
  579.  
  580. for ( new i; i < iNum; i++ )
  581. formatex( szItem, charsmax( szItem ), "\r[\w%s\r] \wSelect a Special Day!^n^n\wStatus\d: %s\d.",szPrefix, (bVoted[ Players[ i ] ]) ? "\rVoted" : "\yVote", dCount );
  582. dVoteMenu = menu_create( szItem, "SubVoteMenu" );
  583.  
  584. for ( new i; i < 4; i++ )
  585. {
  586. /*
  587. if ( dVotes[ i ] == 0 )
  588. iPer = 0;
  589.  
  590. else
  591. iPer = (100/dVoters) * dVotes[ i ];
  592.  
  593. formatex( szItem, charsmax( szItem ), "%s\d - [\y %i Votes \d]", szDays[ dOption[ i ] ], dVotes[ i ] );*/
  594. formatex( szItem, charsmax( szItem ), "\wDay\w [\y %s\w ] \d- \wVotes \w[\r %i\w ]", szDays[ dOption[ i ] ], dVotes[ i ]);
  595. menu_additem( dVoteMenu, szItem );
  596. }
  597.  
  598. formatex( szItem, charsmax( szItem ), "^n\wTime Left\d: \y%i \wSeconds", dCount );
  599. menu_addtext( dVoteMenu, szItem );
  600.  
  601. menu_setprop( dVoteMenu, 6, -1 );
  602.  
  603. menu_setprop( dVoteMenu, MPROP_EXIT, MEXIT_NEVER );
  604.  
  605. for ( new i; i < iNum; i++ )
  606. menu_display( Players[ i ], dVoteMenu );
  607.  
  608. dCount--;
  609.  
  610. set_task( 1.0, "CmdVoteMenu", TASKID_VOTE );
  611.  
  612. return 1;
  613. }
  614.  
  615. public SubVoteMenu( client, Menu, Item )
  616. {
  617. if ( Item == MENU_EXIT || !bVote || bVoted[ client ] )
  618. return 1;
  619.  
  620. dVotes[ Item ]++;
  621.  
  622. dVoters++;
  623.  
  624. bVoted[ client ] = true;
  625.  
  626. return ColorPrint( 0, "^3%s ^1Has Voted For ^4%s^3.", szName( client ), szDays[ dOption[ Item ] ] );
  627. }
  628.  
  629. public CmdEndVote()
  630. {
  631. for ( new i = 1; i < g_iMaxPlayers; i++ )
  632. {
  633. if ( !is_user_connected( i ) )
  634. continue;
  635.  
  636. show_menu( i, 0, "^n", 1 );
  637. }
  638.  
  639. static iVoted;
  640.  
  641. if ( dVotes[ 0 ] > dVotes[ 1 ] && dVotes[ 0 ] > dVotes[ 2 ] && dVotes[ 0 ] > dVotes[ 3 ] )
  642. iVoted = 0;
  643.  
  644. else if ( dVotes[ 1 ] > dVotes[ 0 ] && dVotes[ 1 ] > dVotes[ 2 ] && dVotes[ 1 ] > dVotes[ 3 ] )
  645. iVoted = 1;
  646.  
  647. else if ( dVotes[ 2 ] > dVotes[ 0 ] && dVotes[ 2 ] > dVotes[ 1 ] && dVotes[ 2 ] > dVotes[ 3 ] )
  648. iVoted = 2;
  649.  
  650. else if ( dVotes[ 3 ] > dVotes[ 0 ] && dVotes[ 3 ] > dVotes[ 1 ] && dVotes[ 3 ] > dVotes[ 2 ] )
  651. iVoted = 3;
  652.  
  653. else iVoted = random( 4 );
  654.  
  655. ColorPrint( 0, "The Day Has Been Choosed Is^4: ^3%s ^1With ^4%i ^1Votes ^3 !", szDays[ dOption[ iVoted ] ], dVotes[ iVoted ] );
  656.  
  657. menu_destroy( dVoteMenu );
  658.  
  659. CmdStartDay( dOption[ iVoted ] );
  660.  
  661. return 1;
  662. }
  663.  
  664.  
  665. /* Functions */
  666.  
  667. public CmdFadeScreen( taskid )
  668. {
  669. taskid = taskid - 1000;
  670.  
  671. if ( (taskid/2) == 15 /*Seconds*/ )
  672. return 1;
  673.  
  674. for ( new i; i < g_iMaxPlayers; i++ )
  675. {
  676. if ( !is_user_connected( i ) )
  677. continue;
  678.  
  679. set_user_fade( i, 0.5, random( 255 ), random( 255 ), random( 255 ), 150 ); /* Random Color */
  680. }
  681.  
  682. taskid++;
  683.  
  684. iTaskid = taskid + 1000;
  685.  
  686. set_task( 0.5, "CmdFadeScreen", iTaskid );
  687.  
  688. return 1;
  689. }
  690.  
  691. public CmdCreateCountdown()
  692. {
  693. if ( g_fCount <= 0 )
  694. {
  695. return 1;
  696. }
  697.  
  698. return 1;
  699. }
  700.  
  701. /* Blocks */
  702.  
  703. public CmdDrop( client )
  704. {
  705. if ( g_mDay == -1 || g_mDay == DAY_FREE )
  706. return 0;
  707.  
  708. return 1;
  709. }
  710.  
  711. public FwdHamPlayerPickup( ent, client )
  712. {
  713. if ( !is_user_connected( client ) )
  714. return 1;
  715.  
  716. if ( g_mDay == -1 || g_mDay == DAY_FREE )
  717. return 1;
  718.  
  719. return 4;
  720. }
  721.  
  722. public FwdUseButton()
  723. {
  724. if ( g_mDay == -1 || g_mDay == DAY_FREE )
  725. return 1;
  726.  
  727. return 4;
  728. }
  729.  
  730. /* Events */
  731.  
  732. public client_disconnect( client )
  733. {
  734. if ( g_mDay == -1 )
  735. return 1;
  736.  
  737. set_task( 0.5, "taskCheckDays" );
  738.  
  739. return 1;
  740. }
  741.  
  742. public taskCheckDays(id)
  743. {
  744. if ( g_mDay == -1 )
  745. return 1;
  746.  
  747. if( g_mDay == DAY_SPEARGUN )
  748. {
  749. for( new i = 1; i < 33 ;i++ )
  750. remove_speargun( i );
  751. }
  752.  
  753.  
  754. if ( TeamCount( "CT", "aceh" ) == 0 )
  755. {
  756. ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Guards^4.", szDays[ g_mDay ] );
  757.  
  758. StopDaysOnline();
  759. }
  760.  
  761. if ( TeamCount( "TERRORIST", "aceh" ) < 1 )
  762. {
  763. ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Prisoner^4.", szDays[ g_mDay ] );
  764.  
  765. StopDaysOnline();
  766. }
  767.  
  768. if ( TeamCount( "TERRORIST", "aceh" ) == 1 && TeamCount( "CT", "aceh" ) > 0 )
  769. {
  770. ColorPrint( 0, "^3%s ^1Stopped Due To a Lack Of ^4Online ^3Prisoner^4.", szDays[ g_mDay ] );
  771.  
  772. static Players[ 32 ], iNum, client;
  773.  
  774. get_players( Players, iNum, "aceh", "TERRORIST" );
  775.  
  776. for(new i=1;i<33;i++) { if(is_user_connected(i)) { client_cmd( i, "say /music" ); } }
  777.  
  778. ColorPrint( 0, "^3%s ^1Has Won The Day And Recived^4 1,000 ^1Cash ^3!", szName( client ), szDays[ g_mDay ] );
  779.  
  780. set_user_cash( client, get_user_cash( client ) + 1000 );
  781.  
  782. StopDaysOnline();
  783. }
  784.  
  785. return 1;
  786. }
  787.  
  788. public TimerFrozen(taskid)
  789. {
  790. new id = taskid - 9999;
  791.  
  792. if( CountDie[ id ] == 0 )
  793. {
  794. set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
  795. user_kill(id)
  796. remove_task(taskid)
  797. }
  798. else
  799. {
  800. set_hudmessage( id, 85, 255, -1.0, 0.10, 1, 6.0, 1.1 );
  801. show_hudmessage(id, "Freeze time will end and kill you in : %i", CountDie[ id ] )
  802. CountDie[ id ] -- ;
  803. }
  804. }
  805.  
  806. public evRoundStart()
  807. {
  808.  
  809. StopDaysOnline();
  810.  
  811. TofesetDay = false
  812.  
  813. if( iDay >= sizeof( szViewer ) -1 )
  814. iDay = -1;
  815.  
  816. iDay++; iRound++;
  817.  
  818. if ( iDay == -1 )
  819. return 0;
  820.  
  821. set_hudmessage( random( 255 ), random( 255 ), random( 255 ), -1.0, 0.65, 2, 3.0, 5.0 );
  822.  
  823. show_hudmessage( 0, "( AMXX # JailBreak )^nToday is %s!^nMaps playing at %s^nOnline Players: %i Player%s", szViewer[ iDay ], szMap, TeamCount( "", "ch" ), (TeamCount("","ch") > 1) ? "s" : "" );
  824.  
  825. if ( iDay == 6 && TeamCount( "CT", "aceh" ) > 0 && TeamCount( "TERRORIST", "aceh" ) > 1 )
  826. CmdReceiveVotes();
  827.  
  828. return 0;
  829. }
  830.  
  831. public evCurWeapon( client )
  832. {
  833. if ( !is_user_alive( client ) || !is_user_connected( client ) )
  834. return 0;
  835.  
  836. if ( g_mDay == DAY_DODGEBALL && get_user_weapon( client ) == CSW_HEGRENADE )
  837. {
  838. entity_set_string( client, EV_SZ_viewmodel, g_mModels[ 1 ] );
  839.  
  840. entity_set_string( client, EV_SZ_weaponmodel, g_mModels[ 0 ] );
  841. }
  842.  
  843. if ( g_mDay == DAY_LASER && get_user_weapon( client ) == CSW_DEAGLE )
  844. {
  845. entity_set_string( client, EV_SZ_viewmodel, g_iModels[ 0 ] );
  846. entity_set_string( client, EV_SZ_weaponmodel, g_iModels[ 1 ] );
  847. }
  848.  
  849. if ( g_mDay == DAY_ZOMBIE && get_user_weapon( client ) == CSW_KNIFE && cs_get_user_team( client ) == CS_TEAM_CT )
  850. entity_set_string( client, EV_SZ_viewmodel, g_iZombie );
  851.  
  852. return 0;
  853. }
  854.  
  855. public evDeathMsg()
  856. {
  857. if ( g_mDay == -1 )
  858. return 0;
  859.  
  860. new iAttacker = read_data( 1 );
  861. new iVictim = read_data( 2 );
  862.  
  863. if( g_mDay == DAY_SPEARGUN && iAttacker != iVictim )
  864. remove_speargun( iVictim );
  865.  
  866. if ( TeamCount( "TERRORIST", "aceh" ) < 2 )
  867. {
  868. if ( TeamCount( "TERRORIST", "aceh" ) == 1 )
  869. {
  870. static Players[ 32 ], iNum, client, iPlayer;
  871.  
  872. get_players( Players, iNum, "ach" );
  873.  
  874. for ( new i; i < iNum; i++ )
  875. {
  876. iPlayer = Players[ i ];
  877.  
  878. fm_strip_user_weapons( iPlayer );
  879.  
  880. fm_set_user_health( iPlayer, 100 );
  881.  
  882. fm_set_user_godmode( iPlayer, 0 );
  883.  
  884. fm_set_user_rendering( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16 );
  885.  
  886. if ( cs_get_user_team( iPlayer ) == CS_TEAM_T )
  887. client = Players[ i ];
  888.  
  889. else if ( cs_get_user_team( iPlayer ) == CS_TEAM_CT )
  890. {
  891. fm_give_item( iPlayer, "weapon_knife" );
  892. }
  893. }
  894.  
  895. ColorPrint( 0, "^3%s ^1Has Won The Day And Recived^4 1,000 ^1Cash ^3!", szName( client ), szDays[ g_mDay ] );
  896.  
  897. set_user_cash( client, get_user_cash( client ) + 1000 );
  898. }
  899.  
  900. StopDaysOnline();
  901. }
  902.  
  903. return 0;
  904. }
  905.  
  906. stock StopDaysOnline()
  907. {
  908. set_cvar_num( "mp_friendlyfire", 0 );
  909.  
  910. set_user_hitzones(0, 0, 255)
  911.  
  912. if( g_mDay == DAY_LASER )
  913. {
  914. for( new i = 1; i < 33 ;i++ )
  915. {
  916. if( is_user_connected( i ) )
  917. remove_speargun( i );
  918. }
  919. }
  920.  
  921. if( g_mDay == DAY_SPEARGUN )
  922. {
  923. for( new i = 1; i < 33 ;i++ )
  924. {
  925. if( is_user_connected( i ) )
  926. remove_speargun( i );
  927. }
  928. }
  929.  
  930. if( g_mDay == DAY_CANNON )
  931. {
  932. for( new i = 1; i < 33 ;i++ )
  933. {
  934. if( is_user_connected( i ) )
  935. remove_cannon( i );
  936. }
  937. }
  938.  
  939. if( g_mDay == DAY_PUMPKIN )
  940. {
  941. for( new i = 1; i < 33 ;i++ )
  942. {
  943. if( is_user_connected( i ) )
  944. remove_pumpkin__( i );
  945. }
  946. }
  947.  
  948. if( g_mDay == DAY_SGDRILL )
  949. {
  950. for( new i = 1; i < 33 ;i++ )
  951. {
  952. if( is_user_connected( i ) )
  953. remove_sgdrill( i );
  954. }
  955. }
  956.  
  957. /* Stop Vote */
  958. dCount = 0;
  959. arrayset( dVotes, 0, sizeof dVotes );
  960. client_cmd( 0, "mp3 stop" );
  961.  
  962. /* Remove Tasks */
  963. remove_task( TASKID_VOTE );
  964. remove_task( TASKID_TIMER );
  965. remove_task( TASKID_MESSAGE );
  966. remove_task( TASKID_CLIENTMSG );
  967. if ( task_exists( iTaskid ) )
  968. remove_task( iTaskid );
  969.  
  970. /* Reset Booleans */
  971. bVote = false;
  972. bAttacker = false;
  973. bTimeleft = false;
  974. TofesetDay = false;
  975.  
  976.  
  977.  
  978. /* Remove Dodgeball */
  979. new ent;
  980.  
  981. while( ( ent = fm_find_ent_by_class( ent, "grenade" ) ) != 0 )
  982. fm_remove_entity( ent );
  983.  
  984. /* Variables */
  985. g_mDay = -1;
  986. g_fCount = 0.0;
  987.  
  988. /* Set Cvars */
  989. set_cvar_num( "sv_airaccelerate", 100 );
  990. set_cvar_num( "mp_friendlyfire", 0 );
  991. set_cvar_num( "bh_enabled", 1 );
  992.  
  993. /* Clear Settings */
  994. set_lights( "#OFF" );
  995. CreateFog( 0, .clear = true );
  996. remove_glow();
  997.  
  998. static Players[ 32 ], iNum, iPlayer;
  999.  
  1000. get_players( Players, iNum, "ach" );
  1001.  
  1002. for ( new i; i < iNum; i++ )
  1003. {
  1004. iPlayer = Players[ i ];
  1005.  
  1006. fm_strip_user_weapons( iPlayer );
  1007.  
  1008. fm_give_item( iPlayer, "weapon_knife" );
  1009.  
  1010. fm_set_user_godmode( iPlayer, 0 );
  1011.  
  1012. cs_reset_user_model( iPlayer );
  1013.  
  1014. fm_set_user_rendering( iPlayer );
  1015.  
  1016. if ( cs_get_user_team( iPlayer ) == CS_TEAM_CT )
  1017. {
  1018. fm_give_item( iPlayer, "weapon_m4a1" );
  1019.  
  1020. fm_give_item( iPlayer, "weapon_deagle" );
  1021.  
  1022. cs_set_user_bpammo( iPlayer, CSW_M4A1, 9999 );
  1023.  
  1024. cs_set_user_bpammo( iPlayer, CSW_DEAGLE, 9999 );
  1025. }
  1026. }
  1027.  
  1028. /* Reset Menus */
  1029.  
  1030. get_players( Players, iNum, "ch" );
  1031.  
  1032. for ( new i; i < iNum; i++ )
  1033. show_menu( Players[ i ], 0, "^n", 1 );
  1034.  
  1035. return 1;
  1036. }
  1037.  
  1038. public FwdHamPlayerKiller( client, attacker, victim )
  1039. {
  1040.  
  1041. if( g_mDay == DAY_DM && cs_get_user_team( client ) == CS_TEAM_T )
  1042. {
  1043.  
  1044. set_task( 0.1 ,"Respawn", client)
  1045. fm_strip_user_weapons(client);
  1046. set_hudmessage( random ( 255 ), random( 255 ), random( 255 ), -1.0, 0.30, 0, 0.0, 1.1, 0.0, 0.0, -1)
  1047. show_hudmessage( client, "You will respawn in 5 seconds")
  1048.  
  1049.  
  1050. }
  1051.  
  1052. if(iGunGame && cs_get_user_team(client) == CS_TEAM_T)
  1053. {
  1054. set_task( 1.0, "Respawn", client );
  1055. fm_strip_user_weapons(client);
  1056. }
  1057.  
  1058. if(g_mDay == DAY_GUNGAME && cs_get_user_team(client) == CS_TEAM_T)
  1059. {
  1060. set_task( 1.0, "Respawn", client );
  1061. fm_strip_user_weapons(client);
  1062. }
  1063.  
  1064. new CsTeams: iTeam[ 2 ];
  1065.  
  1066. iTeam[ 0 ] = cs_get_user_team( attacker );
  1067.  
  1068. iTeam[ 1 ] = cs_get_user_team( victim );
  1069.  
  1070. if(iGunGame)
  1071. {
  1072. if ( iTeam[ 0 ] == iTeam[ 1 ] || iTeam[ 0 ] != CS_TEAM_T || iTeam[ 1 ] != CS_TEAM_CT )
  1073. {
  1074. XpLevel[ attacker ]++;
  1075. if( 2 <= XpLevel[ attacker ] )
  1076. {
  1077. GunLevel[ attacker ]++;
  1078. XpLevel[ attacker ] = 0;
  1079. if( GunLevel[ attacker ] >= 15 )
  1080. {
  1081. static szName[ 32 ];
  1082. get_user_name( attacker, szName, 32 );
  1083.  
  1084. ColorPrint(0,"^3%s ^1is the winner on the ^4gungame ^1day and recived^4 1500 cash",szName);
  1085. set_user_cash( attacker, get_user_cash( attacker ) + 1500 )
  1086.  
  1087. new players[ 32 ], Tnum;
  1088. get_players( players, Tnum, "ae", "TERRORIST" );
  1089. for( new i = 0; i < Tnum; i++ )
  1090. {
  1091. if( is_user_alive( players[ i ] ) && players[ i ] != attacker)
  1092. {
  1093. user_silentkill( players[ i ] );
  1094. user_silentkill( players[ i ] );
  1095. user_silentkill( players[ i ] );
  1096. }
  1097. }
  1098. return 0;
  1099. }
  1100. fm_strip_user_weapons(attacker)
  1101. give_item_stock(attacker, iGunEntName[GunLevel[attacker]])
  1102. cs_set_user_bpammo(attacker, iGunNum[GunLevel[attacker]], 9999 )
  1103. ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
  1104. }
  1105. ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
  1106. }
  1107. set_task(0.5, "Respawn", victim)
  1108. fm_strip_user_weapons(client);
  1109.  
  1110. }
  1111.  
  1112. if(g_mDay == DAY_GUNGAME)
  1113. {
  1114. if ( iTeam[ 0 ] == iTeam[ 1 ] || iTeam[ 0 ] != CS_TEAM_T || iTeam[ 1 ] != CS_TEAM_CT )
  1115. {
  1116. XpLevel[ attacker ]++;
  1117. if( 2 <= XpLevel[ attacker ] )
  1118. {
  1119. GunLevel[ attacker ]++;
  1120. XpLevel[ attacker ] = 0;
  1121. if( GunLevel[ attacker ] >= 15 )
  1122. {
  1123. static szName[ 32 ];
  1124. get_user_name( attacker, szName, 32 );
  1125.  
  1126. ColorPrint(0,"^3%s ^1is the winner on the ^4gungame ^1day and recived^4 1500 cash",szName);
  1127. set_user_cash( attacker, get_user_cash( attacker ) + 1500 )
  1128.  
  1129. new players[ 32 ], Tnum;
  1130. get_players( players, Tnum, "ae", "TERRORIST" );
  1131. for( new i = 0; i < Tnum; i++ )
  1132. {
  1133. if( is_user_alive( players[ i ] ) && players[ i ] != attacker)
  1134. {
  1135. user_silentkill( players[ i ] );
  1136. user_silentkill( players[ i ] );
  1137. user_silentkill( players[ i ] );
  1138. }
  1139. }
  1140. return 0;
  1141. }
  1142. fm_strip_user_weapons(attacker)
  1143. give_item_stock(attacker, iGunEntName[GunLevel[attacker]])
  1144. cs_set_user_bpammo(attacker, iGunNum[GunLevel[attacker]], 9999 )
  1145. ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
  1146. }
  1147. ColorPrint(attacker,"You are level ^3: ^4(^1 %i ^3/^1 15 ^4) ^1Your Kills ^3: ^4(^1 %i ^3/^1 2 ^4)",GunLevel[ attacker ],XpLevel[ attacker ]);
  1148. }
  1149.  
  1150. }
  1151. return PLUGIN_CONTINUE;
  1152. }
  1153.  
  1154.  
  1155. public Respawn( client )
  1156. {
  1157. fm_strip_user_weapons(client);
  1158. fm_strip_user_weapons(client);
  1159. fm_strip_user_weapons(client);
  1160. ExecuteHamB(Ham_CS_RoundRespawn, client)
  1161. //fm_set_user_health( client, 100);
  1162. fm_strip_user_weapons( client );
  1163. fm_give_item( client, "weapon_m4a1" );
  1164. fm_give_item( client, "weapon_deagle");
  1165. cs_set_user_bpammo( client, CSW_M4A1, 999);
  1166. cs_set_user_bpammo( client, CSW_DEAGLE, 999);
  1167. set_glow();
  1168. OpenCells();
  1169.  
  1170. if( iGunGame )
  1171. {
  1172. fm_strip_user_weapons(client);
  1173. fm_strip_user_weapons(client);
  1174. fm_strip_user_weapons(client);
  1175. fm_strip_user_weapons(client);
  1176. ExecuteHamB(Ham_CS_RoundRespawn, client);
  1177. set_health( client , 100 , false)
  1178. fm_strip_user_weapons(client);
  1179. give_item_stock(client, iGunEntName[GunLevel[client]])
  1180. cs_set_user_bpammo(client, iGunNum[GunLevel[client]], 9999 )
  1181. }
  1182.  
  1183.  
  1184. if( g_mDay == DAY_GUNGAME )
  1185. {
  1186. fm_strip_user_weapons(client);
  1187. fm_strip_user_weapons(client);
  1188. fm_strip_user_weapons(client);
  1189. fm_strip_user_weapons(client);
  1190. ExecuteHamB(Ham_CS_RoundRespawn, client);
  1191. set_health( client , 100 , false)
  1192. fm_strip_user_weapons(client);
  1193. give_item_stock(client, iGunEntName[GunLevel[client]])
  1194. cs_set_user_bpammo(client, iGunNum[GunLevel[client]], 9999 )
  1195. }
  1196.  
  1197. return PLUGIN_CONTINUE;
  1198. }
  1199.  
  1200. public CmdStartTimer( )
  1201. {
  1202.  
  1203. if( g_mDay == DAY_DM)
  1204. {
  1205. if( g_iMinutes == 0 && g_iSeconds <= 0 )
  1206. {
  1207. set_cvar_num("sv_restartround", 1)
  1208. remove_task()
  1209. return PLUGIN_HANDLED;
  1210. }
  1211. if( g_iSeconds == 0 )
  1212. {
  1213. g_iMinutes--;
  1214. g_iSeconds = 59;
  1215. }
  1216. new szText[256];
  1217. formatex(szText, 255, "%i:%s%i", g_iMinutes, g_iSeconds < 10 ? "0" : "", g_iSeconds );
  1218. set_dhudmessage( 0, 85, 255, -1.0, 0.0, 0, 6.0, 0.9, 0.1, 0.1 );
  1219. show_dhudmessage( 0, "Time left %s, DeathMatch day.", szText )
  1220. g_iSeconds--
  1221. set_task( 1.0, "CmdStartTimer");
  1222. return PLUGIN_CONTINUE;
  1223. }
  1224. return PLUGIN_CONTINUE;
  1225. }
  1226.  
  1227. /* Forwards */
  1228.  
  1229. public FwdTakeDamage( victim, inf, attacker, Float:damage, damagebits )
  1230. {
  1231. if( !is_user_alive( victim ) || !is_user_alive( attacker ) )
  1232. return HAM_IGNORED;
  1233.  
  1234. new temp[ 2 ], weapon = get_user_weapon( attacker, temp[ 0 ], temp[ 1 ] );
  1235.  
  1236. if( weapon == CSW_KNIFE && g_mDay == DAY_TUG )
  1237. {
  1238. new CsTeams:att_team = cs_get_user_team( attacker );
  1239. new CsTeams:vic_team = cs_get_user_team( victim );
  1240.  
  1241. if( att_team == CS_TEAM_CT && vic_team == CS_TEAM_T && !task_exists( victim + 9999 ) )
  1242. {
  1243. set_pev(victim, pev_flags, (pev(victim, pev_flags) | FL_FROZEN));
  1244. set_user_health( victim, get_user_health( victim ) + 50 );
  1245. CountDie[ victim ] = 15
  1246. TofesetT[ victim ] = true
  1247. //fm_set_user_godmode( victim, 1 )
  1248. set_task(1.0, "TimerFrozen", victim + 9999,_,_, "b")
  1249. fm_set_user_rendering(victim, kRenderFxGlowShell, 0, 120, 255, kRenderNormal, 16)
  1250. return 1;
  1251. }
  1252.  
  1253. if( att_team == CS_TEAM_T && vic_team == CS_TEAM_T && task_exists( victim + 9999 ) )
  1254. {
  1255. set_pev(victim, pev_flags, (pev(victim, pev_flags) & ~FL_FROZEN))
  1256. CountDie[ victim ] = false
  1257. TofesetT[ victim ] = false
  1258. set_user_rendering(victim, kRenderFxNone, 0, 0, 0, kRenderNormal, 16);
  1259. ColorPrint(attacker, "Yo oo ooyo oo oo")
  1260. set_user_health( victim, get_user_health( victim ) + 50 );
  1261. fm_set_user_godmode( victim, 0 )
  1262. remove_task(victim + 9999)
  1263. return 1;
  1264. }
  1265. return HAM_SUPERCEDE;
  1266. }
  1267.  
  1268. if ( !is_user_connected( victim ) || !is_user_alive( victim ) || !is_user_connected( attacker ) || !is_user_alive( attacker ) )
  1269. return 1;
  1270.  
  1271. if ( g_mDay == -1 )
  1272. return 1;
  1273.  
  1274. static CsTeams: iTeam[ 2 ], g_mWeapon;
  1275.  
  1276. iTeam[ 0 ] = cs_get_user_team( victim );
  1277.  
  1278. iTeam[ 1 ] = cs_get_user_team( attacker );
  1279.  
  1280. g_mWeapon = get_user_weapon( attacker );
  1281.  
  1282. if ( bAttacker )
  1283. formatex( szAttacker[ victim ], charsmax( szAttacker[] ), szName( attacker ) );
  1284.  
  1285. if ( bTimeleft )
  1286. {
  1287. g_iTimer[ attacker ] = TIME_LEFT;
  1288.  
  1289. fnAttackTime[ attacker ] = get_gametime();
  1290. }
  1291.  
  1292. if ( iTeam[ 0 ] == CS_TEAM_T && iTeam[ 0 ] == iTeam[ 1 ] )
  1293. {
  1294. if ( g_mWeapon == CSW_DEAGLE && g_mDay == DAY_PDEAGLE || damagebits & (1<<24) && g_mDay == DAY_PSHOT )
  1295. {
  1296. new Float:iOrigin[ 3 ], Float:Vec[ 3 ];
  1297.  
  1298. get_velocity( victim, iOrigin, 1500.0, Vec );
  1299.  
  1300. Vec[ 2 ] = 300.0;
  1301.  
  1302. set_pev( victim, pev_velocity, Vec );
  1303. }
  1304. }
  1305.  
  1306. if ( iTeam[ 0 ] == CS_TEAM_T && iTeam[ 0 ] == iTeam[ 1 ] )
  1307. {
  1308. if ( g_mWeapon == CSW_M3 && g_mDay == DAY_PSHOT || damagebits & (1<<24) && g_mDay == DAY_PSHOT )
  1309. {
  1310. new Float:iOrigin[ 3 ], Float:Vec[ 3 ];
  1311.  
  1312. get_velocity( victim, iOrigin, 1500.0, Vec );
  1313.  
  1314. Vec[ 2 ] = 300.0;
  1315.  
  1316. set_pev( victim, pev_velocity, Vec );
  1317. }
  1318. }
  1319.  
  1320. return 1;
  1321. }
  1322.  
  1323. public FwdWeaponPrimaryAttack( client )
  1324. {
  1325. if ( g_mDay == DAY_LASER )
  1326. return 4;
  1327.  
  1328. return 0;
  1329. }
  1330.  
  1331. public FwdPreThink( client )
  1332. {
  1333. if ( !is_user_connected( client ) || !is_user_alive( client ) || g_mDay == -1 )
  1334. return 1;
  1335.  
  1336. new button = fm_get_user_button( client );
  1337.  
  1338. if ( cs_get_user_team( client ) == CS_TEAM_CT )
  1339. {
  1340. if ( g_mDay == DAY_NIGHT )
  1341. {
  1342. if ( button & IN_JUMP || button & IN_USE )
  1343. {
  1344. static Float:iOrigin[ 3 ];
  1345.  
  1346. pev( client, pev_origin, iOrigin );
  1347.  
  1348. if ( get_distance_f( iOrigin, g_iOrigin[ client ] ) > 10.0 )
  1349. return 1;
  1350.  
  1351. if ( fm_get_entity_flags( client ) & FL_ONGROUND )
  1352. return 1;
  1353.  
  1354. if ( button & IN_FORWARD )
  1355. {
  1356. static Float:iVelocity[ 3 ];
  1357.  
  1358. velocity_by_aim( client, 270, iVelocity );
  1359.  
  1360. fm_set_user_velocity( client, iVelocity );
  1361. }
  1362.  
  1363. else if ( button & IN_BACK )
  1364. {
  1365. static Float:iVelocity[ 3 ];
  1366.  
  1367. velocity_by_aim( client, -270, iVelocity );
  1368.  
  1369. fm_set_user_velocity( client, iVelocity );
  1370. }
  1371. }
  1372. }
  1373.  
  1374. if ( g_mDay == DAY_ZOMBIE )
  1375. {
  1376. CreateAura( client );
  1377. }
  1378. }
  1379.  
  1380. else if ( cs_get_user_team( client ) == CS_TEAM_T )
  1381. {
  1382. if ( bTimeleft && fnAttackTime[ client ] + 1.0 < get_gametime() )
  1383. {
  1384. if ( g_iTimer[ client ] > 0 )
  1385. g_iTimer[ client ]--;
  1386.  
  1387. else user_slap( client, 15, 0 );
  1388.  
  1389. fnAttackTime[ client ] = get_gametime();
  1390. }
  1391.  
  1392. if ( g_mDay == DAY_LASER && button & IN_ATTACK )
  1393. {
  1394. if ( get_user_weapon( client ) != CSW_DEAGLE )
  1395. return 1;
  1396.  
  1397. if ( fnAttack[ client ] + 0.1 > get_gametime() )
  1398. return 1;
  1399.  
  1400. if ( !g_mAmmo[ client ] && fnTime[ client ] + RELOAD_TIME > get_gametime() )
  1401. return 1;
  1402.  
  1403. fnAttack[ client ] = get_gametime();
  1404.  
  1405. g_mAmmo[ client ]--;
  1406.  
  1407. if ( !g_mAmmo[ client ] )
  1408. fnTime[ client ] = get_gametime();
  1409.  
  1410. emit_sound( client, CHAN_WEAPON, g_iSounds[ 0 ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
  1411.  
  1412. static iOrigin[ 3 ], bOrigin[ 3 ], Targets[ 2 ];
  1413.  
  1414. get_user_origin( client , iOrigin, 1 );
  1415.  
  1416. get_user_origin( client , bOrigin, 3 );
  1417.  
  1418. CreateLaser( iOrigin, bOrigin )
  1419.  
  1420. CreateShake( client );
  1421.  
  1422. get_user_aiming( client, Targets[ 0 ], Targets[ 1 ] );
  1423.  
  1424. if ( is_user_connected( Targets[ 0 ] ) && cs_get_user_team( Targets[ 0 ] ) != CS_TEAM_CT )
  1425. {
  1426. CreateFadeScreen( Targets[ 0 ] );
  1427.  
  1428. CreateBlood( Targets[ 0 ], 20 );
  1429.  
  1430. emit_sound( client, CHAN_WEAPON, g_iSounds[ 1 ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
  1431.  
  1432. if ( bAttacker )
  1433. formatex( szAttacker[ Targets[ 0 ] ], charsmax( szAttacker[] ), szName( client ) );
  1434.  
  1435. if ( bTimeleft )
  1436. {
  1437. g_iTimer[ client ] = TIME_LEFT
  1438.  
  1439. fnAttackTime[ client ] = get_gametime();
  1440. }
  1441.  
  1442. if ( get_user_health( Targets[ 0 ] ) - 15 <= 0 )
  1443. {
  1444. fm_set_user_health( client, get_user_health( client ) + 25 );
  1445.  
  1446. ColorPrint( client, "You Gained^4 25 ^1Health For Killing ^3%s ^4!", szName( Targets[ 0 ] ) );
  1447.  
  1448. user_silentkill( Targets[ 0 ] );
  1449.  
  1450. make_deathmsg( client, Targets[ 0 ], 0, "weapon_deagle" );
  1451. }
  1452.  
  1453. else
  1454. fm_set_user_health( Targets[ 0 ], get_user_health( Targets[ 0 ] ) - 15 );
  1455. }
  1456. }
  1457. }
  1458.  
  1459. return 1;
  1460. }
  1461.  
  1462. public FwdTouch( client, world )
  1463. {
  1464. if ( g_mDay != DAY_NIGHT || !is_user_alive( client ) || cs_get_user_team( client ) != CS_TEAM_CT )
  1465. return 1;
  1466.  
  1467. new szClass[ 32 ];
  1468.  
  1469. pev( world, pev_classname, szClass, charsmax( szClass ) );
  1470.  
  1471. if ( equal( szClass, "worldspawn" ) || equal( szClass, "func_wall" ) || equal( szClass, "func_breakable" ) )
  1472. pev( client, pev_origin, g_iOrigin[ client ] )
  1473.  
  1474. return 1;
  1475. }
  1476.  
  1477. public FwdSetModel( ent, szModel[ ] )
  1478. {
  1479. if ( g_mDay == DAY_DODGEBALL )
  1480. {
  1481. if ( equali( szModel, "models/w_hegrenade.mdl" ) )
  1482. {
  1483. entity_set_model( ent, g_mModels[ 2 ] );
  1484.  
  1485. return 4;
  1486. }
  1487. }
  1488.  
  1489. return 1;
  1490. }
  1491.  
  1492. public FwdEmitSound( ent, channel, sample[], Float:volume, Float:atten, flags, pitch )
  1493. {
  1494. if ( g_mDay == DAY_DODGEBALL )
  1495. {
  1496. if( containi( sample, "he_bounce" ) != -1 )
  1497. {
  1498. if ( pev( ent, pev_fuser1 ) + 0.3 < get_gametime( ) )
  1499. {
  1500. set_pev( ent, pev_fuser1, get_gametime() );
  1501.  
  1502. emit_sound( ent, CHAN_ITEM, g_mSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
  1503. }
  1504. return 4;
  1505. }
  1506. }
  1507.  
  1508. return 1;
  1509. }
  1510.  
  1511. public FwdThinkGrenade( ent )
  1512. {
  1513. if ( g_mDay == DAY_DODGEBALL )
  1514. {
  1515. new szModel[ 64 ];
  1516.  
  1517. pev( ent, pev_model, szModel, charsmax( szModel ) );
  1518.  
  1519. if ( !equali( szModel, g_mModels[ 2 ] ) )
  1520. return 0;
  1521.  
  1522. return 1;
  1523. }
  1524.  
  1525. return 0;
  1526. }
  1527. /* Natives */
  1528.  
  1529. /* Message */
  1530.  
  1531. public MsgAudio()
  1532. {
  1533. new szString[ 32 ];
  1534.  
  1535. get_msg_arg_string( 2, szString, charsmax( szString ) );
  1536.  
  1537. if ( equal( szString, "%!MRAD_FIREINHOLE" ) )
  1538. return 1;
  1539.  
  1540. return 0;
  1541. }
  1542.  
  1543. public MsgText()
  1544. {
  1545. new szString[ 32 ];
  1546.  
  1547. get_msg_arg_string( 2, szString, charsmax( szString ) );
  1548.  
  1549. if ( equali( szString, "#Weapon_Cannot_Be_Dropped" ) )
  1550. return 1;
  1551.  
  1552. if ( get_msg_args() == 3 && get_msg_argtype( 2 ) == ARG_STRING )
  1553. {
  1554. if ( equali( szString, "#Game_teammate_attack" ) )
  1555. return 1;
  1556. }
  1557.  
  1558. if ( str_to_num( szString ) > 0 )
  1559. {
  1560. get_msg_arg_string( 3, szString, charsmax( szString ) );
  1561. if ( equali( szString, "#Game_radio" ) )
  1562. {
  1563. get_msg_arg_string( 5, szString, charsmax( szString ) );
  1564. if ( equali( szString, "#Fire_in_the_hole" ) )
  1565. return 1;
  1566. }
  1567. }
  1568.  
  1569. return 0;
  1570. }
  1571.  
  1572. stock OpenCells(){
  1573.  
  1574. new ent = -1
  1575.  
  1576. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  1577. dllfunc( DLLFunc_Use, ent, 0 );
  1578. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  1579. dllfunc( DLLFunc_Use, ent, 0 );
  1580.  
  1581. }
  1582.  
  1583. stock set_health( client , Health , bool: Kaful)
  1584. {
  1585. if(Kaful)
  1586. {
  1587. new players[32], pnum
  1588. get_players(players, pnum, "ae", "TERRORIST");
  1589. new iHealth = (Health * pnum);
  1590. fm_set_user_health( client, iHealth )
  1591. }
  1592. else
  1593. fm_set_user_health( client, Health )
  1594.  
  1595. }
  1596.  
  1597. /* Start Days */
  1598.  
  1599. public CmdStartDay( index )
  1600. {
  1601.  
  1602. g_mDay = index;
  1603.  
  1604. /* Open Cages */
  1605. new ent = -1
  1606.  
  1607. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  1608. dllfunc( DLLFunc_Use, ent, 0 );
  1609. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  1610. dllfunc( DLLFunc_Use, ent, 0 );
  1611.  
  1612. /* Main Day Start */
  1613. static Players[ 32 ], iNum, client;
  1614. get_players( Players, iNum, "ach" );
  1615.  
  1616. /* Set Variables */
  1617. g_fCount = -1.0;
  1618.  
  1619. /* Reset Booleans */
  1620. bAttacker = bTimeleft = false;
  1621.  
  1622. if ( index != DAY_FREE )
  1623. set_cvar_num( "bh_enabled", 0 );
  1624.  
  1625. for ( new i; i < iNum ;i++ )
  1626. {
  1627. client = Players[ i ];
  1628. fm_set_user_godmode( client, 0 );
  1629.  
  1630. fnAttackTime[ client ] = get_gametime();
  1631.  
  1632. g_iTimer[ client ] = TIME_LEFT;
  1633. }
  1634.  
  1635. switch ( index )
  1636. {
  1637. case DAY_FREE:
  1638. {
  1639. g_fCount = 60.0;
  1640.  
  1641. for ( new i; i < iNum; i++ )
  1642. {
  1643. static wrandom;
  1644.  
  1645. client = Players[ i ];
  1646.  
  1647. fm_strip_user_weapons( client );
  1648.  
  1649. fm_give_item( client, "weapon_knife" );
  1650.  
  1651. fm_set_user_health( client, 100 );
  1652.  
  1653. wrandom = random( 2 );
  1654.  
  1655. switch ( cs_get_user_team( client ) )
  1656. {
  1657. case CS_TEAM_CT:
  1658. {
  1659. GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
  1660. GiveItem(client, "weapon_deagle", CSW_DEAGLE, 9999);
  1661. }
  1662.  
  1663.  
  1664. case CS_TEAM_T:
  1665. fm_set_user_rendering( client, kRenderFxGlowShell, random( 255 ), random( 255 ), random( 255 ), kRenderNormal, 85 );
  1666. }
  1667. }
  1668. }
  1669.  
  1670. case DAY_SPEARGUN:
  1671. {
  1672. set_glow();
  1673.  
  1674. set_cvar_num( "mp_friendlyfire", 1 );
  1675.  
  1676. for ( new i; i < iNum; i++ )
  1677. {
  1678. client = Players[ i ];
  1679.  
  1680. fm_strip_user_weapons( client );
  1681.  
  1682. switch ( cs_get_user_team( client ) )
  1683. {
  1684. case CS_TEAM_CT:
  1685. {
  1686. fm_set_user_godmode( client, 1 );
  1687. }
  1688.  
  1689. case CS_TEAM_T:
  1690. {
  1691. fm_set_user_health( client, 1500 );
  1692. give_speargun( client );
  1693. }
  1694. }
  1695. }
  1696. }
  1697.  
  1698. case DAY_CANNON:
  1699. {
  1700. set_glow();
  1701.  
  1702. set_cvar_num( "mp_friendlyfire", 1 );
  1703.  
  1704. for ( new i; i < iNum; i++ )
  1705. {
  1706. client = Players[ i ];
  1707.  
  1708. fm_strip_user_weapons( client );
  1709.  
  1710. switch ( cs_get_user_team( client ) )
  1711. {
  1712. case CS_TEAM_CT:
  1713. {
  1714. fm_set_user_godmode( client, 1 );
  1715. }
  1716.  
  1717. case CS_TEAM_T:
  1718. {
  1719. get_cannon( client )
  1720. fm_set_user_health( client, 1500 );
  1721. }
  1722. }
  1723. }
  1724. }
  1725.  
  1726. case DAY_1HPBOXDAY:
  1727. {
  1728. set_glow();
  1729.  
  1730. bTimeleft = true;
  1731.  
  1732. bAttacker = true;
  1733.  
  1734. set_cvar_num( "mp_friendlyfire", 1 );
  1735.  
  1736. for ( new i; i < iNum; i++ )
  1737. {
  1738. client = Players[ i ];
  1739.  
  1740. fm_strip_user_weapons( client );
  1741.  
  1742. switch ( cs_get_user_team( client ) )
  1743. {
  1744. case CS_TEAM_CT:
  1745. fm_set_user_godmode( client, 1 );
  1746.  
  1747. case CS_TEAM_T:
  1748. {
  1749. fm_set_user_health( client, 1 );
  1750.  
  1751. fm_give_item( client, "weapon_knife" );
  1752. }
  1753. }
  1754. }
  1755. }
  1756. case DAY_TACTICAL:
  1757. {
  1758. set_glow();
  1759.  
  1760. set_cvar_num( "mp_friendlyfire", 1 );
  1761.  
  1762. for ( new i; i < iNum; i++ )
  1763. {
  1764. client = Players[ i ];
  1765.  
  1766. fm_strip_user_weapons( client );
  1767.  
  1768. switch ( cs_get_user_team( client ) )
  1769. {
  1770. case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
  1771. case CS_TEAM_T:
  1772. {
  1773. fm_set_user_health( client, 1500 );
  1774. give_tactical( client );
  1775. }
  1776. }
  1777. }
  1778. }
  1779. case DAY_PUMPKIN:
  1780. {
  1781. set_glow();
  1782.  
  1783. set_cvar_num( "mp_friendlyfire", 1 );
  1784.  
  1785. for ( new i; i < iNum; i++ )
  1786. {
  1787. client = Players[ i ];
  1788.  
  1789. fm_strip_user_weapons( client );
  1790.  
  1791. switch ( cs_get_user_team( client ) )
  1792. {
  1793. case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
  1794. case CS_TEAM_T:
  1795. {
  1796. fm_set_user_health( client, 1500 );
  1797. give_pumpkin__( client );
  1798. }
  1799. }
  1800. }
  1801. }
  1802. case DAY_SGDRILL:
  1803. {
  1804. set_glow();
  1805.  
  1806. set_cvar_num( "mp_friendlyfire", 1 );
  1807.  
  1808. for ( new i; i < iNum; i++ )
  1809. {
  1810. client = Players[ i ];
  1811.  
  1812. fm_strip_user_weapons( client );
  1813.  
  1814. switch ( cs_get_user_team( client ) )
  1815. {
  1816. case CS_TEAM_CT:fm_set_user_godmode( client, 1 );
  1817. case CS_TEAM_T:
  1818. {
  1819. fm_set_user_health( client, 1500 );
  1820. give_sgdrill( client );
  1821. }
  1822. }
  1823. }
  1824. }
  1825. case DAY_NIGHT:
  1826. {
  1827. for ( new i; i < iNum; i++ )
  1828. {
  1829. client = Players[ i ];
  1830.  
  1831. fm_strip_user_weapons( client );
  1832.  
  1833. switch ( cs_get_user_team( client ) )
  1834. {
  1835. case CS_TEAM_CT:
  1836. {
  1837. fm_set_user_health( client, 450 );
  1838.  
  1839. fm_give_item( client, "weapon_knife" );
  1840.  
  1841. fm_set_user_rendering( client, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0 );
  1842. }
  1843.  
  1844. case CS_TEAM_T:
  1845. {
  1846. fm_set_user_health( client, 100 );
  1847.  
  1848. GiveItem( client, "weapon_m4a1", CSW_M4A1, 9999 );
  1849.  
  1850. if(get_user_flags( client ) & ADMIN_LEVEL_H )
  1851. {
  1852.  
  1853. GiveItem( client, "weapon_m249", CSW_M249, 9999 );
  1854. }
  1855.  
  1856. }
  1857. }
  1858. }
  1859. }
  1860.  
  1861. case DAY_SHARK:
  1862. {
  1863. for ( new i; i < iNum; i++ )
  1864. {
  1865. client = Players[ i ];
  1866.  
  1867. fm_strip_user_weapons( client );
  1868.  
  1869. switch ( cs_get_user_team( client ) )
  1870. {
  1871. case CS_TEAM_CT:
  1872. {
  1873. fm_set_user_health( client, 1000 );
  1874.  
  1875. fm_give_item( client, "weapon_knife" );
  1876.  
  1877. fm_set_user_noclip( client, 1 );
  1878. }
  1879.  
  1880. case CS_TEAM_T:
  1881. {
  1882. fm_set_user_health( client, 100 );
  1883.  
  1884. GiveItem( client, "weapon_m4a1", CSW_M4A1, 9999 );
  1885.  
  1886. if(get_user_flags( client ) & ADMIN_LEVEL_H )
  1887. {
  1888.  
  1889. GiveItem( client, "weapon_m249", CSW_M249, 9999 );
  1890. }
  1891. }
  1892. }
  1893. }
  1894. }
  1895.  
  1896. case DAY_WAR:
  1897. {
  1898. bTimeleft = true;
  1899.  
  1900. static wrandom;
  1901.  
  1902. for ( new i; i < iNum; i++ )
  1903. {
  1904. client = Players[ i ];
  1905.  
  1906. fm_strip_user_weapons( client );
  1907.  
  1908. wrandom = random( 2 );
  1909.  
  1910. GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
  1911.  
  1912. switch ( cs_get_user_team( client ) )
  1913. {
  1914. case CS_TEAM_CT:
  1915. fm_set_user_health( client, 2500 );
  1916.  
  1917. case CS_TEAM_T:
  1918. fm_set_user_health( client, 150 );
  1919. }
  1920. }
  1921. }
  1922.  
  1923. case DAY_HEADSHOT:
  1924. {
  1925. set_glow();
  1926.  
  1927. bTimeleft = true;
  1928.  
  1929. bAttacker = true;
  1930.  
  1931. set_cvar_num( "mp_friendlyfire", 1 );
  1932.  
  1933. set_user_hitzones(0, 0, 2)
  1934.  
  1935. static wrandom;
  1936.  
  1937. for ( new i; i < iNum; i++ )
  1938. {
  1939. client = Players[ i ];
  1940.  
  1941. fm_strip_user_weapons( client );
  1942.  
  1943. wrandom = random( 2 );
  1944.  
  1945. switch ( cs_get_user_team( client ) )
  1946. {
  1947. case CS_TEAM_CT:
  1948. fm_set_user_godmode( client, 1 );
  1949.  
  1950. case CS_TEAM_T:
  1951. {
  1952. fm_set_user_health( client, 750 );
  1953.  
  1954. GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
  1955. }
  1956. }
  1957. }
  1958. }
  1959.  
  1960. case DAY_PWAR:
  1961. {
  1962. set_glow();
  1963.  
  1964. bTimeleft = true;
  1965.  
  1966. bAttacker = true;
  1967.  
  1968. set_cvar_num( "mp_friendlyfire", 1 );
  1969.  
  1970. static wrandom;
  1971.  
  1972. for ( new i; i < iNum; i++ )
  1973. {
  1974. client = Players[ i ];
  1975.  
  1976. fm_strip_user_weapons( client );
  1977.  
  1978. wrandom = random( 2 );
  1979.  
  1980. switch ( cs_get_user_team( client ) )
  1981. {
  1982. case CS_TEAM_CT:
  1983. fm_set_user_godmode( client, 1 );
  1984.  
  1985. case CS_TEAM_T:
  1986. {
  1987. fm_set_user_health( client, 750 );
  1988.  
  1989. GiveItem( client, wrandom ? "weapon_m4a1" : "weapon_ak47", wrandom ? CSW_M4A1 : CSW_AK47, 9999 );
  1990. }
  1991. }
  1992. }
  1993. }
  1994.  
  1995. case DAY_KNIFE:
  1996. {
  1997. bTimeleft = true;
  1998.  
  1999. for ( new i; i < iNum; i++ )
  2000. {
  2001. client = Players[ i ];
  2002.  
  2003. fm_strip_user_weapons( client );
  2004.  
  2005. fm_give_item( client, "weapon_knife" );
  2006.  
  2007. switch ( cs_get_user_team( client ) )
  2008. {
  2009. case CS_TEAM_CT:
  2010. fm_set_user_health( client, 4000 );
  2011.  
  2012. case CS_TEAM_T:
  2013. fm_set_user_health( client, 100 );
  2014. }
  2015. }
  2016. }
  2017.  
  2018. case DAY_BOX:
  2019. {
  2020. set_glow();
  2021.  
  2022. bTimeleft = true;
  2023.  
  2024. bAttacker = true;
  2025.  
  2026. set_cvar_num( "mp_friendlyfire", 1 );
  2027.  
  2028. for ( new i; i < iNum; i++ )
  2029. {
  2030. client = Players[ i ];
  2031.  
  2032. fm_strip_user_weapons( client );
  2033.  
  2034. switch ( cs_get_user_team( client ) )
  2035. {
  2036. case CS_TEAM_CT:
  2037. fm_set_user_godmode( client, 1 );
  2038.  
  2039. case CS_TEAM_T:
  2040. {
  2041. fm_set_user_health( client, 500 );
  2042.  
  2043. fm_give_item( client, "weapon_knife" );
  2044. }
  2045. }
  2046. }
  2047. }
  2048.  
  2049. case DAY_TUG:
  2050. {
  2051. set_glow();
  2052.  
  2053. TofesetDay = true
  2054.  
  2055. bTimeleft = true;
  2056.  
  2057. bAttacker = true;
  2058.  
  2059. for ( new i; i < iNum; i++ )
  2060. {
  2061. client = Players[ i ];
  2062.  
  2063. fm_strip_user_weapons( client );
  2064.  
  2065. switch ( cs_get_user_team( client ) )
  2066. {
  2067. case CS_TEAM_CT:
  2068. {
  2069. set_pev(client, pev_flags, (pev(i, pev_flags) | FL_FROZEN));
  2070. set_task(21.0, "RemoveFreeze", client)
  2071. fm_set_user_godmode(client, 1)
  2072. fm_strip_user_weapons(client)
  2073. iGive(client , 0 )
  2074. }
  2075.  
  2076. case CS_TEAM_T:
  2077. {
  2078. set_health( client , 10000 , false)
  2079. fm_strip_user_weapons(client)
  2080. fm_set_user_godmode(client, 0)
  2081. iGive(client , 0 )
  2082. }
  2083. }
  2084. }
  2085. }
  2086.  
  2087.  
  2088. case DAY_GUNGAME:
  2089. {
  2090. set_glow();
  2091.  
  2092. bTimeleft = true;
  2093.  
  2094. bAttacker = true;
  2095.  
  2096. set_cvar_num( "mp_friendlyfire", 1 );
  2097.  
  2098. for ( new i; i < iNum; i++ )
  2099. {
  2100. client = Players[ i ];
  2101.  
  2102. fm_strip_user_weapons( client );
  2103.  
  2104. switch ( cs_get_user_team( client ) )
  2105. {
  2106. case CS_TEAM_CT:
  2107. {
  2108. fm_set_user_godmode( client, 1 );
  2109. fm_strip_user_weapons(client);
  2110. }
  2111.  
  2112. case CS_TEAM_T:
  2113. {
  2114. set_health( client , 100 , false)
  2115. fm_strip_user_weapons(client);
  2116. fm_give_item( client, "weapon_glock18" )
  2117. cs_set_user_bpammo( client, CSW_GLOCK18, 9999 )
  2118. GunLevel[client] = 0;
  2119. XpLevel[client] = 0;
  2120. }
  2121. }
  2122. }
  2123. }
  2124.  
  2125. case DAY_DEAGLE:
  2126. {
  2127. bTimeleft = true;
  2128.  
  2129. for ( new i; i < iNum; i++ )
  2130. {
  2131. client = Players[ i ];
  2132.  
  2133. fm_strip_user_weapons( client );
  2134.  
  2135. GiveItem( client, "weapon_deagle", CSW_DEAGLE, 9999 );
  2136.  
  2137. switch ( cs_get_user_team( client ) )
  2138. {
  2139. case CS_TEAM_CT:
  2140. fm_set_user_health( client, 2000 );
  2141.  
  2142. case CS_TEAM_T:
  2143. fm_set_user_health( client, 150 );
  2144. }
  2145. }
  2146. }
  2147.  
  2148. case DAY_PDEAGLE:
  2149. {
  2150. set_glow();
  2151.  
  2152. bTimeleft = true;
  2153.  
  2154. bAttacker = true;
  2155.  
  2156. set_cvar_num( "mp_friendlyfire", 1 );
  2157.  
  2158. for ( new i; i < iNum; i++ )
  2159. {
  2160. client = Players[ i ];
  2161.  
  2162. fm_strip_user_weapons( client );
  2163.  
  2164. switch ( cs_get_user_team( client ) )
  2165. {
  2166. case CS_TEAM_CT:
  2167. fm_set_user_godmode( client, 1 );
  2168.  
  2169. case CS_TEAM_T:
  2170. {
  2171. fm_set_user_health( client, 500 );
  2172.  
  2173. GiveItem( client, "weapon_deagle", CSW_DEAGLE, 9999 );
  2174. }
  2175. }
  2176. }
  2177. }
  2178.  
  2179. case DAY_PSHOT:
  2180. {
  2181. set_glow();
  2182.  
  2183. bTimeleft = true;
  2184.  
  2185. bAttacker = true;
  2186.  
  2187. set_cvar_num( "mp_friendlyfire", 1 );
  2188.  
  2189. for ( new i; i < iNum; i++ )
  2190. {
  2191. client = Players[ i ];
  2192.  
  2193. fm_strip_user_weapons( client );
  2194.  
  2195. switch ( cs_get_user_team( client ) )
  2196. {
  2197. case CS_TEAM_CT:
  2198. fm_set_user_godmode( client, 1 );
  2199.  
  2200. case CS_TEAM_T:
  2201. {
  2202. fm_set_user_health( client, 500 );
  2203.  
  2204. GiveItem( client, "weapon_m3", CSW_M3, 9999 );
  2205. }
  2206. }
  2207. }
  2208. }
  2209.  
  2210. case DAY_HEG:
  2211. {
  2212. bTimeleft = true;
  2213.  
  2214. for ( new i; i < iNum; i++ )
  2215. {
  2216. client = Players[ i ];
  2217.  
  2218. fm_strip_user_weapons( client );
  2219.  
  2220. GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
  2221.  
  2222. switch ( cs_get_user_team( client ) )
  2223. {
  2224. case CS_TEAM_CT:
  2225. fm_set_user_health( client, 2000 );
  2226.  
  2227. case CS_TEAM_T:
  2228. fm_set_user_health( client, 150 );
  2229. }
  2230. }
  2231. }
  2232.  
  2233. case DAY_PHEG:
  2234. {
  2235. set_glow();
  2236.  
  2237. bTimeleft = true;
  2238.  
  2239. bAttacker = true;
  2240.  
  2241. set_cvar_num( "mp_friendlyfire", 1 );
  2242.  
  2243. for ( new i; i < iNum; i++ )
  2244. {
  2245. client = Players[ i ];
  2246.  
  2247. fm_strip_user_weapons( client );
  2248.  
  2249. switch ( cs_get_user_team( client ) )
  2250. {
  2251. case CS_TEAM_CT:
  2252. fm_set_user_godmode( client, 1 );
  2253.  
  2254. case CS_TEAM_T:
  2255. {
  2256. fm_set_user_health( client, 500 );
  2257.  
  2258. GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
  2259. }
  2260. }
  2261. }
  2262. }
  2263.  
  2264. case DAY_SNIPERS:
  2265. {
  2266. bTimeleft = true;
  2267.  
  2268. for ( new i; i < iNum; i++ )
  2269. {
  2270. client = Players[ i ];
  2271.  
  2272. fm_strip_user_weapons( client );
  2273.  
  2274. switch ( cs_get_user_team( client ) )
  2275. {
  2276. case CS_TEAM_CT:
  2277. {
  2278. fm_set_user_health( client, 4500 );
  2279.  
  2280. GiveItem( client, "weapon_awp", CSW_AWP, 9999 );
  2281. }
  2282.  
  2283. case CS_TEAM_T:
  2284. {
  2285. fm_set_user_health( client, 200 );
  2286.  
  2287. GiveItem( client, "weapon_scout", CSW_SCOUT, 9999 );
  2288.  
  2289. if(get_user_flags( client ) & ADMIN_LEVEL_H )
  2290. {
  2291. GiveItem( client, "weapon_awp", CSW_AWP, 9999 );
  2292. }
  2293. }
  2294. }
  2295. }
  2296. }
  2297.  
  2298. case DAY_DODGEBALL:
  2299. {
  2300. set_glow();
  2301.  
  2302. for ( new i; i < iNum; i++ )
  2303. {
  2304. client = Players[ i ];
  2305.  
  2306. fm_strip_user_weapons( client );
  2307.  
  2308. switch ( cs_get_user_team( client ) )
  2309. {
  2310. case CS_TEAM_CT:
  2311. {
  2312. fm_set_user_godmode( client, 1 );
  2313. }
  2314.  
  2315. case CS_TEAM_T:
  2316. {
  2317. fm_set_user_health( client, 100 );
  2318.  
  2319. GiveItem( client, "weapon_hegrenade", CSW_HEGRENADE, 9999 );
  2320. }
  2321. }
  2322. }
  2323. }
  2324.  
  2325. case DAY_LASER:
  2326. {
  2327. set_glow();
  2328.  
  2329.  
  2330. bTimeleft = true;
  2331.  
  2332. bAttacker = true;
  2333.  
  2334. for ( new i; i < iNum; i++ )
  2335. {
  2336. client = Players[ i ];
  2337.  
  2338. fm_strip_user_weapons( client );
  2339.  
  2340. g_mAmmo[ client ] = MAX_AMMO;
  2341.  
  2342. switch ( cs_get_user_team( client ) )
  2343. {
  2344. case CS_TEAM_CT:
  2345. fm_set_user_godmode( client, 1 );
  2346.  
  2347. case CS_TEAM_T:
  2348. {
  2349. fm_set_user_health( client, 500 );
  2350.  
  2351. fm_give_item( client, "weapon_deagle" );
  2352.  
  2353. cs_set_weapon_ammo( fm_find_ent_by_owner( 1, "weapon_deagle", client ), 0 );
  2354. }
  2355. }
  2356. }
  2357. }
  2358.  
  2359. case DAY_ZOMBIE:
  2360. {
  2361. bTimeleft = true;
  2362.  
  2363. g_fCount = 45.0;
  2364.  
  2365. CreateFog( 0, 127, 127, 127, 0.004 );
  2366.  
  2367. set_lights( "e" );
  2368.  
  2369. for ( new i; i < iNum; i++ )
  2370. {
  2371. client = Players[ i ];
  2372.  
  2373. fm_strip_user_weapons( client );
  2374.  
  2375. switch ( cs_get_user_team( client ) )
  2376. {
  2377. case CS_TEAM_CT:
  2378. {
  2379. fm_set_user_godmode( client, 1 );
  2380.  
  2381. cs_set_user_model( client, "JailBreakZM" );
  2382.  
  2383. fm_set_user_rendering( client, kRenderFxGlowShell, 0, 100, 255, kRenderNormal, 35 );
  2384.  
  2385. set_pev( client, pev_flags, pev( client, pev_flags ) | FL_FROZEN );
  2386. }
  2387.  
  2388. case CS_TEAM_T:
  2389. {
  2390. fm_set_user_health( client, 100 );
  2391. }
  2392. }
  2393. }
  2394. }
  2395.  
  2396. case DAY_AWP:
  2397. {
  2398. set_glow();
  2399.  
  2400. bTimeleft = true;
  2401.  
  2402. bAttacker = true;
  2403.  
  2404. set_cvar_num( "mp_friendlyfire", 1 );
  2405.  
  2406. for ( new i; i < iNum; i++ )
  2407. {
  2408. client = Players[ i ];
  2409.  
  2410. fm_strip_user_weapons( client );
  2411.  
  2412. switch ( cs_get_user_team( client ) )
  2413. {
  2414. case CS_TEAM_CT:
  2415. fm_set_user_godmode( client, 1 );
  2416.  
  2417. case CS_TEAM_T:
  2418. {
  2419. fm_set_user_health( client, 700 );
  2420. fm_give_item( client, "weapon_awp" );
  2421. cs_set_user_bpammo( client, CSW_AWP, 9999 );
  2422.  
  2423. }
  2424. }
  2425. }
  2426. }
  2427.  
  2428. case DAY_SHOTGUN:
  2429. {
  2430. set_glow();
  2431.  
  2432. bTimeleft = true;
  2433.  
  2434. bAttacker = true;
  2435. set_cvar_num( "mp_friendlyfire", 1 );
  2436.  
  2437. for ( new i; i < iNum; i++ )
  2438. {
  2439. client = Players[ i ];
  2440.  
  2441. fm_strip_user_weapons( client );
  2442.  
  2443. switch ( cs_get_user_team( client ) )
  2444. {
  2445. case CS_TEAM_CT:
  2446. fm_set_user_godmode( client, 1 );
  2447.  
  2448. case CS_TEAM_T:
  2449. {
  2450. fm_set_user_health( client, 700 );
  2451.  
  2452. fm_give_item( client, "weapon_m3" );
  2453.  
  2454. GiveItem( client, "weapon_m3", CSW_M3, 9999 );
  2455. }
  2456. }
  2457. }
  2458. }
  2459.  
  2460.  
  2461.  
  2462. case DAY_DM:
  2463. {
  2464. for ( new i; i < iNum; i++ )
  2465. {
  2466. client = Players[ i ];
  2467.  
  2468. fm_strip_user_weapons( client );
  2469.  
  2470. set_cvar_num( "mp_friendlyfire", 1 );
  2471.  
  2472. switch ( cs_get_user_team( client ) )
  2473. {
  2474. case CS_TEAM_CT:
  2475. {
  2476. fm_set_user_health( client, 100 );
  2477.  
  2478. fm_set_user_godmode( client, 1 );
  2479. }
  2480.  
  2481. case CS_TEAM_T:
  2482. {
  2483. fm_set_user_health( client, 100 );
  2484.  
  2485. fm_give_item( client, "weapon_m4a1" );
  2486. cs_set_user_bpammo( client, CSW_M4A1, 999);
  2487. fm_give_item( client, "weapon_ak47" );
  2488. cs_set_user_bpammo( client, CSW_AK47, 999);
  2489. fm_give_item( client, "weapon_deagle");
  2490. cs_set_user_bpammo( client, CSW_DEAGLE, 999);
  2491. }
  2492. }
  2493. }
  2494.  
  2495. g_iSeconds = 0, g_iMinutes = 3;
  2496. CmdStartTimer( );
  2497. }
  2498.  
  2499. }
  2500.  
  2501. bTimeleft = false;
  2502.  
  2503. if ( g_fCount > 0 )
  2504. set_task( 1.0, "taskStartTime", TASKID_TIMER );
  2505.  
  2506. else
  2507. {
  2508. CmdShowMsg();
  2509.  
  2510. CmdClientMsg();
  2511. }
  2512.  
  2513. for ( new i; i < iNum; i++ )
  2514. {
  2515. client = Players[ i ];
  2516. client_cmd( client, "say /music" );
  2517. }
  2518. }
  2519.  
  2520. public RemoveFreeze(id)
  2521. set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
  2522.  
  2523. public taskStartTime()
  2524. {
  2525. set_hudmessage(0, 127, 255, -1.0, 0.15, 0, 6.0, 12.0)
  2526. show_hudmessage(0, "%s Start^nTime Left %.1f", szDays[ g_mDay ], g_fCount)
  2527.  
  2528.  
  2529. g_fCount -= 0.1;
  2530.  
  2531. if ( g_fCount <= 0.0 )
  2532. {
  2533. switch ( g_mDay )
  2534. {
  2535. case DAY_ZOMBIE:
  2536. {
  2537. for ( new i = 1; i < g_iMaxPlayers; i++ )
  2538. {
  2539. if ( !is_user_connected( i ) || !is_user_alive( i ) )
  2540. continue;
  2541.  
  2542. fm_strip_user_weapons( i );
  2543.  
  2544. if ( cs_get_user_team( i ) == CS_TEAM_CT )
  2545. {
  2546. set_pev( i, pev_flags, pev( i, pev_flags ) & ~FL_FROZEN );
  2547.  
  2548. fm_set_user_health(i, 9500 );
  2549.  
  2550. fm_set_user_godmode( i, 0 );
  2551.  
  2552. fm_give_item( i, "weapon_knife" );
  2553. }
  2554.  
  2555. else if ( cs_get_user_team( i ) == CS_TEAM_T )
  2556. {
  2557. fm_set_user_health( i, 100 );
  2558.  
  2559. GiveItem( i, "weapon_m4a1", CSW_M4A1, 9999 )
  2560. GiveItem( i, "weapon_m4a1", CSW_AK47, 9999 )
  2561.  
  2562. if( get_user_flags( i ) & ADMIN_LEVEL_H )
  2563. {
  2564. GiveItem( i, "weapon_m249", CSW_M249, 9999 )
  2565. }
  2566.  
  2567. }
  2568. }
  2569. }
  2570. }
  2571.  
  2572. set_hudmessage( random( 255 ), random( 255 ), random( 255 ), -1.0, 0.71, 1, 0.0, 5.0, 0.0, 0.0 );
  2573.  
  2574. if ( g_mDay == DAY_ZOMBIE )
  2575. show_hudmessage( 0, "%s Just Started ! ", szDays[ g_mDay ] );
  2576.  
  2577. else if ( g_mDay == DAY_FREE )
  2578. show_hudmessage( 0, "%s Is Now Over !", szDays[ g_mDay ] );
  2579.  
  2580.  
  2581. CmdShowMsg();
  2582.  
  2583. CmdClientMsg();
  2584. }
  2585.  
  2586. else
  2587. {
  2588. if ( task_exists( TASKID_TIMER ) )
  2589. {
  2590. remove_task( TASKID_TIMER );
  2591.  
  2592. set_task( 0.1, "taskStartTime", TASKID_TIMER );
  2593. }
  2594. }
  2595. }
  2596.  
  2597.  
  2598. public CmdShowMsg()
  2599. {
  2600. if ( g_mDay == -1 )
  2601. return 1;
  2602.  
  2603. new iPlayer;
  2604.  
  2605. static szMsg[ 2056 ], szText[ 128 ], Players[ 32 ], iNum;
  2606.  
  2607. if( g_mDay == DAY_FREE || g_mDay == DAY_NIGHT || g_mDay == DAY_SHARK || g_mDay == DAY_WAR || g_mDay == DAY_KNIFE || g_mDay == DAY_DEAGLE || g_mDay == DAY_HEG || g_mDay == DAY_SNIPERS || g_mDay == DAY_ZOMBIE )
  2608. get_players( Players, iNum, "aceh", "CT" );
  2609. else
  2610. get_players( Players, iNum, "aceh", "TERRORIST" );
  2611.  
  2612. formatex( szMsg, charsmax( szMsg ), "%s # JailBreak^n^nCurrent Day - %s^n^n^n", szPrefix, szDays[ g_mDay ] );
  2613.  
  2614. if( g_mDay == DAY_FREE || g_mDay == DAY_NIGHT || g_mDay == DAY_SHARK || g_mDay == DAY_WAR || g_mDay == DAY_KNIFE || g_mDay == DAY_DEAGLE || g_mDay == DAY_HEG || g_mDay == DAY_SNIPERS || g_mDay == DAY_ZOMBIE )
  2615. formatex( szText, charsmax( szText ), "Counter-Terrorists Alives (%i)^n^n^n", TeamCount( "CT", "aceh" ) );
  2616. else
  2617. formatex( szText, charsmax( szText ), "Terrorists Alives (%i)^n^n^n", TeamCount( "TERRORIST", "aceh" ) );
  2618.  
  2619. add( szMsg, charsmax( szMsg ), szText );
  2620.  
  2621. for ( new i; i < iNum; i++ )
  2622. {
  2623. iPlayer = Players[ i ];
  2624. if( g_mDay == DAY_DODGEBALL )
  2625. formatex( szText, charsmax( szText ), "%s | Balls Threw: %i^n", szName( iPlayer ), iBallsThrown[ iPlayer ] );
  2626. else
  2627. formatex( szText, charsmax( szText ), "%s | %i Health^n", szName( Players[ i ] ), get_user_health( Players[ i ] ) );
  2628.  
  2629. if( g_mDay == DAY_GUNGAME )
  2630. formatex( szText, charsmax( szText ), "%s | Level ( %d / 15 ) - Kills ( %d / 2)^n",szName( Players[ i ] ), GunLevel[ iPlayer ],XpLevel[ iPlayer ]);
  2631.  
  2632. add( szMsg, charsmax( szMsg ), szText );
  2633. }
  2634.  
  2635.  
  2636. set_hudmessage( 0, 127, 255, 0.05, 0.1, 0, 0.1, 0.3, 0.1, 0.1, 2 );
  2637.  
  2638. for( new i = 0; i < get_maxplayers(); i++ )
  2639. {
  2640. if( is_user_connected( i ) )
  2641. show_hudmessage( i, szMsg );
  2642. }
  2643.  
  2644. set_task( 0.2, "CmdShowMsg", TASKID_MESSAGE );
  2645.  
  2646. return 1;
  2647.  
  2648. }
  2649.  
  2650. /*public CmdShowMsgDgl()
  2651. {
  2652.  
  2653. new iPlayer;
  2654.  
  2655. if ( g_mDay == -1 )
  2656. return 1;
  2657.  
  2658. static szMsg[ 1024 ], szText[ 128 ], Players[ 32 ], iNum;
  2659.  
  2660. get_players( Players, iNum, "ae", "TERRORIST" );
  2661.  
  2662. formatex( szMsg, charsmax( szMsg ), "%s^nJailBreak Server^n^nCurrent Day - %s^n^n^n", szPrefix, szDays[ g_mDay ] );
  2663.  
  2664. formatex( szText, charsmax( szText ), "Terorist Team: (%i)^n^n", TeamCount( "TERRORIST", "ae" ) );
  2665.  
  2666. add( szMsg, charsmax( szMsg ), szText );
  2667.  
  2668. for ( new i; i < iNum; i++ )
  2669. {
  2670. iPlayer = Players[ i ];
  2671. formatex( szText, charsmax( szText ), "%s - Balls Threw: %i^n", szName( iPlayer ), iBallsThrown[ iPlayer ] );
  2672.  
  2673. add( szMsg, charsmax( szMsg ), szText );
  2674.  
  2675.  
  2676. }
  2677.  
  2678. set_hudmessage( 0, 127, 255, 0.05, 0.1, 0, 0.1, 0.3, 0.1, 0.1, 2 );
  2679.  
  2680. get_players( Players, iNum, "ch" );
  2681.  
  2682. for ( new i; i < iNum; i++ )
  2683. {
  2684. show_hudmessage( Players[ i ], szMsg );
  2685. }
  2686.  
  2687. set_task( 0.2, "CmdShowMsgDgl", TASKID_MESSAGE );
  2688.  
  2689. return 1;
  2690.  
  2691. }*/
  2692.  
  2693. public CmdClientMsg()
  2694. {
  2695. if ( g_mDay == -1 )
  2696. return 1;
  2697.  
  2698. static szMsg[ 1024 ], szText[ 128 ], Players[ 32 ], iNum, client, Float: g_fTime;
  2699.  
  2700. get_players( Players, iNum, "ach" );
  2701.  
  2702. for ( new i; i < iNum; i++ )
  2703. {
  2704. client = Players[ i ];
  2705.  
  2706. szMsg = "Client Information:^n";
  2707.  
  2708. formatex( szText, charsmax( szText ), " Health: %i HP^n", get_user_health( client ) );
  2709.  
  2710. add( szMsg, charsmax( szMsg ), szText );
  2711.  
  2712. if ( cs_get_user_team( client ) == CS_TEAM_T )
  2713. {
  2714. if ( bAttacker )
  2715. {
  2716. formatex( szText, charsmax( szText ), " Last Attacker: %s^n", szAttacker[ client ] );
  2717.  
  2718. add( szMsg, charsmax( szMsg ), szText );
  2719. }
  2720.  
  2721. if ( bTimeleft )
  2722. {
  2723. formatex( szText, charsmax( szText ), " Time left: %i^n", g_iTimer[ client ] );
  2724.  
  2725. add( szMsg, charsmax( szMsg ), szText );
  2726. }
  2727.  
  2728. if ( g_mDay == DAY_LASER )
  2729. {
  2730. if ( g_mAmmo[ client ] == 0 )
  2731. {
  2732. g_fTime = RELOAD_TIME - (get_gametime() - fnTime[ client ]);
  2733.  
  2734. formatex( szText, charsmax( szText ), " Ammo: 0/%i (%.1f)^n", MAX_AMMO, g_fTime );
  2735.  
  2736. if ( g_fTime <= 0.2 )
  2737. g_mAmmo[ client ] = MAX_AMMO;
  2738. }
  2739.  
  2740. else
  2741. formatex( szText, charsmax( szText ), " Ammo: %i/%i^n", g_mAmmo[ client ], MAX_AMMO, RELOAD_TIME - (get_gametime() - fnTime[ client ]) );
  2742.  
  2743. add( szMsg, charsmax( szMsg ), szText );
  2744. }
  2745. }
  2746.  
  2747. set_hudmessage( 0, 127, 255, 0.05, 0.6, 1, 0.1, 0.2, 0.1, 0.1, 1 );
  2748.  
  2749. show_hudmessage( client, szMsg );
  2750. }
  2751.  
  2752. set_task( 0.1, "CmdClientMsg", TASKID_CLIENTMSG );
  2753.  
  2754. return 1;
  2755. }
  2756.  
  2757. /* Dodgeball */
  2758.  
  2759. public grenade_throw( client, gid, wid )
  2760. {
  2761. if ( g_mDay == DAY_DODGEBALL )
  2762. {
  2763. if ( wid == CSW_HEGRENADE )
  2764. {
  2765. iBallsThrown[ client ]++;
  2766.  
  2767. set_pev( gid, pev_euser1, client );
  2768. set_pev( gid, pev_iuser1, 0 );
  2769. set_pev( gid, pev_size, Float:{-6.0,-6.0,-6.0}, Float:{6.0,6.0,6.0} );
  2770. set_pev( gid, pev_friction, 0.6 );
  2771.  
  2772. message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
  2773. write_byte( TE_BEAMFOLLOW );
  2774. write_short( gid );
  2775. write_short( g_mTrail );
  2776. write_byte( 20 );
  2777. write_byte( 5 );
  2778. write_byte( 0 );
  2779. write_byte( random(255) );
  2780. write_byte( random(255) );
  2781. write_byte( random(255) );
  2782. message_end( );
  2783.  
  2784. fm_set_rendering( gid, kRenderFxGlowShell, 255, 170, 127 );
  2785.  
  2786. set_task( 0.1, "CmdStopRolling" ,gid );
  2787. }
  2788. }
  2789. }
  2790.  
  2791. public CmdStopRolling( ent )
  2792. {
  2793. if ( g_mDay == DAY_DODGEBALL )
  2794. {
  2795. if( fm_is_valid_ent( ent ) )
  2796. {
  2797. if( fm_get_entity_flags( ent ) & FL_ONGROUND )
  2798. {
  2799. set_pev( ent, pev_velocity, Float:{0.0,0.0,0.0} );
  2800. set_pev( ent, pev_gravity, 1.0 );
  2801. fm_remove_entity( ent );
  2802. }
  2803.  
  2804. else set_task( 0.1, "CmdStopRolling", ent );
  2805. }
  2806. }
  2807. }
  2808.  
  2809. public PlayerInteract( ent, client )
  2810. {
  2811. if ( g_mDay == DAY_DODGEBALL )
  2812. {
  2813. if ( !is_valid_ent( ent ) )
  2814. return 0;
  2815.  
  2816. new szClassname[ 32 ], szModel[ 32 ];
  2817.  
  2818. entity_get_string( ent, EV_SZ_classname, szClassname, charsmax( szClassname ) );
  2819.  
  2820. entity_get_string( ent, EV_SZ_model, szModel, charsmax( szModel ) );
  2821.  
  2822. if ( equali( szClassname, "armoury_entity" ) )
  2823. {
  2824. if ( equali( szModel, g_mModels[ 2 ] ) )
  2825. {
  2826. if ( user_has_dodgeball( client ) <= 0 )
  2827. {
  2828. fm_give_item( client, "weapon_hegrenade" );
  2829.  
  2830. remove_entity( ent );
  2831. }
  2832. }
  2833.  
  2834. return 1;
  2835. }
  2836.  
  2837. if( equali ( szClassname, "grenade") )
  2838. CmdHitByBall( client, ent );
  2839. }
  2840.  
  2841. return 0;
  2842. }
  2843.  
  2844. public BallInteract( ball, ent )
  2845. {
  2846. if ( g_mDay == DAY_DODGEBALL )
  2847. {
  2848. if ( ent == 0 )
  2849. {
  2850. entity_set_int( ball, EV_INT_iuser1, 1 );
  2851.  
  2852. set_rendering( ball );
  2853. }
  2854.  
  2855. else
  2856. {
  2857. new szClassname[ 32] ;
  2858.  
  2859. entity_get_string( ent, EV_SZ_classname, szClassname, charsmax( szClassname ) );
  2860.  
  2861. if ( equali ( szClassname, "func_", 5 ) )
  2862. {
  2863. entity_set_int( ball, EV_INT_iuser1, 1 );
  2864.  
  2865. set_rendering( ball );
  2866. }
  2867. }
  2868. }
  2869. }
  2870.  
  2871. public CmdHitByBall( client, ball )
  2872. {
  2873. if ( g_mDay == DAY_DODGEBALL )
  2874. {
  2875. if ( cs_get_user_team( client ) != CS_TEAM_T ) return 1;
  2876.  
  2877. if( pev( ball, pev_iuser1 ) == 1 )
  2878. {
  2879. if( user_has_dodgeball( client ) <= 0 )
  2880. fm_remove_entity( ball );
  2881.  
  2882. return 1;
  2883. }
  2884.  
  2885. new Owner = pev( ball, pev_euser1 );
  2886.  
  2887. if( Owner == client )
  2888. {
  2889. fm_remove_entity( ball );
  2890.  
  2891. return 1;
  2892. }
  2893.  
  2894. new Float:iOrigin[ 3 ], Float:vec[ 3 ], Float:bOrigin[ 3 ], Float:Maxs[ 3 ];
  2895.  
  2896. pev( ball, pev_origin, iOrigin );
  2897.  
  2898. get_velocity( client, iOrigin, 5120.0, vec );
  2899.  
  2900. vec[ 2 ] = 512.0;
  2901.  
  2902. set_pev( client, pev_velocity, vec );
  2903.  
  2904. fm_set_user_godmode( client, 1 );
  2905.  
  2906. set_task( 0.1, "CmdKill" ,client );
  2907.  
  2908. fm_remove_entity( ball );
  2909.  
  2910. pev( client, pev_maxs, Maxs );
  2911.  
  2912. pev( client, pev_origin, bOrigin );
  2913.  
  2914. bOrigin[ 2 ] += Maxs[ 2 ];
  2915.  
  2916. set_pev( ball, pev_iuser1, 1 );
  2917. }
  2918.  
  2919. return PLUGIN_CONTINUE;
  2920. }
  2921.  
  2922. public CmdKill( client )
  2923. {
  2924. if ( g_mDay == DAY_DODGEBALL )
  2925. user_silentkill( client );
  2926. }
  2927.  
  2928. /* Stocks */
  2929.  
  2930. stock ColorPrint( const index, const string[], any:... )
  2931. {
  2932. new szMsg[ 191 ], Players[ 32 ], PNum = 1;
  2933.  
  2934. static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^4[^1%s^4]^1 ", szPrefix );
  2935.  
  2936. vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
  2937.  
  2938. if ( index )
  2939. Players[ 0 ] = index;
  2940.  
  2941. else
  2942. get_players( Players, PNum, "ch" );
  2943.  
  2944. for ( new i; i < PNum; i++ )
  2945. {
  2946. if( is_user_connected( Players[ i ] ) )
  2947. {
  2948. message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
  2949.  
  2950. write_byte( Players[ i ] );
  2951.  
  2952. write_string( szMsg );
  2953.  
  2954. message_end( );
  2955. }
  2956. }
  2957.  
  2958. return 1;
  2959. }
  2960.  
  2961. stock TeamCount( szTeam[ 12 ], szFlags[] )
  2962. {
  2963. static Players[ 32 ], iNum;
  2964.  
  2965. get_players( Players, iNum, szFlags, szTeam )
  2966.  
  2967. return iNum;
  2968. }
  2969.  
  2970. stock set_user_fade( const index, Float:fDuration = 1.0, r = 255, g = 255, b = 255, a = 255 )
  2971. {
  2972. message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), {0, 0, 0}, index );
  2973. write_short(floatround( 4096.0 * fDuration, floatround_round) );
  2974. write_short(floatround( 4096.0 * fDuration, floatround_round) );
  2975. write_short( 4096 );
  2976. write_byte( r );
  2977. write_byte( g );
  2978. write_byte( b );
  2979. write_byte( a );
  2980. message_end();
  2981. }
  2982.  
  2983. stock give_item_stock( client, const item[] )
  2984. {
  2985. if ( !equal( item, "weapon_", 7 ) )
  2986. return 0;
  2987.  
  2988. new ent = fm_create_entity( item );
  2989.  
  2990. if ( !pev_valid( ent ) )
  2991. return 0;
  2992.  
  2993. new Float:origin[3];
  2994.  
  2995. pev( client, pev_origin, origin );
  2996.  
  2997. set_pev( ent, pev_origin, origin );
  2998. set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );
  2999.  
  3000. dllfunc( DLLFunc_Spawn, ent );
  3001.  
  3002. new save = pev( ent, pev_solid );
  3003.  
  3004. dllfunc( DLLFunc_Touch, ent, client );
  3005.  
  3006. if ( pev( ent, pev_solid ) != save )
  3007. return ent;
  3008.  
  3009. engfunc( EngFunc_RemoveEntity, ent );
  3010.  
  3011. return -1;
  3012. }
  3013.  
  3014. stock set_user_freeze( client, freeze=1 )
  3015. {
  3016. new iFlags;
  3017.  
  3018. iFlags = pev( client, pev_flags );
  3019.  
  3020. if( freeze ) fm_give_item(client,"weapon_knife");
  3021.  
  3022. set_pev( client, pev_flags, freeze ? iFlags | FL_FROZEN : iFlags & ~FL_FROZEN );
  3023. }
  3024.  
  3025. stock iGive( client , iWep, bool: iWep2_B = false , iWep2 = 0 , bool: iWep3_B = false , iWep3 = 0 )
  3026. {
  3027. fm_strip_user_weapons(client)
  3028. give_item_stock(client, iWeaponEntName[iWep])
  3029. if(iWep && iWep != 9)
  3030. cs_set_user_bpammo(client, iWeaponNum[iWep], 9999 )
  3031. if(!iWep2_B)
  3032. return 0;
  3033. give_item_stock(client, iWeaponEntName[iWep2])
  3034. if(iWep2 && iWep2 != 9)
  3035. cs_set_user_bpammo(client, iWeaponNum[iWep2], 9999 )
  3036. if(!iWep3_B)
  3037. return 0;
  3038. give_item_stock(client, iWeaponEntName[iWep3])
  3039. if(iWep3 && iWep3 != 9)
  3040. cs_set_user_bpammo(client, iWeaponNum[iWep3], 9999 )
  3041. return 0;
  3042. }
  3043.  
  3044. stock bool: IsItemExists( const iItem, Item )
  3045. {
  3046. for ( new i; i < sizeof dOption; i++ )
  3047. {
  3048. if ( i == Item || dOption[ i ] != iItem )
  3049. continue;
  3050.  
  3051. return true;
  3052. }
  3053.  
  3054. return false;
  3055. }
  3056.  
  3057. stock GiveItem( const index, Class[], Index = 0, Ammo = 0 )
  3058. {
  3059. fm_give_item( index, Class );
  3060.  
  3061. if ( equali( Class, "weapon_knife" ) )
  3062. return 1;
  3063.  
  3064. cs_set_user_bpammo( index, Index, Ammo );
  3065.  
  3066. return 1;
  3067. }
  3068.  
  3069. stock get_velocity( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] )
  3070. {
  3071. new Float:fEntOrigin[3];
  3072. pev( ent, pev_origin, fEntOrigin );
  3073.  
  3074. new Float:fDistance[3];
  3075. fDistance[0] = fEntOrigin[0] - fOrigin[0];
  3076. fDistance[1] = fEntOrigin[1] - fOrigin[1];
  3077. fDistance[2] = fEntOrigin[2] - fOrigin[2];
  3078.  
  3079. new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed );
  3080.  
  3081. fVelocity[0] = fDistance[0] / fTime;
  3082. fVelocity[1] = fDistance[1] / fTime;
  3083. fVelocity[2] = fDistance[2] / fTime;
  3084.  
  3085. return (fVelocity[0] && fVelocity[1] && fVelocity[2]);
  3086. }
  3087.  
  3088. stock user_has_dodgeball( const index )
  3089. {
  3090. new Clip, Ammo;
  3091.  
  3092. get_user_ammo( index, CSW_HEGRENADE, Clip, Ammo );
  3093.  
  3094. return Ammo;
  3095. }
  3096.  
  3097. stock SetLights( szLights[] )
  3098. {
  3099. engfunc( EngFunc_LightStyle, 0, szLights );
  3100. }
  3101.  
  3102. stock szName( const index )
  3103. {
  3104. static mName[ 32 ];
  3105.  
  3106. get_user_name( index, mName, charsmax( mName ) );
  3107.  
  3108. return mName;
  3109. }
  3110.  
  3111. stock CreateLaser( iOrigin[ 3 ] , bOrigin[ 3 ] )
  3112. {
  3113. message_begin( MSG_BROADCAST,SVC_TEMPENTITY );
  3114. write_byte( 0 );
  3115. write_coord( iOrigin[ 0 ] ); // X
  3116. write_coord( iOrigin[ 1 ] ); // Y
  3117. write_coord( iOrigin[ 2 ] ); // Z
  3118. write_coord( bOrigin[ 0 ] ); // X Axis
  3119. write_coord( bOrigin[ 1 ] ); // Y Axis
  3120. write_coord( bOrigin[ 2 ] ); // Z Axis
  3121. write_short( g_mTrail ); // Sprite
  3122. write_byte( 1 ); // Start Frame
  3123. write_byte( 5 ); // Frame Rate
  3124. write_byte( 3 ); // Life
  3125. write_byte( 50 ); // Width
  3126. write_byte( 10 ); // Noise
  3127. write_byte ( random_num( 100, 255 ) ); // Red
  3128. write_byte ( random_num( 100, 255 ) ); // Green
  3129. write_byte ( random_num( 100, 255 ) ); // Blue
  3130. write_byte( 255 ); // Alpha
  3131. write_byte( 0 ); // Speed
  3132. message_end();
  3133. }
  3134.  
  3135. stock CreateShake( const client )
  3136. {
  3137. static duration;
  3138.  
  3139. duration = FixedUnsigned16( 1.0, 1<<12 );
  3140.  
  3141. message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), {0,0,0}, client );
  3142. write_short( 0xFFFF );
  3143. write_short( duration );
  3144. write_short( 0xFFFF );
  3145. message_end();
  3146. }
  3147.  
  3148. public CreateFadeScreen( const client )
  3149. {
  3150. message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), {0, 0, 0}, client );
  3151. write_short( floatround(4096.0 * 2.0, floatround_round) );
  3152. write_short( floatround(4096.0 * 2.0, floatround_round) );
  3153. write_short( 4096 );
  3154. write_byte( 255 );
  3155. write_byte( 10 );
  3156. write_byte( 10 );
  3157. write_byte( 75 );
  3158. message_end();
  3159. }
  3160.  
  3161. stock CreateBlood( const client, bScale )
  3162. {
  3163. new Float:iOrigin[ 3 ];
  3164.  
  3165. pev( client, pev_origin, iOrigin );
  3166.  
  3167. message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
  3168. write_byte( 115 );
  3169. write_coord( floatround( iOrigin[ 0 ] + random_num( -20, 20 ) ) );
  3170. write_coord( floatround( iOrigin[ 1 ] + random_num( -20, 20 ) ) );
  3171. write_coord( floatround( iOrigin[ 2 ] + random_num( -20, 20 ) ) );
  3172. write_short( g_mBlood );
  3173. write_short( g_mBlood );
  3174. write_byte( 248 );
  3175. write_byte( bScale );
  3176. message_end();
  3177. }
  3178.  
  3179. stock CreateFog( const index = 0, const red = 127, const green = 127, const blue = 127, const Float:density_f = 0.001, bool:clear = false )
  3180. {
  3181. static msgFog;
  3182.  
  3183. if ( msgFog || ( msgFog = get_user_msgid( "Fog" ) ) )
  3184. {
  3185. new density = _:floatclamp( density_f, 0.0001, 0.25 ) * _:!clear;
  3186. message_begin(index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgFog, .player = index );
  3187. write_byte( clamp( red, 0, 255 ) );
  3188. write_byte( clamp( green, 0, 255 ) );
  3189. write_byte( clamp( blue , 0, 255 ) );
  3190. write_byte( ( density & 0xFF ) );
  3191. write_byte( ( density >> 8 ) & 0xFF );
  3192. write_byte( ( density >> 16 ) & 0xFF );
  3193. write_byte( ( density >> 24 ) & 0xFF );
  3194. message_end();
  3195. }
  3196. }
  3197.  
  3198. stock CreateAura( const index )
  3199. {
  3200. static iOrigin[ 3 ];
  3201.  
  3202. get_user_origin( index, iOrigin );
  3203.  
  3204. message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin );
  3205. write_byte( TE_DLIGHT );
  3206. write_coord( iOrigin[ 0 ] );
  3207. write_coord( iOrigin[ 1 ] );
  3208. write_coord( iOrigin[ 2 ] );
  3209. write_byte( 15 );
  3210. write_byte( 0 );
  3211. write_byte( 100 );
  3212. write_byte( 255 );
  3213. write_byte( 2 ) ;
  3214. write_byte( 0 );
  3215. message_end();
  3216. }
  3217.  
  3218. stock FixedUnsigned16( Float:flValue, iScale )
  3219. {
  3220. new iOutput;
  3221.  
  3222. iOutput = floatround( flValue * iScale );
  3223.  
  3224. if ( iOutput < 0 )
  3225. iOutput = 0;
  3226.  
  3227. if ( iOutput > 0xFFFF )
  3228. iOutput = 0xFFFF;
  3229.  
  3230. return iOutput;
  3231. }
  3232.  
  3233. public Showasd(id) {
  3234. show_menu(id, Keysasd, "\ybulbukla\rd\wa\d^n", -1, "asd") // Display menu
  3235. }
  3236.  
  3237. public Pressedasd(id, key) {
  3238. /* Menu:
  3239. * bulbuklada
  3240. */
  3241.  
  3242. switch (key) {
  3243. case 0: { // 1
  3244.  
  3245. }
  3246. }
  3247. }
  3248. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  3249. *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
  3250. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement