SHARE
TWEET

Untitled

a guest Feb 23rd, 2020 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <hamsandwich>
  5. #include <fakemeta_util>
  6. #include <fvault>
  7. #include <dhudmessage>
  8. #include <fun>
  9. #include <engine>
  10. #include <fakemeta>
  11.  
  12. // Because I like semicolons =P
  13. #pragma semicolon 1
  14. #pragma tabsize 0
  15.  
  16. // To evoid AMX_ERR_STACKERR, AMX_ERR_STACKLOW and AMX_ERR_HEAPLOW debug errors
  17. #pragma dynamic 32768
  18.  
  19. // Plugin version
  20. #define PLUGIN_VERSION "1.0"
  21.  
  22. // HitAndRun stuff taskids
  23. #define COUNTDOWN_TASKID 16
  24. #define TIMER_TASKID 1337
  25. #define SOUNDS_TASKID 1338
  26. #define GAMESTART_TASKID 1339
  27.  
  28. // Max win sounds
  29. #define MAX_WIN_SOUNDS 11
  30.  
  31. // Max infecte sounds
  32. #define MAX_INFECTE_SOUNDS 5
  33.  
  34. // Max levels that allowed
  35. #define MAX_LEVELS 150
  36.  
  37. // Counter-Strike money offset
  38. #define OFFSET_CSMONEY 115
  39.  
  40. // HeGrenade damage bit
  41. #define DMG_HEGRENADE  (1<<24)
  42.  
  43.  
  44. /* make_user_statusicon(index, const spr[], r = 0, g = 255, b = 255, status = STATUSICON_ON) */
  45. #define STATUSICON_OFF 0
  46. #define STATUSICON_ON 1
  47. #define STATUSICON_FLASH 2
  48.  
  49. /* Fog Settings */
  50. #define FOG_OFF 0
  51. #define FOG_LOW 3
  52. #define FOG_NORMAL 5
  53. #define FOG_HIGH 7
  54. #define FOG_MAX 9
  55.  
  56. native hnr_get_user_xp( const client );
  57. native hnr_set_user_xp( const client, num );
  58. native hnr_get_user_credits( const client );
  59. native hnr_set_user_credits( const client, cash );
  60.  
  61.  
  62. new const PREFIX[] = "eTs";
  63.  
  64. new g_LevelBooster[ 33 ];
  65. new g_MimiLevelBooster[ 33 ];
  66.  
  67. new szVault[] = "LevelBooster";
  68. new szVault1[] = "MiniBooster";
  69.  
  70. new const danceModel[ ] = "models/eTs/v_dance.mdl";
  71. new const mac101Model[ ] = "models/eTs/mac10level1.mdl";
  72. new const mac1010Model[ ] = "models/eTs/mac10level10.mdl";
  73. new const awpModel1[ ] = "models/eTs/awp.mdl";
  74. new const awp10Model[ ] = "models/eTs/awp10.mdl";
  75.  
  76. new infected = 0, bool:GameStarted = false;
  77. new bool:g_lasttwo = false;
  78. new Float:g_timer;
  79. new smoke, light,WinnerBeamspr3, WinnerBeamspr2, WinnerBeamspr1, WinnerBeamspr;
  80. new g_winner;
  81. new g_lasthit = 0;
  82. new g_maxplayers;
  83. new HnrSync;
  84. new cd;
  85. new Reset[ 32 ];
  86.  
  87.  
  88. new g_rounds[33],g_totalrounds[33],g_wins[33],g_totalwins[33];
  89. new xps[MAX_LEVELS] []  = {
  90.     "50",
  91.     "100",
  92.     "150",
  93.     "200",
  94.     "250",
  95.     "300",
  96.     "350",
  97.     "400",
  98.     "450",
  99.     "500",
  100.     "550",
  101.     "600",
  102.     "650",
  103.     "700",
  104.     "750",
  105.     "800",
  106.     "850",
  107.     "900",
  108.     "950",
  109.     "1000",
  110.     "1050",
  111.     "1100",
  112.     "1150",
  113.     "1200",
  114.     "1250",
  115.     "1300",
  116.     "1350",
  117.     "1400",
  118.     "1450",
  119.     "1500",
  120.     "1550",
  121.     "1600",
  122.     "1650",
  123.     "1700",
  124.     "1750",
  125.     "1800",
  126.     "1850",
  127.     "1900",
  128.     "1950",
  129.     "2000",
  130.     "2050",
  131.     "2100",
  132.     "2150",
  133.     "2200",
  134.     "2250",
  135.     "2300",
  136.     "2350",
  137.     "2400",
  138.     "2450",
  139.     "2500",
  140.     "2550",
  141.     "2600",
  142.     "2650",
  143.     "2700",
  144.     "2750",
  145.     "2800",
  146.     "2850",
  147.     "2900",
  148.     "2950",
  149.     "3000",
  150.     "3050",
  151.     "3100",
  152.     "3150",
  153.     "3200",
  154.     "3250",
  155.     "3300",
  156.     "3350",
  157.     "3400",
  158.     "3450",
  159.     "3500",
  160.     "3550",
  161.     "3600",
  162.     "3650",
  163.     "3700",
  164.     "3750",
  165.     "3800",
  166.     "3850",
  167.     "3900",
  168.     "3950",
  169.     "4000",
  170.     "4050",
  171.     "4100",
  172.     "4150",
  173.     "4200",
  174.     "4250",
  175.     "4300",
  176.     "4350",
  177.     "4400",
  178.     "4450",
  179.     "4500",
  180.     "4550",
  181.     "4600",
  182.     "4750",
  183.     "4800",
  184.     "4850",
  185.     "4900",
  186.     "5000",
  187.     "5050",
  188.     "5100",
  189.     "5150",
  190.     "5200",
  191.     "5250",
  192.     "5300",
  193.     "5350",
  194.     "5400",
  195.     "5450",
  196.     "5500",
  197.     "5550",
  198.     "5600",
  199.     "5650",
  200.     "5700",
  201.          "5750",
  202.     "5800",
  203.     "5850",
  204.     "5900",
  205.     "5950",
  206.     "6000",
  207.     "6050",
  208.     "6100",
  209.     "6150",
  210.     "6200",
  211.     "6250",
  212.     "6300",
  213.     "6350",
  214.     "6400",
  215.     "6450",
  216.     "6500",
  217.     "6550",
  218.     "6600",
  219.          "6650",
  220.          "6700",
  221.          "6750",
  222.          "6800",
  223.          "6850",
  224.          "6900",
  225.          "6950",
  226.          "7000",
  227.          "7050",
  228.          "7100",
  229.          "7150",
  230.          "7200",
  231.          "7250",
  232.          "7300",
  233.          "7350",
  234.          "7400",
  235.          "7450",
  236.          "7500",
  237.          "7550",
  238.          "7600",
  239.          "7650"
  240.    
  241. };
  242.  
  243. new playerxp[33],playerlevel[33];
  244. new playercash[33];
  245.  
  246. enum _:Events
  247. {
  248. EVENT_AWP,
  249. EVENT_KNIFE,
  250. EVENT_AWP,
  251. EVENT_MINIGUN,
  252. EVENT_KNIFESMOKE
  253. };
  254.  
  255.  
  256. enum _:Cvars
  257. {
  258. ENABLED,
  259. NOSLOWDOWN,
  260. NOZOOM,
  261. SCOUTDROP,
  262. M3DROP,
  263. DeagleDROP,
  264. FIVESEVENDROP,
  265. BLOCKKILL,
  266. CASHSYS,
  267. ROUNDSYS,
  268. SENDSYS,
  269. GAMBLESYS,
  270. LEVELSYS
  271. };
  272.  
  273. enum _:WepTemp
  274. {
  275. NAME[32],
  276. CLASS[32],
  277. COST,
  278. CSW,
  279. BULLETS
  280. };
  281.  
  282.  
  283. enum _:Powers
  284. {
  285. SPEED,
  286. INVISIBILITY,
  287. GRAVITY,
  288. NOHEGRENADE,
  289. NOFLASH
  290. };
  291.  
  292. enum _:PwrTemp
  293. {
  294. PWR_NAME[64],
  295. PWR_TIME[16],
  296. PWR_COST
  297. };
  298.  
  299.  
  300.  
  301. new const g_eventname[Events][] = {
  302. "",
  303. "Knife Event",
  304. "Awp Event",
  305. "MINIGUN Event",
  306. "Knife Smoke Event"
  307.  
  308. };
  309.  
  310. new g_event = 0;
  311. new g_round = 0;
  312. new bool:EventStarted = false;
  313. new bool:fn = true;
  314.  
  315. new bool:g_powers[33][Powers];
  316.  
  317. new g_cvars[Cvars];
  318.  
  319. new const g_szVault[] = "eTs";
  320.  
  321.  
  322. new const g_winsounds [MAX_WIN_SOUNDS] [] = {
  323.  
  324. "eTs/Song/s1.mp3",
  325. "eTs/Song/s2.mp3",
  326. "eTs/Song/s3.mp3",
  327. "eTs/Song/s4.mp3",
  328. "eTs/Song/s5.mp3",
  329. "eTs/Song/s6.mp3",
  330. "eTs/Song/s7.mp3",
  331. "eTs/Song/s8.mp3",
  332. "eTs/Song/s9.mp3",
  333. "eTs/Song/s10.mp3",
  334. "eTs/Song/s11.mp3"
  335.  
  336.  
  337.  
  338. };
  339.  
  340. new const g_infectesounds [MAX_INFECTE_SOUNDS] [] = {
  341. "eTs/items/lol.wav",
  342. "eTs/items/alarm-clock.wav",
  343. "eTs/items/aizeloser.mp3",
  344. "eTs/items/loki_omg.wav",
  345. "eTs/items/alarm-thriller.wav"
  346. };
  347.  
  348. new fwd_win,fwd_infected,fwd_event,fwd_return;
  349.  
  350. new g_msgScreenFade;
  351.  
  352. public plugin_init(){
  353. register_plugin("eTs HitAndRun",PLUGIN_VERSION,"eTs");
  354.  
  355.  
  356.  
  357. ///////////////////////
  358. /// Client Commands ///
  359. ///////////////////////
  360.  
  361. register_clcmd("jointeam","cmd_block");
  362. register_clcmd("chooseteam","cmd_block");
  363.  
  364. register_clcmd("say","HandleSay");
  365. register_clcmd("say_team","HandleSay");
  366.  
  367. register_clcmd("radio1","ActionShop");
  368. register_clcmd("radio2","ActionShop");
  369. register_clcmd("radio3","ActionShop");
  370. register_clcmd("say /eventm","EventMenu");
  371.  
  372. register_clcmd("say /reset","resetmenu");
  373. register_clcmd("say /wlevel", "weaponlevel");
  374. register_clcmd("say /usebooster", "CmdBooster");
  375. register_clcmd("say", "CmdSay");
  376. register_clcmd("say /statusall","ShowInfo");
  377. register_clcmd("drop","BlockDrop");
  378.  
  379.  
  380.  
  381. // Add Cash And LEVELS //
  382. register_concmd("amx_give_level", "cmd_give_level", ADMIN_RCON, "<target> <amount>");
  383. register_concmd("amx_give_xp", "cmd_give_xp", ADMIN_RCON, "<target> <amount>");
  384. register_concmd("amx_set_xp", "cmd_set_xp", ADMIN_RCON, "<target> <amount>");
  385. register_concmd("amx_give_level1", "cmd_give_level1", ADMIN_RCON, "<target> <amount>");
  386. register_concmd("amx_take_level", "cmd_take_level", ADMIN_RCON, "<target> <amount>");
  387. register_concmd("amx_give_cash", "cmd_give_points", ADMIN_RCON, "<target> <amount>");
  388. register_concmd("amx_set_cash", "cmd_set_points", ADMIN_RCON, "<target> <amount>");
  389. register_concmd("amx_take_cash", "cmd_take_points", ADMIN_RCON, "<target> <amount>");
  390. //////////////////
  391. /// Log Events ///
  392. //////////////////
  393.  
  394. register_logevent("Event_RoundStart",2,"1=Round_Start");
  395. register_logevent("Event_RoundEnd",2,"1=Round_End");
  396.  
  397.  
  398. //////////////
  399. /// Events ///
  400. //////////////
  401.  
  402. register_event("TextMsg","Event_RoundEnd","a","2&#Game_C","2&#Game_w");
  403. register_event("ResetHUD","Event_ResetHUD","b");
  404. register_event("HideWeapon","Event_HideWeapon","b");
  405. register_event("CurWeapon","Event_CurWeapon","be","1=1");
  406. register_event("ScreenFade", "Event_Flash","be","4=255","5=255","6=255","7>199");
  407.  
  408.  
  409. ////////////////
  410. /// CVARS!!! ///
  411. ////////////////
  412.  
  413.  
  414. register_cvar("amx_hnr_version",PLUGIN_VERSION,FCVAR_SERVER | FCVAR_SPONLY);
  415.  
  416. g_cvars[ENABLED] = register_cvar("amx_hnr_enabled","1",FCVAR_SERVER);
  417. g_cvars[NOSLOWDOWN] = register_cvar("amx_hnr_noslowdown","1");
  418. g_cvars[NOZOOM] = register_cvar("amx_hnr_nozoom","0");
  419. g_cvars[SCOUTDROP] = register_cvar("amx_hnr_noscoutdrop","1");
  420. g_cvars[M3DROP] = register_cvar("amx_hnr_nom3drop","1");
  421. g_cvars[DeagleDROP] = register_cvar("amx_hnr_nodeagledrop","1");
  422. g_cvars[FIVESEVENDROP] = register_cvar("amx_hnr_noFIVESEVENDROPdrop","1");
  423. g_cvars[BLOCKKILL] = register_cvar("amx_hnr_blockkill","1");
  424.  
  425. g_cvars[CASHSYS] = register_cvar("amx_hnr_cashsys","1");
  426. g_cvars[ROUNDSYS] = register_cvar("amx_hnr_roundsys","1");
  427. g_cvars[SENDSYS] = register_cvar("amx_hnr_sendsys","1");
  428. g_cvars[GAMBLESYS] = register_cvar("amx_hnr_gamblesys","1");
  429. g_cvars[LEVELSYS] = register_cvar("amx_hnr_levelsys","1");
  430.  
  431.  
  432. /////////////////
  433. /// Ham Stuff ///
  434. /////////////////
  435.  
  436. RegisterHam(Ham_Killed,"player","fw_HamPlayerKilled",1);
  437. RegisterHam(Ham_TakeDamage,"player","fw_HamTakeDamage");
  438. RegisterHam(Ham_Spawn,"player","fw_HamPlayerSpawn",1);
  439. RegisterHam(Ham_Player_Jump,"player","fw_HamPlayerJump");
  440.  
  441. RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_scout","fw_ScoutOnZoomOn");
  442. RegisterHam(Ham_CS_Item_CanDrop,"weapon_scout","fw_ScoutCanDrop");
  443. RegisterHam(Ham_CS_Item_CanDrop,"weapon_m3","fw_M3CanDrop");
  444. RegisterHam(Ham_CS_Item_CanDrop,"weapon_deagle","fw_DeagleCanDrop");
  445. RegisterHam(Ham_CS_Item_CanDrop,"weapon_fiveseven","fw_DeagleCanDrop");
  446.  
  447.  
  448.  
  449. ////////////////
  450. /// Messages ///
  451. ////////////////
  452.  
  453. register_message(get_user_msgid("StatusIcon"),"msgStatusIcon");
  454. register_message(get_user_msgid("Money"),"MessageMoney");
  455. register_message(get_user_msgid("HideWeapon"),"MessageHideWeapon");
  456. HnrSync = CreateHudSyncObj();
  457.  
  458. ///////////////////
  459. /// Forwards!!! ///
  460. ///////////////////
  461.  
  462. fwd_win = CreateMultiForward("hnr_client_won",ET_IGNORE,FP_CELL);
  463. fwd_infected = CreateMultiForward("hnr_client_infected",ET_IGNORE,FP_CELL);
  464. fwd_event = CreateMultiForward("hnr_event_started",ET_IGNORE,FP_CELL);
  465.  
  466. register_forward(FM_GetGameDescription,"fw_GetGameDescription");
  467. register_forward(FM_ClientKill,"fw_ClientKill");
  468.  
  469. set_task(30.0,"Adv_message",.flags="b");
  470. //set_task(5.0, "gameoffline", 204)
  471. set_task(30.0,"gameoffline",.flags="b");
  472.  
  473.  
  474.  
  475. g_maxplayers = get_maxplayers();
  476.  
  477. g_msgScreenFade = get_user_msgid("ScreenFade");
  478.  
  479. }
  480.  
  481. public plugin_cfg(){
  482. if (!cstrike_running())
  483. set_fail_state("Supports only Counter-Strike!");
  484.  
  485. RemoveEntityAll("func_bomb_target");
  486. RemoveEntityAll("info_bomb_target");
  487.  
  488. if (is_plugin_loaded("FrostNades") == -1)
  489. {
  490. fn = false;
  491. log_amx("DEBUG: Frostnade plugin not found!");
  492. }
  493.  
  494. set_cvar_num("mp_flashlight",0);
  495. set_cvar_num("mp_roundtime",9);
  496. set_cvar_num("sv_airaccelerate",100);
  497. set_cvar_num("mp_freezetime",0);
  498. set_cvar_num("mp_limitteams",0);
  499. set_cvar_num("mp_autoteambalance",0);
  500.  
  501. if (fn)
  502. {
  503. set_cvar_num("fn_enabled",1);
  504. set_cvar_num("fn_hitself",0);
  505. set_cvar_num("fn_los",0);
  506. set_cvar_num("fn_icon",2);
  507. }
  508.  
  509. set_cvar_string("humans_join_team","T");
  510.  
  511. LoadConfig();
  512.  
  513. set_task(5.0,"RestartGame");
  514. }
  515.  
  516. public LoadConfig(){
  517. new cfg[256],some[256];
  518. get_configsdir(some,255);
  519. formatex(cfg,255,"%s/HitAndRun.cfg",some);
  520.  
  521. if (!file_exists(cfg))
  522. {
  523. log_amx("DEBUG: HitAndRun config file (%s) not found. Creating...",cfg);
  524.  
  525. write_file(cfg,"////////////////////////////////////////////////////////////");
  526. formatex(some,255,"/// eTs HitAndRun v%s config file ///",PLUGIN_VERSION);
  527. write_file(cfg,some);
  528. write_file(cfg,"////////////////////////////////////////////////////////////");
  529. write_file(cfg,"");
  530. write_file(cfg,"");
  531. write_file(cfg,"/////////////////////");
  532. write_file(cfg,"/// General Cvars ///");
  533. write_file(cfg,"/////////////////////");
  534. write_file(cfg,"");
  535. write_file(cfg,"amx_hnr_enabled 1   // Enable/Disable the plugin. (Defualt: 1)");
  536. write_file(cfg,"amx_hnr_noslowdown 1    // Enable/Disable noslowdown after jump. (Defualt: 1)");
  537. write_file(cfg,"amx_hnr_nozoom 0    // Enable/Disable nozoom at scout. (Defualt: 0)");
  538. write_file(cfg,"amx_hnr_noscoutdrop 1   // Enable/Disable blocking scout from dropping. (Defualt: 1)");
  539. write_file(cfg,"amx_hnr_nom3drop 1   // Enable/Disable blocking scout from dropping. (Defualt: 1)");
  540. write_file(cfg,"amx_hnr_nodeagledrop 1   // Enable/Disable blocking scout from dropping. (Defualt: 1)");
  541. write_file(cfg,"amx_hnr_noFIVESEVENDROPdrop 1   // Enable/Disable blocking scout from dropping. (Defualt: 1)");
  542.  
  543. write_file(cfg,"amx_hnr_blockkill 1     // Enable/Disable blocking from client killing himself. (Defualt: 1)");
  544. write_file(cfg,"");
  545. write_file(cfg,"/////////////////////");
  546. write_file(cfg,"/// Systems Cvars ///");
  547. write_file(cfg,"/////////////////////");
  548. write_file(cfg,"amx_hnr_cashsys 1   // Enable/Disable Cash (aka Money aka cash) System. (Defualt: 1)");
  549. write_file(cfg,"amx_hnr_roundsys 1  // Enable/Disable Round & Wins Count System. (Defualt: 1)");
  550. write_file(cfg,"amx_hnr_sendsys 1   // Enable/Disable Send System. (Defualt: 1)");
  551. write_file(cfg,"amx_hnr_gamblesys 1     // Enable/Disable Gamble System. (Defualt: 1)");
  552. write_file(cfg,"amx_hnr_levelsys 1  // Enable/Disable Level System. (Defualt: 1)");
  553.  
  554. log_amx("DEBUG: HitAndRun config file (%s) was succesfully created.",cfg);
  555. }
  556.  
  557. server_cmd("exec %s",cfg);
  558. server_exec();
  559.  
  560. log_amx("DEBUG: HitAndRun config file (%s) was succesfully executed.",cfg);
  561. }
  562.  
  563.  
  564.  
  565. public plugin_precache(){
  566.  
  567. WinnerBeamspr3 = precache_model("sprites/snow_white.spr");
  568. WinnerBeamspr2 = precache_model("sprites/frost_explode.spr");
  569. WinnerBeamspr1 = precache_model("sprites/redball.spr");
  570. WinnerBeamspr = precache_model("sprites/frost_gib.spr");
  571.  
  572.  
  573. smoke = precache_model("sprites/steam1.spr");
  574. light = precache_model("sprites/lgtning.spr");
  575.  
  576.  
  577. precache_sound("ambience/thunder_clap.wav");
  578. precache_sound("eTs/items/aizeloser.wav");
  579. precache_sound("eTs/items/alarm-thriller.mp3");
  580. precache_sound("eTs/items/Clock.mp3");
  581.  
  582. precache_model( mac1010Model );
  583. precache_model( mac101Model );
  584. precache_model( danceModel );
  585. precache_model( awpModel1 );
  586. precache_model( awp10Model );
  587.  
  588. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  589. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  590. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  591. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  592. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  593. precache_model("models/player/AlienAngel/AlienAngel.mdl");
  594.  
  595. precache_model("models/player/IDF/IDF.mdl");
  596.  
  597. for (new i = 0; i <= MAX_WIN_SOUNDS - 1; i++)
  598. precache_sound(g_winsounds[i]);
  599.  
  600. for (new j = 0; j <= MAX_INFECTE_SOUNDS - 1; j++)
  601. precache_sound(g_infectesounds[j]);
  602. }
  603.  
  604. ///////////////////
  605. /// API Support ///
  606. ///////////////////
  607.  
  608. public dance(client){  
  609. set_pev(client,pev_viewmodel2,danceModel);
  610. }  
  611. public plugin_natives(){
  612. register_library("HitAndRun"); // API libarary support
  613.  
  614.  
  615. register_native("hnr_get_infected","_hnr_get_infected");
  616. register_native("hnr_get_lasthit","_hnr_get_lasthit");
  617. register_native("hnr_get_winner","_hnr_get_winner");
  618.  
  619. register_native("hnr_started","_hnr_started");
  620. register_native("hnr_get_event","_hnr_get_event");
  621.  
  622. register_native("hnr_get_user_rounds","_hnr_get_user_rounds");
  623.  
  624. register_native("hnr_get_user_xp","_hnr_get_user_xp");
  625.  
  626. register_native("hnr_set_user_xp","_hnr_set_user_xp");
  627.  
  628. register_native("hnr_get_user_level","_hnr_get_user_level");
  629.  
  630. register_native("hnr_set_user_level","_hnr_set_user_level");
  631.  
  632. register_native("hnr_get_user_powers","_hnr_get_user_powers");
  633.  
  634. register_native("hnr_get_user_credits", "_hnr_get_user_credits");
  635.  
  636. register_native("hnr_set_user_credits", "_hnr_set_user_credits");
  637.  
  638.  
  639. }
  640.  
  641. public client_connect( client )
  642. {
  643. set_task( 23.0, "ShowInfo", client, _, _, "b" );
  644.  
  645. CmdLoad( client );
  646. }
  647.  
  648. public premiumget(client)
  649. {
  650. new some[256],shop;
  651. formatex(some,255,"\r(\weTs\r) \wPremiumGet Menu^n\dCash: \r%i | \dLevel: \r%i",playercash[client],playerlevel[client]);
  652.  
  653. shop = menu_create(some,"premhandler");
  654. menu_additem( shop, "Double Jump");
  655.  
  656.  
  657. menu_additem( shop, "x2.5 NextCash");
  658.  
  659. menu_additem( shop, "Model For Minigun \d(Minigun Event)");
  660.  
  661. menu_additem( shop, "Premium Infected Zombie");
  662.  
  663. menu_additem( shop, "\wAccess For The Premium Shop^n^n\yNote: If you buy premium you will get Wings + 500k.");
  664. menu_setprop(shop,MPROP_EXIT,MEXIT_ALL);
  665. menu_setprop(shop,MPROP_EXITNAME,"\yExit Menu");
  666.  
  667. menu_display(client,shop);
  668.  
  669. return 1;
  670. }
  671. public premhandler(client,shop,item){
  672. if (item == MENU_EXIT)
  673. {
  674.     menu_destroy(shop);
  675.     return;
  676. }
  677.  
  678. switch (item)
  679. {
  680.     case 0: premiumget(client);
  681.        
  682.         case 1: premiumget(client);
  683.             case 2: premiumget(client);
  684.             case 3: premiumget(client);
  685.             case 4: premiumget(client);
  686.             case 5: premiumget(client);
  687.             case 6: premiumget(client);
  688.             case 7:
  689.         {
  690.            
  691.             ActionShop(client);
  692.             return;
  693.            
  694.         }
  695.     }
  696.     menu_destroy(shop);
  697. }
  698.  
  699. public ShowInfo( client,id )
  700. {
  701.    
  702.         static szName[ 32 ];
  703.         get_user_name( client, szName, charsmax( szName ) );
  704.        
  705.        
  706.         set_hudmessage( 0, 255, 255, 0.03, 0.19, 0, 6.0, 12.0);
  707.         show_hudmessage( client, "[ eTs ]^nName: %s, Cash: %i, Level: %i^nExp: %i, Next Exp: %i,^nRounds Played: %i^nTotal Rounds Played: %i ^nWins: %i^nTotal Wins: %i^nLevelBooster: %i", szName, playercash[client], playerlevel[client],playerxp[client],xps[playerlevel[client] + 1],g_rounds[client],g_totalrounds[client],g_wins[client],g_totalwins[client],g_LevelBooster[ client ]);
  708.        
  709. }
  710.  
  711.  
  712. public _hnr_get_user_credits(plugin, params)
  713. {
  714.     new client = get_param(1);
  715.    
  716.     if (is_user_connected(client))
  717.         return playercash[client];
  718.    
  719.     return -1;
  720. }
  721.  
  722.  
  723. public _hnr_set_user_xp(plugin, params)
  724. {
  725.     new client = get_param(1);
  726.     new num = get_param(2);
  727.    
  728.     playerxp[client] = num;
  729. }
  730.  
  731. public _hnr_set_user_credits(plugin, params)
  732. {
  733.     new client = get_param(1);
  734.     new num = get_param(2);
  735.    
  736.     playercash[client] = num;
  737. }
  738. public _hnr_get_infected(plugin,params){
  739.     return infected;
  740. }
  741.  
  742. public _hnr_get_lasthit(plugin,params){
  743.     return g_lasthit;
  744. }
  745.  
  746. public _hnr_get_winner(plugin,params){
  747.     return g_winner;
  748. }
  749.  
  750. public bool:_hnr_started(plugin,params){
  751.     return bool:GameStarted;
  752. }
  753.  
  754. public _hnr_get_event(plugin,params){
  755.     return g_event;
  756. }
  757.  
  758. public _hnr_get_user_rounds(plugin,params){
  759.     new client = get_param(1), total = get_param(2);
  760.    
  761.     if (is_user_connected(client))
  762.         return (total ? (g_rounds[client] + g_totalrounds[client]) : g_rounds[client]);
  763.    
  764.     log_error(AMX_ERR_NATIVE,"[ eTs ] Player %i is invaild!",client);
  765.    
  766.     return -1;
  767. }
  768.  
  769. public _hnr_get_user_xp(plugin,params){
  770.     new client = get_param(1);
  771.    
  772.     if (is_user_connected(client))
  773.         return playerxp[client];
  774.    
  775.     log_error(AMX_ERR_NATIVE,"[ eTs ] Player %i is invaild!",client);
  776.    
  777.     return -1;
  778. }
  779.  
  780. public _hnr_get_user_level(plugin,params){
  781.     new client = get_param(1);
  782.    
  783.     if (is_user_connected(client))
  784.         return playerlevel[client];
  785.    
  786.     log_error(AMX_ERR_NATIVE,"[ eTs ] Player %i is invaild!",client);
  787.    
  788.     return -1;
  789. }
  790.  
  791.  
  792.  
  793. public _hnr_set_user_level(plugin,params){
  794.     new client = get_param(1);
  795.     new num = get_param(2);
  796.    
  797.     playerlevel[client] = num;
  798. }
  799.  
  800.  
  801. public _hnr_get_user_powers(plugin,params){
  802.     new client = get_param(1);
  803.     new powers;
  804.    
  805.     if (is_user_connected(client))
  806.     {
  807.         for (new i = 0; i < Powers; i++)
  808.             if (g_powers[client][i])
  809.             powers |= 1<<i;
  810.        
  811.         return powers;
  812.     }
  813.    
  814.     log_error(AMX_ERR_NATIVE,"[ eTs ] Player %i is invaild!",client);
  815.    
  816.     return 0;
  817. }
  818.  
  819. ///////////////////
  820. /// Save & Load ///
  821. ///////////////////
  822.  
  823. public client_putinserver(client) LoadData(client);
  824.  
  825. public client_disconnect(client){
  826.    
  827.     set_task(0.5,"check");
  828.     CmdSave(client);
  829.     SaveData(client);
  830. }
  831.  
  832. public check(){
  833.     if (get_playersnum() < 2)
  834.     {
  835.         if (!GameStarted)
  836.         {
  837.             remove_task(COUNTDOWN_TASKID);
  838.             Event_RoundStart();
  839.         }
  840.        
  841.         else
  842.             RestartGame();
  843.     }
  844. }
  845.  
  846. /////////////////////
  847. /// Some say cmds ///
  848. /////////////////////
  849. public HandleSay(client, id){
  850.     new iMsg[200], iArgs[4][60];
  851.     read_argv(1,iMsg ,sizeof iMsg - 5);
  852.     parse(iMsg,iArgs[0],charsmax(iArgs[]),iArgs[1],charsmax(iArgs[]),iArgs[2],charsmax(iArgs[]),iArgs[3],charsmax(iArgs[]));
  853.    
  854.     if (!get_pcvar_num(g_cvars[ENABLED]))
  855.         return 0;
  856.    
  857.     if(equali(iArgs[0],"/status"))
  858.     {
  859.         if (!get_pcvar_num(g_cvars[ROUNDSYS]))
  860.         {
  861.             set_dhudmessage( 150,150,255, 0.07, 0.19, 1, 6.0, 12.0);
  862.             show_dhudmessage(client, "HNR Stats system is disabled!");
  863.            
  864.             return 1;
  865.         }
  866.        
  867.         new player = cmd_target(client,iArgs[1],CMDTARGET_NO_BOTS);
  868.        
  869.         if (!player)
  870.         {
  871.            
  872.             ColorChat(client,"^1%s ^3( %s ) ^1Status:",GetUserName(client),GetUserAuth(client));
  873.             ColorChat(client,"^1Cash Amount:^3 %i ^1, Level:^3 %i ^1, Exp to next level:^3 %i",playercash[client],playerlevel[client],playerxp[client],(playerlevel[client] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[client] + 1]) - playerxp[client])));
  874.             ColorChat(client,"^1Rounds Played:^3 %i ^4(%i in total rounds)",g_rounds[client],g_totalrounds[client]);
  875.             ColorChat(client,"^1Wins:^3 %i ^4(%i in total wins)",g_wins[client],g_totalwins[client]);          
  876.         }
  877.        
  878.         else
  879.         {
  880.            
  881.             ColorChat(client,"^4 ^1( %s ) Status:",GetUserAuth(client));
  882.             set_dhudmessage( 150,150,255, 0.07, 0.19, 1, 6.0, 12.0);
  883.             show_dhudmessage(client, "^nCash: %i",playercash[client]);
  884.            
  885.             set_dhudmessage( 150,150,255, 0.07, 0.19, 1, 6.0, 12.0);
  886.             show_dhudmessage(client, "^n^nRounds Played: %i | Total Rounds Played: %i",g_rounds[client],g_totalrounds[client]);
  887.            
  888.             set_dhudmessage( 150,150,255, 0.07, 0.19, 1, 6.0, 12.0);
  889.             show_dhudmessage(client, "^n^n^nWins: %i | Total Wins: %i",g_wins[client],g_totalwins[client]);
  890.            
  891.             set_dhudmessage( 150,150,255, 0.07, 0.19, 1, 6.0, 12.0);
  892.             show_dhudmessage(client, "^n^n^n^nLevel: %i | ^1Xp: %i | Xp to next level: %i"
  893.             ,playerlevel[client]
  894.             ,playerxp[client]
  895.             ,(playerlevel[client] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[client] + 1]) - playerxp[client])));
  896.         }
  897.     }
  898.    
  899.     if( equali( iArgs[0], "/givecash" ) )
  900.     {
  901.         new target[32];
  902.         new intPlayer = cmd_target( client, iArgs[1], 0 );
  903.         new player = cmd_target( client, target, 8 );
  904.        
  905.         new admin_name[32], player_name[32];
  906.         get_user_name( client, admin_name, 31 );
  907.         get_user_name( player, player_name, 31 );
  908.        
  909.         if( get_user_flags( client ) && ADMIN_IMMUNITY )
  910.         {
  911.            
  912.             if( !iArgs[1][ 0 ] || !iArgs[2][ 0 ] || !str_to_num( iArgs[2] ))
  913.             {
  914.                 ColorChat( client, "You cant use letters as cash amount" );
  915.                 return PLUGIN_HANDLED;
  916.             }
  917.            
  918.             new intPlayer = cmd_target( client, iArgs[2], 0 );
  919.            
  920.             if( !intPlayer )
  921.             {
  922.                 ColorChat( client, " No client found <%s>", iArgs[1] );
  923.                 return PLUGIN_HANDLED;
  924.             }
  925.            
  926.             playercash[player] += str_to_num( iArgs[2] );
  927.            
  928.             ColorChat( client, "You gave^3 %i^1 cash to^4 %s^1.", str_to_num( iArgs[2] ), player_name );
  929.            
  930.             ColorChat( 0, "^4Owner:^3 %s ^1gave^3 %i^1 cash to^4 %s^1.",admin_name, str_to_num( iArgs[2] ), player_name );
  931.            
  932.             SaveData(client);
  933.            
  934.             return 1;
  935.            
  936.         }
  937.         return 1;
  938.     }
  939.  
  940.    
  941.     else if (equali(iArgs[0],"/cash") || equali(iArgs[0], "/level") || equali(iArgs[0], "/xp" ) )
  942.     {
  943.         if (!get_pcvar_num(g_cvars[CASHSYS]))
  944.         {
  945.             ColorChat(client,"HNR Cash system is disabled!");
  946.             return 1;
  947.         }
  948.        
  949.         new player = cmd_target(client,iArgs[1],CMDTARGET_NO_BOTS);
  950.        
  951.         if (!player)
  952.         {
  953.             ColorChat(client, "^4Your ^1Level : ^3%i, ^1Exp : ^3%i, ^1Your Cash : ^3%i",playerlevel[ client ], playerxp[ client ],playercash[ client ]);
  954.             ColorChat(client, "NextXP : ^3%i, ^1Level Boosters : ^3%i, ^1Mini Boosters : ^3%i, ^1Reset : ^3%i", (playerlevel[client] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[client] + 1]) - playerxp[client])),  g_LevelBooster[ client ], g_MimiLevelBooster[ client ], Reset[client]);
  955.         }
  956.         else
  957.         {
  958.             ColorChat(client,"^3%s^1 ^1Your Cash : ^3%i,^1 ^1Level : ^3%i, ^1Exp : ^3%i ^1.",get_player_name(player),playercash[player],playerlevel[ client ],playerxp[ client ]);
  959.             return 1;
  960.         }
  961.        
  962.    
  963.     }
  964.    
  965.    
  966.    
  967.    
  968.    
  969.    
  970.    
  971.    
  972.    
  973.    
  974.     else if (equali(iArgs[0],"/shop"))
  975.     {
  976.         ActionShop(client);
  977.        
  978.         return 1;
  979.     }
  980.     else if (equali(iArgs[0],"/dddddddd") )
  981.     {  
  982.         if (!get_pcvar_num(g_cvars[LEVELSYS]))
  983.         {
  984.             ColorChat(client,"HNR Level system is disabled!");
  985.             return 1;
  986.         }
  987.        
  988.         new player = cmd_target(client,iArgs[1],CMDTARGET_NO_BOTS);
  989.        
  990.         if (!player)
  991.         {
  992.             ColorChat(client,"^1Level: ^4%i ^3| ^1Xp: ^4%i ^3| ^1Xp to next level: ^4%i"
  993.             ,playerlevel[client]
  994.             ,playerxp[client]
  995.             ,(playerlevel[client] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[client] + 1]) - playerxp[client])));
  996.         }
  997.        
  998.         else
  999.         {
  1000.             ColorChat(client,"^3%s^1 Level Status:",get_player_name(player));
  1001.             ColorChat(client,"^1Level: ^4%i ^3| ^1Xp: ^4%i ^3| ^1Xp to next level: ^4%i"
  1002.             ,playerlevel[player]
  1003.             ,playerxp[player]
  1004.             ,(playerlevel[player] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[player] + 1]) - playerxp [player])));
  1005.         }
  1006.     }
  1007.    
  1008.     else if (equali( iArgs[0],"/transfer"))
  1009.     {
  1010.         if (!get_pcvar_num(g_cvars[SENDSYS]) || !get_pcvar_num(g_cvars[CASHSYS]))
  1011.         {
  1012.             ColorChat(client,"HNR Transfer/Cash system is disabled!");
  1013.             return 1;
  1014.         }
  1015.        
  1016.         if (equali(iArgs[1],""))
  1017.         {
  1018.             ColorChat(client,"Usage: ^4/transfer <target> <amount>");
  1019.             return 1;
  1020.         }
  1021.        
  1022.         new player = cmd_target(client,iArgs[1],CMDTARGET_NO_BOTS);
  1023.        
  1024.         if (!player || player == client)
  1025.         {
  1026.             ColorChat(client,"You can't transfer cash to yourself!");
  1027.             return 1;
  1028.         }
  1029.        
  1030.         if(!is_str_num(iArgs[2]))
  1031.         {
  1032.             ColorChat(client,"You must enter ^3numbers^1!");
  1033.             return 1;
  1034.         }
  1035.        
  1036.         new num = str_to_num(iArgs[2]);
  1037.        
  1038.         if (!check_cash(client,num))
  1039.         {
  1040.             ColorChat(client,"You don't have that amount of cash!");
  1041.             return 1;
  1042.         }
  1043.        
  1044.        
  1045.         playercash[client] -= num;
  1046.         playercash[player] += num;
  1047.        
  1048.         ColorChat(client,"You send ^4%i^3 cash^1 to ^3%s^1.",num,get_player_name(player));
  1049.         ColorChat(player,"^3%s^1 send ^4%i^3 cash^1 to you.",get_player_name(client),num);
  1050.         ColorChat(0,"^3%s^1 send ^4%i^3 cash^1 to ^3%s^1.",get_player_name(client),num,get_player_name(player));
  1051.        
  1052.         return 1;
  1053.     }  
  1054.    
  1055.     else if(equali(iArgs[0],"/gamble"))
  1056.     {  
  1057.        
  1058.         if( !iArgs[1][ 0 ] )
  1059.         {
  1060.             ColorChat( client, "^4Error: ^1you must to type amount.");
  1061.             return PLUGIN_HANDLED;
  1062.         }
  1063.        
  1064.         new intGambling = str_to_num( iArgs[1] );
  1065.        
  1066.         if( playercash[client] >= 300 && equali( iArgs[1], "allin" ) || equali( iArgs[1], "all" )  )
  1067.         {
  1068.             intGambling = playercash[client];
  1069.             Action_Gambleall(client,(playercash[client]));
  1070.             return PLUGIN_HANDLED;
  1071.         }
  1072.        
  1073.         if (!get_pcvar_num(g_cvars[GAMBLESYS]) || !get_pcvar_num(g_cvars[CASHSYS]))
  1074.         {
  1075.             ColorChat(client,"HNR Gamble/Cash system is disabled!");
  1076.             return 0;
  1077.         }
  1078.        
  1079.         else if(playercash[client] < str_to_num(iArgs[1]))
  1080.         {
  1081.             ColorChat(client,"You ^3don't ^1have enough ^3cash^1!");
  1082.             return 1;
  1083.         }
  1084.        
  1085.         else if(str_to_num(iArgs[1]) < 300)
  1086.         {
  1087.             ColorChat(client,"You ^3must ^1gamble on more than^4 300 ^3cash^1!");
  1088.             return 1;
  1089.         }
  1090.        
  1091.         Action_Gamble(client,(str_to_num(iArgs[1])));
  1092.        
  1093.         return 1;
  1094.     }
  1095.    
  1096.     else if (equali(iArgs[0],"/next") || equali(iArgs[0],"/nextlevel") || equali(iArgs[0],"/nextlvl"))
  1097.     {
  1098.         if (!get_pcvar_num(g_cvars[LEVELSYS]))
  1099.         {
  1100.             ColorChat(client,"HNR Level system is disabled!");
  1101.             return 1;
  1102.         }
  1103.        
  1104.         ColorChat(client,"Xp to next level: ^4%i",(playerlevel[client] == MAX_LEVELS ? 0:(str_to_num(xps[playerlevel[client] + 1]) - playerxp[client])));
  1105.     }
  1106.     else if (equali(iArgs[0],"/eventm"))
  1107.     {
  1108.         EventMenu(client);
  1109.         return 1;
  1110.     }
  1111.    
  1112.     else if (equali(iArgs[0],"/event"))
  1113.     {
  1114.         if (EventStarted)
  1115.             ColorChat(client,"^3%s^1 is running now!",g_eventname[g_event]);
  1116.        
  1117.         else if (get_playersnum() < 2)
  1118.             ColorChat(client,"Need at least^4 1 more player^1 to start an ^4Event^1!");
  1119.        
  1120.         else if (g_round == 4)
  1121.             ColorChat(client,"Event will start next round.");
  1122.        
  1123.         else
  1124.             ColorChat(client,"Rounds until the next event will start: ^4%i^1.",(5 - g_round));
  1125.        
  1126.        
  1127.         return 1;
  1128.     }
  1129. }
  1130.  
  1131. /////////////////////
  1132. /// Gamble Action ///
  1133. /////////////////////
  1134. public Action_Gamble(client,cash){
  1135.        
  1136.     new iMsg[200], iArgs[4][60];
  1137.     read_argv(1,iMsg ,sizeof iMsg - 5);
  1138.     parse(iMsg,iArgs[0],charsmax(iArgs[]),iArgs[1],charsmax(iArgs[]),iArgs[2],charsmax(iArgs[]),iArgs[3],charsmax(iArgs[]));
  1139.     new GambledNum = random(100);
  1140.    
  1141.    
  1142.     switch(GambledNum)
  1143.     {
  1144.         case 0..60:
  1145.         {
  1146.             ColorChat(0,"^3%s^1 has gambled on ^4%i^1 cash and ^3lost^1!",get_player_name(client),cash);
  1147.             playercash[client]-=cash;
  1148.             client_cmd(client, "mp3 play ^"sound/eTs/items/aizeloser.mp3^"");
  1149.            
  1150.         }
  1151.        
  1152.         case 61..100:
  1153.         {
  1154.             ColorChat(0,"^3%s^1 has gambled on ^4%i^1 cash and ^3won^1!",get_player_name(client),cash);
  1155.             playercash[client]+=cash;
  1156.         }
  1157.     }
  1158. }
  1159.  
  1160. public Action_Gambleall(client,cash){
  1161.    
  1162.     new iMsg[200], iArgs[4][60];
  1163.     read_argv(1,iMsg ,sizeof iMsg - 5);
  1164.     parse(iMsg,iArgs[0],charsmax(iArgs[]),iArgs[1],charsmax(iArgs[]),iArgs[2],charsmax(iArgs[]),iArgs[3],charsmax(iArgs[]));
  1165.     new GambledNum = random(100);
  1166.    
  1167.     if( playercash[client] >= 300 )
  1168.     {
  1169.         switch(GambledNum)
  1170.         {
  1171.             case 0..57:
  1172.             {
  1173.                 ColorChat(0,"^3%s^1 has gambled All-in ^4%i^1 cash and ^3lost^1(+2%%)",get_player_name(client),cash);
  1174.                 playercash[client]-=cash;
  1175.                 client_cmd(client, "mp3 play ^"sound/eTs/items/aizeloser.mp3^"");
  1176.                
  1177.             }
  1178.            
  1179.             case 58..100:
  1180.             {
  1181.                 ColorChat(0,"^3%s^1 has gambled All-in ^4%i^1 cash and ^3won^1(+2%%)",get_player_name(client),cash);
  1182.                 playercash[client]+=cash;
  1183.             }
  1184.         }
  1185.     }
  1186.     else
  1187.     {
  1188.         ColorChat(client,"In Order Gamble all-in you must be more 300 cash!!!");
  1189.     }
  1190. }
  1191.  
  1192. // Level Booster //
  1193. public CmdSay( client )
  1194. {
  1195.     new szMsg[ 192 ], szArgs[ 3 ][ 32 ];
  1196.    
  1197.     read_argv( 1, szMsg, charsmax( szMsg ) );
  1198.    
  1199.     parse( szMsg, szArgs[ 0 ], 31, szArgs[ 1 ], 31, szArgs[ 2 ], 31 );
  1200.    
  1201.     if ( equali( szArgs[ 0 ], "/tl" ) | equali( szArgs[ 0 ], "/transferbooster") )
  1202.     {
  1203.         if ( !is_str_num( szArgs[ 2 ] ) || equali( szMsg, "/tl" ) | equali( szMsg, "/transferbooster") )
  1204.             return ColorChat( client, "Syntax: ^4/tl ^1or ^4/transferbooster ^3< name > < amount >" );
  1205.        
  1206.         static iPlayer;
  1207.        
  1208.         iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
  1209.        
  1210.         if ( !iPlayer )
  1211.             return ColorChat( client, "^3%s ^1Was Not Found^4!", szArgs[ 1 ] );
  1212.        
  1213.         if ( iPlayer == client )
  1214.             return ColorChat( client, "You can't transfer booster to yourself^4." );
  1215.        
  1216.         new Amount = str_to_num( szArgs[ 2 ] );
  1217.        
  1218.         if ( Amount > g_LevelBooster[client] )
  1219.             return ColorChat( client, "You don't have enough ^4Levelbooster" );
  1220.         set_user_booster(client, get_user_booster(client) - Amount);
  1221.        
  1222.         set_user_booster(iPlayer, get_user_booster(iPlayer) + Amount);
  1223.        
  1224.         ColorChat( 0, "^3%s ^1Has Transfered ^4%i ^1LevelBooster^3's ^1To ^4%s", GetUserName( client ), Amount, GetUserName( iPlayer ));
  1225.     }
  1226.     if ( equali( szArgs[ 0 ], "/givebooster" ) )
  1227.     {
  1228.         if ( !( get_user_flags( client ) & ADMIN_IMMUNITY ) )
  1229.         {
  1230.             ColorChat(client, "^3Error: ^1You Don't Have ^4Access ^1To This Command^4.");
  1231.             return 1;
  1232.         }
  1233.        
  1234.         if ( !is_str_num( szArgs[ 2 ] ) || equali( szMsg, "/givebooster" ) )
  1235.             return ColorChat( client, "^1Syntax: ^4/givebooster ^3<Player> <Amount>" );
  1236.        
  1237.         static iPlayer, Amount;
  1238.        
  1239.         iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
  1240.        
  1241.         if ( !iPlayer )
  1242.             return ColorChat( client, "^3%s ^1Was Not Found^4!", szArgs[ 1 ] );
  1243.        
  1244.         Amount = str_to_num( szArgs[ 2 ] );
  1245.        
  1246.         if ( Amount < 0 )
  1247.             return ColorChat( client, "You can't use a value lower than^4 0^3." );
  1248.        
  1249.         set_user_booster(iPlayer, get_user_booster(iPlayer) + Amount);
  1250.        
  1251.         ColorChat(0, "Owner: ^3%s ^1has give ^4%i ^1Level booster to ^3%s", GetUserName( client ), Amount, GetUserName( iPlayer ) );
  1252.        
  1253.         return 1;
  1254.     }
  1255.     if ( equali( szArgs[ 0 ], "/levelbooster" ) )
  1256.     {
  1257.         new iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
  1258.        
  1259.         if ( equali( szMsg, "/levelbooster" ) )
  1260.             iPlayer = client;
  1261.        
  1262.         if ( !iPlayer )
  1263.             return ColorChat( client, "^3%s^1 was not found!", szArgs[ 1 ] );
  1264.        
  1265.         new szNameiPlayer[ 33 ];
  1266.         get_user_name( iPlayer, szNameiPlayer, charsmax( szNameiPlayer ) );
  1267.        
  1268.         return ColorChat( client, "^3%s ^1LevelBooster: ^4%i", GetUserName( client ), g_LevelBooster[ client ] );
  1269.     }
  1270.    
  1271.     if ( equali( szArgs[ 0 ], "/takebooster" ) )
  1272.     {
  1273.         if ( !( get_user_flags( client ) & ADMIN_IMMUNITY ) )
  1274.         {
  1275.             ColorChat(client, "^3Error: ^1You don't have ^4access ^1to this command^4.");
  1276.             return 1;
  1277.         }
  1278.        
  1279.         if ( !is_str_num( szArgs[ 2 ] ) || equali( szMsg, "/takebooster" ) )
  1280.             return ColorChat( client, "^1Syntax: ^4/takebooster ^3<Player> <Amount>" );
  1281.        
  1282.         static iPlayer, Amount;
  1283.        
  1284.         iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
  1285.        
  1286.         if ( !iPlayer )
  1287.             return ColorChat( client, "^3%s ^1was not found^3!", szArgs[ 1 ] );
  1288.        
  1289.         Amount = str_to_num( szArgs[ 2 ] );
  1290.        
  1291.         if ( Amount < 0 )
  1292.             return ColorChat( client, "You can't use a value lower than^4 0^3." );
  1293.        
  1294.         set_user_booster(iPlayer, get_user_booster(iPlayer) - Amount);
  1295.        
  1296.         ColorChat(0, "Owner: ^3%s ^1Has Take ^4%i ^1Level Booster To ^3%s", GetUserName( client ), Amount, GetUserName( iPlayer ) );
  1297.        
  1298.         return 1;
  1299.     }
  1300.    
  1301.     if ( equali( szArgs[ 0 ], "/setbooster" ) || equali( szArgs[ 0 ], "/setlvlbooster" ) )
  1302.     {
  1303.         if ( !( get_user_flags( client ) & ADMIN_IMMUNITY ) )
  1304.         {
  1305.             ColorChat(client, "^3Error: ^1You don't have ^4access ^1to this command^4.");
  1306.             return 1;
  1307.         }
  1308.        
  1309.         if ( !is_str_num( szArgs[ 2 ] ) || equali( szMsg, "/setbooster" ) || equali( szMsg, "/setlvlbooster" ) )
  1310.             return ColorChat( client, "^1Syntax: ^4/setbooster ^3<Player> <Amount>" );
  1311.        
  1312.         static iPlayer, Amount;
  1313.        
  1314.         iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
  1315.        
  1316.         if ( !iPlayer )
  1317.             return ColorChat( client, "^3%s ^1was not found ^4!", szArgs[ 1 ] );
  1318.        
  1319.         Amount = str_to_num( szArgs[ 2 ] );
  1320.        
  1321.         if ( Amount < 0 )
  1322.             return ColorChat( client, "You Can't Use a Value Lower Than^4 0^3." );
  1323.        
  1324.         set_user_booster( iPlayer, Amount );
  1325.        
  1326.         ColorChat(0, "Owner: ^3%s ^1has set ^4%i ^1Level Booster to ^3%s", GetUserName( client ), Amount, GetUserName( iPlayer ) );
  1327.        
  1328.         return 1;
  1329.     }
  1330.     return 0;
  1331. }
  1332.  
  1333.  
  1334. public CmdBooster( client )
  1335. {
  1336.     new szText[ 208 ];
  1337.    
  1338.     formatex( szText, charsmax( szText ), "\r[\w eTs \r] \wLevel Booster Menu");
  1339.     new menu = menu_create( szText, "handler1" );
  1340.    
  1341.     formatex( szText, charsmax( szText ), "\wLevelBooster \r[ \y1 Level Booster \r]");
  1342.     menu_additem( menu, szText );
  1343.    
  1344.     formatex( szText, charsmax( szText ), "\wMini LevelBooster \r[\yEXP \r]");
  1345.     menu_additem( menu, szText );
  1346.    
  1347.     menu_display( client, menu );
  1348.    
  1349.     return 1;
  1350. }
  1351.  
  1352. public handler1( client, menu, item )
  1353. {
  1354.     if( item == MENU_EXIT )
  1355.     {
  1356.         menu_destroy( menu );
  1357.         return 1;
  1358.     }
  1359.    
  1360.     switch( item )
  1361.     {
  1362.         case 0: mainlevelbooster(client);
  1363.            
  1364.        
  1365.        
  1366.         case 1: minilevelbooster(client);
  1367.         }
  1368.     return 1;
  1369. }
  1370.  
  1371. public mainlevelbooster( client )
  1372. {
  1373.     new szText[ 208 ];
  1374.    
  1375.     formatex( szText, charsmax( szText ), "\r[\w eTs \r] \wLevel Booster Menu");
  1376.     new menu = menu_create( szText, "mainhandler" );
  1377.    
  1378.     formatex( szText, charsmax( szText ), "\wUse LevelBooster \r[ \y1 Level Booster \r]");
  1379.     menu_additem( menu, szText );
  1380.    
  1381.     formatex( szText, charsmax( szText ), "\wBuy LevelBooster \r[\y1,500,000 Cash\r]^n^n\wYour LevelBoosters: \r%d^n\yNote: \wLevel Booster Will Give You 4 Levels", g_LevelBooster[ client ] );
  1382.     menu_additem( menu, szText );
  1383.    
  1384.     menu_display( client, menu );
  1385.    
  1386.     return 1;
  1387. }
  1388.  
  1389. public mainhandler( client, menu, item )
  1390. {
  1391.     if( item == MENU_EXIT )
  1392.     {
  1393.         menu_destroy( menu );
  1394.         return 1;
  1395.     }
  1396.    
  1397.     switch( item )
  1398.     {
  1399.         case 0:
  1400.         {
  1401.             if( g_LevelBooster[ client ] > 0 )
  1402.             {
  1403.                 g_LevelBooster[ client ]--;
  1404.                 server_cmd("amx_give_level1 ^"%s^" ^"4^"",GetUserName(client));
  1405.                
  1406.                         hnr_set_user_xp( client, hnr_get_user_xp( client ) + 200 );
  1407.                
  1408.                 ColorChat( 0, "^3%s ^1Has used ^4LevelBooster^1, And ^34 Level ^1Has Added to his ^4level!", GetUserName( client ));
  1409.                 CmdBooster( client );
  1410.             }
  1411.             else
  1412.                 ColorChat(client, "^1You need^4 at least %d Level Boosters", 1);
  1413.         }
  1414.        
  1415.        
  1416.         case 1:
  1417.         {
  1418.             if( hnr_get_user_credits( client ) < 1500000 )
  1419.             {
  1420.                 ColorChat( client, "^3Error: ^1You need^4 %d ^1cash to Buy LevelBooster.", 1500000  );
  1421.                 return 1;
  1422.             }
  1423.            
  1424.             g_LevelBooster[ client ] += 1;
  1425.             hnr_set_user_credits( client, hnr_get_user_credits( client ) - 1500000  );
  1426.             ColorChat(0, "^3%s ^1has buy LevelBooster for^4 1,500,000 ^1Cash^4.", GetUserName( client ));
  1427.             CmdBooster(client);
  1428.         }
  1429.     }
  1430.     return 1;
  1431. }
  1432. public minilevelbooster(client)
  1433. {
  1434.     new szText[ 208 ];
  1435.    
  1436.     formatex( szText, charsmax( szText ), "\r[\w eTs \r] \wMiniBooster Menu");
  1437.     new menu = menu_create( szText, "minihandler" );
  1438.    
  1439.     formatex( szText, charsmax( szText ), "\wUse MiniBooster\d ( Requires: 1 MiniBooster )");
  1440.     menu_additem( menu, szText );
  1441.    
  1442.     formatex( szText, charsmax( szText ), "\wBuy MiniBooster\d [ 300,000 Cash ]^n^n\wYour MiniBooster: \r%d^n\d*Note: \wMiniBooster Will Give You Exp & Level^n\r*Warning:\w MiniBooster Can give you Nothing. \y( 20%% )", g_MimiLevelBooster[ client ] );
  1443.     menu_additem( menu, szText );
  1444.    
  1445.     menu_display( client, menu );
  1446.    
  1447.     return 1;
  1448. }
  1449.  
  1450. public minihandler( client, menu, item )
  1451. {
  1452.     if( item == MENU_EXIT )
  1453.     {
  1454.         menu_destroy( menu );
  1455.         return 1;
  1456.     }
  1457.    
  1458.     switch( item )
  1459.     {
  1460.         case 0:
  1461.         {
  1462.             if( g_MimiLevelBooster[ client ] > 0 )
  1463.             {
  1464.                 new luckNum = random(100);
  1465.                 switch(luckNum)
  1466.                 {
  1467.                     case 0..80:
  1468.                     {
  1469.                         new RandomAmount = random_num(0, 25);
  1470.                         g_MimiLevelBooster[ client ]--;
  1471.                         hnr_set_user_xp( client, hnr_get_user_xp( client ) + RandomAmount );
  1472.                        
  1473.                        
  1474.                         ColorChat( 0, "^1Player:^4 %s ^1has used^3 MiniBooster^1 And Won^4 %i ^1Exp, Good Job!", GetUserName( client ), RandomAmount );
  1475.                         minilevelbooster(client);
  1476.                        
  1477.                     }
  1478.                    
  1479.                     case 81..100:
  1480.                     {
  1481.                         new RandomAmount1 = random_num(0, 0);
  1482.                         g_MimiLevelBooster[ client ]--;
  1483.                         hnr_set_user_xp( client, hnr_get_user_xp( client ) + RandomAmount1 );
  1484.                        
  1485.                        
  1486.                         ColorChat( 0, "^1Player:^4 %s ^1has used^3 MiniBooster^1 And Lose, Nice Try!", GetUserName( client ));
  1487.                         minilevelbooster(client);
  1488.                     }
  1489.                    
  1490.                 }
  1491.             }
  1492.         }
  1493.         case 1:
  1494.         {
  1495.             if( hnr_get_user_credits( client ) < 300000 )
  1496.             {
  1497.                 ColorChat( client, "^3Error: ^1You need^4 %d ^1cash to Buy MiniBooster.", 300000  );
  1498.                 return 1;
  1499.             }
  1500.            
  1501.             g_MimiLevelBooster[ client ] += 1;
  1502.             hnr_set_user_credits( client, hnr_get_user_credits( client ) -  300000  );
  1503.             ColorChat(0, "^3%s ^1has buy MiniBooster for^4 300,000 ^1Cash^4.", GetUserName( client ));
  1504.             minilevelbooster(client);
  1505.         }
  1506.     }
  1507. }
  1508. ////////////
  1509. /// Shop ///
  1510. ////////////
  1511. public EventMenu(client){
  1512.    
  1513.     if ( get_user_flags( client ) & ADMIN_LEVEL_B )
  1514.     {
  1515.         new some[256],shop;
  1516.         formatex(some,255,"\r[\w eTs \r] \wEvent Menu");
  1517.        
  1518.         shop = menu_create(some,"handler");
  1519.        
  1520.         menu_additem( shop,"\wMinigun Event");
  1521.         menu_additem( shop,"\wDeagle Event");
  1522.         menu_additem( shop,"\wKnifeSmoke Event");
  1523.         menu_additem( shop,"\wHE Event");
  1524.         menu_additem( shop,"\wKnife Event");
  1525.         menu_additem( shop,"\wAWP Event");
  1526.         menu_additem( shop,"\wSpeical Gun Event");
  1527.         menu_additem( shop,"\wCreateBox Event");
  1528.         menu_additem( shop,"\wUzi Event");
  1529.         menu_additem( shop,"\wGravity Event");
  1530.         menu_additem( shop,"\wSpeed Event");
  1531.         menu_additem( shop,"\wIDF Event");
  1532.         menu_additem( shop,"\wHideAndSeek Event");
  1533.        
  1534.         menu_setprop(shop,MPROP_EXIT,MEXIT_ALL);
  1535.         menu_setprop(shop,MPROP_EXITNAME,"\yExit Menu");
  1536.        
  1537.         menu_display(client,shop);
  1538.        
  1539.         return 1;
  1540.     }
  1541. }
  1542. public handler( client, menu, item )
  1543. {
  1544.     if( item == MENU_EXIT )
  1545.     {
  1546.         menu_destroy( menu );
  1547.         return 1;
  1548.     }
  1549.     static szName[ 32 ];
  1550.     get_user_name( client, szName, charsmax( szName ) );
  1551.     static players[32],pnum;
  1552.     get_players(players,pnum,"aceh","TERRORIST");
  1553.    
  1554.     switch(item)
  1555.     {  
  1556.         case 0:
  1557.         {
  1558.             for (new i; i < pnum; i++)
  1559.             {
  1560.  
  1561.                
  1562.                
  1563.                
  1564.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1565.                 show_dhudmessage(0,"Admin %s Started Minigun Event",szName);
  1566.                
  1567.                 ColorChat(0,"Admin ^4%s ^1Started ^3Minigun Event",szName);
  1568.                
  1569.                 CreateFog(random( 256 ), random( 256 ), random( 256 ),FOG_HIGH);
  1570.                 fm_strip_user_weapons(players[i]);
  1571.                 fm_give_item(players[i],"weapon_m249");
  1572.                 cs_set_user_bpammo(players[i],CSW_M249,2562);
  1573.                
  1574.                
  1575.             }
  1576.         }
  1577.         case 1:
  1578.         {
  1579.             for (new i; i < pnum; i++)
  1580.             {
  1581.            
  1582.                
  1583.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1584.                 show_dhudmessage(0,"Admin %s Started Deagle Event",szName);
  1585.                
  1586.                 ColorChat(0,"Admin ^4%s ^1Started ^3Deagle Event",szName);
  1587.                 fm_strip_user_weapons(players[i]);
  1588.                 fm_give_item(players[i],"weapon_deagle");
  1589.                 cs_set_user_bpammo(players[i],CSW_DEAGLE,2562);
  1590.             }
  1591.         }
  1592.         case 2:
  1593.         {
  1594.             for (new i; i < pnum; i++)
  1595.             {
  1596.            
  1597.                
  1598.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1599.                 show_dhudmessage(0,"Admin %s Started KnifeSmoke Event",szName);
  1600.                
  1601.                 ColorChat(0,"Admin ^4%s ^1Started ^3KnifeSmoke Event",szName);
  1602.                 fm_strip_user_weapons(players[i]);
  1603.                 fm_give_item(players[i],"weapon_knife");
  1604.                 fm_give_item(players[i],"weapon_smokegrenade");
  1605.                 cs_set_user_bpammo(players[i],CSW_SMOKEGRENADE,10);
  1606.             }
  1607.         }
  1608.         case 3:
  1609.         {
  1610.             for (new i; i < pnum; i++)
  1611.             {
  1612.            
  1613.                
  1614.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1615.                 show_dhudmessage(0,"Admin %s Started HE Event",szName);
  1616.                
  1617.                 ColorChat(0,"Admin ^4%s ^1Started ^3HE Event",szName);
  1618.                 fm_strip_user_weapons(players[i]);
  1619.                 fm_give_item(players[i],"weapon_hegrenade");
  1620.                 cs_set_user_bpammo(players[i],CSW_HEGRENADE,2562);
  1621.             }
  1622.         }
  1623.         case 4:
  1624.         {
  1625.             for (new i; i < pnum; i++)
  1626.             {
  1627.            
  1628.                
  1629.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1630.                 show_dhudmessage(0,"Admin %s Started Knife Event",szName);
  1631.                
  1632.                 ColorChat(0,"Admin ^4%s ^1Started ^3Knife Event",szName);
  1633.                 fm_strip_user_weapons(players[i]);
  1634.                 fm_give_item(players[i],"weapon_knife");
  1635.             }
  1636.         }
  1637.         case 5:
  1638.         {
  1639.             for (new i; i < pnum; i++)
  1640.             {
  1641.                
  1642.            
  1643.                
  1644.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1645.                 show_dhudmessage(0,"Admin %s Started Awp Event",szName);
  1646.                
  1647.                 ColorChat(0,"Admin ^4%s ^1Started ^3Awp Event",szName);
  1648.                 fm_strip_user_weapons(players[i]);
  1649.                 fm_give_item(players[i],"weapon_awp");
  1650.                 cs_set_user_bpammo(players[i],CSW_AWP,2562);
  1651.             {
  1652.                
  1653.                 if(playerlevel[client] >= 15)  
  1654.                 {
  1655.                     set_pev(players[i],pev_viewmodel2,awpModel1);
  1656.                     ColorChat(client, "^4Hey, ^1Your Awp Skin Is : ^3Awp | Dragon Lore ^1[ ^4Level 15+ ^1]");
  1657.                 }
  1658.                 if(playerlevel[client] >= 40)  
  1659.                 {
  1660.                     set_pev(players[i],pev_viewmodel2,awp10Model);
  1661.                     ColorChat(client, "^4Hey, ^1Your Awp Skin Is : ^3Awp | X-mas ^1[ ^4Level 40+ ^1]");
  1662.                 }
  1663.             }
  1664.         }
  1665.     }
  1666.     case 6:
  1667.     {
  1668.    
  1669.        
  1670.     }
  1671.     case 7:
  1672.     {
  1673.         if(get_user_flags(client) & ADMIN_IMMUNITY)
  1674.            
  1675.             client_cmd(client, "say /create");
  1676.            
  1677.         }
  1678.    
  1679.         case 8:
  1680.         {
  1681.             for (new i; i < pnum; i++)
  1682.             {
  1683.                
  1684.                
  1685.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1686.                 show_dhudmessage(0,"Admin %s Started Uzi Event",szName);
  1687.                
  1688.                
  1689.                 ColorChat(0,"Admin ^4%s ^1Started ^3Uzi Event",szName);
  1690.                 fm_strip_user_weapons(players[i]);
  1691.                 fm_give_item(players[i],"weapon_mac10");
  1692.                 cs_set_user_bpammo(players[i],CSW_MAC10,2562);
  1693.             {
  1694.                
  1695.                 if(playerlevel[client] >= 10)  
  1696.                 {
  1697.                     set_pev(players[i],pev_viewmodel2,mac101Model);
  1698.                     ColorChat(client, "^4Hey, ^1Your MAC-10 Skin Is : ^3MAC-10 | Neon Rider ^1[ ^4Level 10+ ^1]");
  1699.                 }
  1700.                 if(playerlevel[client] >= 35)  
  1701.                 {  
  1702.                     set_pev(players[i],pev_viewmodel2,mac1010Model);
  1703.                     ColorChat(client, "^4Hey, ^1Your MAC-10 Skin Is : ^3MAC-10 | Rangeen ^1[ ^4Level 35+ ^1]");
  1704.                 }
  1705.             }
  1706.         }
  1707.     }
  1708.     case 9:
  1709.     {
  1710.         for (new i; i < pnum; i++)
  1711.         {
  1712.            
  1713.            
  1714.             set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1715.             show_dhudmessage(0,"Admin %s Started Gravity Event",szName);
  1716.            
  1717.             ColorChat(0,"Admin ^4%s ^1Started ^3Gravity Event",szName);
  1718.             set_pev(players[i],pev_gravity,0.7);  
  1719.         }
  1720.     }
  1721.     case 10:
  1722.     {
  1723.         for (new i; i < pnum; i++)
  1724.         {
  1725.            
  1726.            
  1727.             set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1728.             show_dhudmessage(0,"Admin %s Started Speed Event",szName);
  1729.            
  1730.             ColorChat(0,"Admin ^4%s ^1Started ^3Speed Event",szName);
  1731.             new maxspeed = pev(client,pev_maxspeed);
  1732.             maxspeed*=3.0;
  1733.             set_pev(players[i],pev_maxspeed,maxspeed);
  1734.         }
  1735.     }
  1736.     case 11:
  1737.     {
  1738.         for (new i; i < pnum; i++)
  1739.         {
  1740.            
  1741.            
  1742.             set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1743.             show_dhudmessage(0,"Admin %s Started IDF Event",szName);
  1744.            
  1745.            
  1746.             ColorChat(0,"Admin ^4%s ^1Started ^3IDF Event",szName);
  1747.                          if(playerlevel[client] >= 0)       cs_set_user_model(infected,"IDF");
  1748.    
  1749.         }
  1750.     }
  1751.     case 12:
  1752.     {
  1753.         for (new i; i < pnum; i++)
  1754.         {
  1755.            
  1756.            
  1757.             set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  1758.             show_dhudmessage(0,"Admin %s Started HideAndSeek Event",szName);
  1759.            
  1760.             ColorChat(0,"Admin ^4%s ^1Started ^3HideAndSeek Event",szName);
  1761.             ColorChat(0,"^4Note:^1You Need To find your teammates  in dark");
  1762.             fm_set_lights("b");
  1763.         }
  1764.     }
  1765. }
  1766. return 1;
  1767. }
  1768.  
  1769.  
  1770.  
  1771.  
  1772. public weaponlevel(client)
  1773. {
  1774.  
  1775. new some[256],shop;
  1776. formatex(some,255,"\r[\w eTs \r] \wWeapon Level Menu^n\dLevel: \r%i",playerlevel[client]);
  1777.  
  1778. shop = menu_create(some,"weaponhandler");
  1779.  
  1780.  
  1781. menu_additem( shop,"MAC-10 | Neon Rider \r[\yLevel 10+\r]");
  1782.  
  1783. menu_additem( shop,"Awp | Dragon Lore \r[\yLevel 15+\r]");
  1784.  
  1785. menu_additem( shop,"MAC-10 | Rangeen \r[\yLevel 35+\r]");
  1786.  
  1787. menu_additem( shop,"Awp | X-mas \r[\yLevel 40+\r]");
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793. menu_setprop(shop,MPROP_EXIT,MEXIT_ALL);
  1794. menu_setprop(shop,MPROP_EXITNAME,"\yExit Menu");
  1795.  
  1796. menu_display(client,shop);
  1797.  
  1798. return 1;
  1799. }
  1800.  
  1801. public weaponhandler(client,shop,item){
  1802. if (item == MENU_EXIT)
  1803. {
  1804.     menu_destroy(shop);
  1805.     return;
  1806. }
  1807.  
  1808. switch (item)
  1809. {
  1810.     case 0:     weaponlevel(client);
  1811.        
  1812.             case 1: weaponlevel(client);
  1813.             case 2: weaponlevel(client);
  1814.             case 3: weaponlevel(client) ;
  1815.             case 4: weaponlevel(client);
  1816.             case 5: weaponlevel(client);
  1817.             case 6: weaponlevel(client);
  1818.             case 7:
  1819.         {
  1820.            
  1821.             ActionShop(client);
  1822.             return;
  1823.            
  1824.         }
  1825.     }
  1826.     menu_destroy(shop);
  1827. }
  1828.  
  1829.  
  1830. public zombienew(client)
  1831. {
  1832.     new some[256],shop;
  1833.     formatex(some,255,"\r(\weTs\r) \wZombie Menu^n\dCash: \r%i | \dLevel: \r%i",playercash[client],playerlevel[client]);
  1834.    
  1835.     shop = menu_create(some,"zombiehandler");
  1836.    
  1837.     menu_additem( shop,"ClownMeister \r[\yLevel 0+\r]");
  1838.    
  1839.     menu_additem( shop,"Big Foot \r[\yLevel 20+\r]");
  1840.    
  1841.     menu_additem( shop,"Monster \r[\yLevel 35+\r]");
  1842.    
  1843.     menu_additem( shop,"Titan \r[\yLevel 45+\r]");
  1844.  
  1845.     menu_additem( shop,"Witch Zombie \r[\yPremium Only\r]");
  1846.    
  1847.     menu_additem( shop,"Troll Infected \r[\yOwner Only\r]^n^n\d*This System Will Choose Automatic by your level (use /cam to check your model)\d*");
  1848.    
  1849.    
  1850.    
  1851.     menu_setprop(shop,MPROP_EXIT,MEXIT_ALL);
  1852.     menu_setprop(shop,MPROP_EXITNAME,"\yExit Menu");
  1853.    
  1854.     menu_display(client,shop);
  1855.    
  1856.     return 1;
  1857. }
  1858. public zombiehandler(client,shop,item){
  1859.     if (item == MENU_EXIT)
  1860.     {
  1861.         menu_destroy(shop);
  1862.         return;
  1863.     }
  1864.    
  1865.     switch (item)
  1866.     {
  1867.         case 0:     if(playerlevel[client] >= 0)       cs_set_user_model(infected,"AlienAngel");
  1868.            
  1869.         case 1:     if(playerlevel[client] >= 20)       cs_set_user_model(infected,"AlienAngel");
  1870.        
  1871.         case 2:     if(playerlevel[client] >= 35)       cs_set_user_model(infected,"AlienAngel"); // level 35
  1872.        
  1873.         case 3:     if(playerlevel[client] >= 45)       cs_set_user_model(infected,"AlienAngel"); // level 45
  1874.            
  1875.         case 4:     if(get_user_flags(client) & ADMIN_LEVEL_C)       cs_set_user_model(infected,"AlienAngel");  //premium
  1876.        
  1877.         case 5:     if(get_user_flags(client) & ADMIN_IMMUNITY)       cs_set_user_model(infected,"AlienAngel"); // owner
  1878.        
  1879.         case 6:     zombienew(client);
  1880.        
  1881.         case 7:     zombienew(client);
  1882.        
  1883.         case 8:
  1884.         {
  1885.            
  1886.             ActionShop(client);
  1887.             return;
  1888.            
  1889.         }
  1890.     }
  1891.     menu_destroy(shop);
  1892. }
  1893.  
  1894. public BlockDrop(client)
  1895. {
  1896.    
  1897.     client_print(client, print_center, "This weapon cannot be dropped!");
  1898. }
  1899.  
  1900. public ActionShop(client){
  1901.     if (!get_pcvar_num(g_cvars[ENABLED]))
  1902.         return 0;
  1903.    
  1904.     new some[256],shop;
  1905.     formatex(some,255,"\r[\w eTs \r] \wShop Menu^n\wCash: \r%i \y, \wLevel: \r%i",playercash[client],playerlevel[client]);
  1906.    
  1907.     shop = menu_create(some,"Shop_Handler");
  1908.    
  1909.    
  1910.     menu_additem(shop,"\wEvent Menu \d[\r Admin Only \d]");
  1911.     menu_additem(shop,"\wKnife Menu \d(Cash)");
  1912.     menu_additem(shop,"\wScout Menu \d(Level)");
  1913.     menu_additem(shop,"\wLevelBooster Shop \d(Cash)");
  1914.    
  1915.     menu_setprop(shop,MPROP_EXIT,MEXIT_ALL);
  1916.     menu_setprop(shop,MPROP_EXITNAME,"\yExit");
  1917.    
  1918.     menu_display(client,shop);
  1919.    
  1920.     return 1;
  1921. }
  1922.  
  1923.  
  1924. public Shop_Handler(client,shop,item){
  1925.     if (item == MENU_EXIT)
  1926.     {
  1927.         menu_destroy(shop);
  1928.         return;
  1929.     }
  1930.    
  1931.     switch (item)
  1932.     {
  1933.             case 0: EventMenu(client);
  1934.             case 1: client_cmd(client,"say /knife");
  1935.             case 2: client_cmd(client,"say /scout");  
  1936.             case 3: client_cmd(client,"say /usebooster");
  1937.         }
  1938.     return;
  1939.     menu_destroy(shop);
  1940. }
  1941.  
  1942. public fw_ScoutOnZoomOn(const ent){
  1943.     if (!get_pcvar_num(g_cvars[ENABLED]))
  1944.         return HAM_IGNORED;
  1945.    
  1946.     if (get_pcvar_num(g_cvars[NOZOOM]))
  1947.         return HAM_SUPERCEDE;
  1948.    
  1949. }
  1950.  
  1951.  
  1952. public cmd_give_xp(id,level,cid,client)
  1953. {
  1954.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  1955.    
  1956.     new target[32], amount[21], reason[21];
  1957.    
  1958.     read_argv(1, target, 31 );
  1959.     read_argv(2, amount, 20 );
  1960.     read_argv( 3, reason, 20 );
  1961.    
  1962.     new player = cmd_target( id, target, 8 );
  1963.    
  1964.     if( ! player )
  1965.         return 1;
  1966.    
  1967.     new admin_name[32], player_name[32];
  1968.     get_user_name(id, admin_name, 31);
  1969.     get_user_name(player, player_name, 31);
  1970.    
  1971.     new pointnum = str_to_num(amount);
  1972.    
  1973.     playerxp[player] += pointnum;
  1974.     ColorChat( 0, "^1Owner: ^4%s ^1Gave to ^4%s ^3%i ^1XP",admin_name, player_name, pointnum );
  1975.    
  1976.    
  1977.     SaveData( id );
  1978.    
  1979.     return PLUGIN_CONTINUE;
  1980. }
  1981.  
  1982. public cmd_set_xp(id,level,cid,client)
  1983. {
  1984.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  1985.    
  1986.     new target[32], amount[21], reason[21];
  1987.    
  1988.     read_argv(1, target, 31 );
  1989.     read_argv(2, amount, 20 );
  1990.     read_argv( 3, reason, 20 );
  1991.    
  1992.     new player = cmd_target( id, target, 8 );
  1993.    
  1994.     if( ! player )
  1995.         return 1;
  1996.    
  1997.     new admin_name[32], player_name[32];
  1998.     get_user_name(id, admin_name, 31);
  1999.     get_user_name(player, player_name, 31);
  2000.    
  2001.     new pointnum = str_to_num(amount);
  2002.    
  2003.     playerxp[player] = pointnum;
  2004.     ColorChat( 0, "^1Owner: ^4%s ^1Set to ^4%s ^3%i ^1XP",admin_name, player_name, pointnum );
  2005.    
  2006.     if (playerxp[client] > str_to_num(xps[playerlevel[client]]))
  2007.     {
  2008.         playerlevel[client]++;
  2009.         ColorChat(client,"Congratulations! You'r have level up! You'r new level is: ^4%i^1",playerlevel[client]);
  2010.         ColorChat(0,"^3%s^1 has level up to level ^4%i^1!",get_player_name(client),playerlevel[client]);
  2011.     }
  2012.     SaveData( id );
  2013.    
  2014.     return PLUGIN_CONTINUE;
  2015. }
  2016.  
  2017. public cmd_give_level(id,level,cid)
  2018. {
  2019.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2020.    
  2021.     new target[32], amount[21], reason[21];
  2022.    
  2023.     read_argv(1, target, 31 );
  2024.     read_argv(2, amount, 20 );
  2025.     read_argv( 3, reason, 20 );
  2026.    
  2027.     new player = cmd_target( id, target, 8 );
  2028.    
  2029.     if( ! player )
  2030.         return 1;
  2031.    
  2032.     new admin_name[32], player_name[32];
  2033.     get_user_name(id, admin_name, 31);
  2034.     get_user_name(player, player_name, 31);
  2035.    
  2036.     new pointnum = str_to_num(amount);
  2037.    
  2038.     playerlevel[player] += pointnum;
  2039.    
  2040.     ColorChat( 0, "^1Owner: ^4%s ^1Gave to ^4%s ^3%i ^1level",admin_name, player_name, pointnum );
  2041.    
  2042.    
  2043.     SaveData( id );
  2044.    
  2045.     return PLUGIN_CONTINUE;
  2046. }
  2047.  
  2048. // for the level booster //
  2049. public cmd_give_level1(id,level,cid)
  2050. {
  2051.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2052.    
  2053.     new target[32], amount[21], reason[21];
  2054.    
  2055.     read_argv(1, target, 31 );
  2056.     read_argv(2, amount, 20 );
  2057.     read_argv( 3, reason, 20 );
  2058.    
  2059.     new player = cmd_target( id, target, 8 );
  2060.    
  2061.     if( ! player )
  2062.         return 1;
  2063.    
  2064.     new admin_name[32], player_name[32];
  2065.     get_user_name(id, admin_name, 31);
  2066.     get_user_name(player, player_name, 31);
  2067.    
  2068.     new pointnum = str_to_num(amount);
  2069.    
  2070.     playerlevel[player] += pointnum;
  2071.    
  2072.    
  2073.     SaveData( id );
  2074.    
  2075.     return PLUGIN_CONTINUE;
  2076. }
  2077.  
  2078. public cmd_take_level(id,level,cid)
  2079. {
  2080.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2081.    
  2082.     new target[32], amount[21], reason[21];
  2083.    
  2084.     read_argv( 1, target, 31 );
  2085.     read_argv( 2, amount, 20 );
  2086.     read_argv( 3, reason, 20 );
  2087.    
  2088.     new player = cmd_target( id, target, 8 );
  2089.    
  2090.     if(!player )
  2091.         return 1;
  2092.    
  2093.     new admin_name[32], player_name[32];
  2094.     get_user_name( id, admin_name, 31 );
  2095.     get_user_name( player, player_name, 31 );
  2096.    
  2097.     new pointnum = str_to_num( amount );
  2098.    
  2099.     playerlevel[player] -= pointnum;
  2100.    
  2101.     ColorChat( 0, "^1Owner: ^4%s ^1Took from ^4%s ^3%i ^1level",admin_name, player_name, pointnum );
  2102.    
  2103.     SaveData( id );
  2104.    
  2105.     return PLUGIN_CONTINUE;
  2106. }
  2107.  
  2108. public cmd_give_points(id,level,cid)
  2109. {
  2110.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2111.    
  2112.     new target[32], amount[21], reason[21];
  2113.    
  2114.     read_argv(1, target, 31 );
  2115.     read_argv(2, amount, 20 );
  2116.     read_argv( 3, reason, 20 );
  2117.    
  2118.     new player = cmd_target( id, target, 8 );
  2119.    
  2120.     if( ! player )
  2121.         return 1;
  2122.    
  2123.     new admin_name[32], player_name[32];
  2124.     get_user_name(id, admin_name, 31);
  2125.     get_user_name(player, player_name, 31);
  2126.    
  2127.     new pointnum = str_to_num(amount);
  2128.    
  2129.     playercash[player] += pointnum;
  2130.    
  2131.     ColorChat( 0, "^1Owner: ^4%s ^1Gave to ^4%s ^3%i ^1Cash",admin_name, player_name, pointnum );
  2132.    
  2133.    
  2134.     SaveData(id);
  2135.    
  2136.     return PLUGIN_CONTINUE;
  2137. }
  2138.  
  2139. public cmd_set_points(id,level,cid)
  2140. {
  2141.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2142.    
  2143.     new target[32], amount[21], reason[21];
  2144.    
  2145.     read_argv(1, target, 31 );
  2146.     read_argv(2, amount, 20 );
  2147.     read_argv( 3, reason, 20 );
  2148.    
  2149.     new player = cmd_target( id, target, 8 );
  2150.    
  2151.     if( ! player )
  2152.         return 1;
  2153.    
  2154.     new admin_name[32], player_name[32];
  2155.     get_user_name(id, admin_name, 31);
  2156.     get_user_name(player, player_name, 31);
  2157.    
  2158.     new pointnum = str_to_num(amount);
  2159.    
  2160.     playercash[player] = pointnum;
  2161.    
  2162.     ColorChat( 0, "^1Owner: ^4%s ^1Set for ^4%s ^3%i ^1Cash",admin_name, player_name, pointnum );
  2163.    
  2164.    
  2165.     SaveData(id);
  2166.    
  2167.     return PLUGIN_CONTINUE;
  2168. }
  2169.  
  2170. public cmd_take_points(id,level,cid)
  2171. {
  2172.     if( !(get_user_flags( id ) & ADMIN_IMMUNITY ) ) return 1;
  2173.    
  2174.     new target[32], amount[21], reason[21];
  2175.    
  2176.     read_argv( 1, target, 31 );
  2177.     read_argv( 2, amount, 20 );
  2178.     read_argv( 3, reason, 20 );
  2179.    
  2180.     new player = cmd_target( id, target, 8 );
  2181.    
  2182.     if(!player )
  2183.         return 1;
  2184.    
  2185.     new admin_name[32], player_name[32];
  2186.     get_user_name( id, admin_name, 31 );
  2187.     get_user_name( player, player_name, 31 );
  2188.    
  2189.     new pointnum = str_to_num( amount );
  2190.    
  2191.     playercash[player] -= pointnum;
  2192.    
  2193.     ColorChat( 0, "^1Owner: ^4%s ^1Took from ^4%s ^3%i ^1Cash",admin_name, player_name, pointnum );
  2194.    
  2195.     SaveData(id);
  2196.    
  2197.     return 1;
  2198. }
  2199.  
  2200. public resetmenu(client){
  2201.     if(playerlevel[client] <= 199)
  2202.     {
  2203.         ColorChat(client, "You ^3most^1 be ^4atleast^1 level^3 200^1+");
  2204.         return PLUGIN_HANDLED;
  2205.     }
  2206.     else
  2207.     {
  2208.         ColorChat(client, "You have been ^3reset^1 your level");
  2209.         Reset[client]++;
  2210.         playerlevel[client] = 0;
  2211.         playerxp[client] = 0;
  2212.         SaveData( client );
  2213.         return PLUGIN_HANDLED;
  2214.     }
  2215.     return PLUGIN_HANDLED;
  2216. }
  2217.  
  2218. public RemoveInv(client){
  2219.     if(is_user_alive(client))
  2220.     {
  2221.         ColorChat(client,"^4Invisibility Power^1 has gone! You are ^3visible^1 now!");
  2222.         fm_set_entity_visibility(client,1);
  2223.     }
  2224.    
  2225.     g_powers[client][INVISIBILITY] = false;
  2226. }
  2227.  
  2228. public Shop_CallBack2(client,shop,item){
  2229.     if (!is_user_alive(client) || g_powers[client][item] || EventStarted || !get_pcvar_num(g_cvars[CASHSYS]))
  2230.         return ITEM_DISABLED;
  2231.    
  2232.     return ITEM_ENABLED;
  2233. }
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244. /////////////////////////
  2245. /// Block team change ///
  2246. /////////////////////////
  2247.  
  2248. public cmd_block(client){
  2249.     if (cs_get_user_team(client) == CS_TEAM_SPECTATOR)
  2250.           cs_set_user_team(client,CS_TEAM_T);
  2251.    
  2252.     ActionShop(client);
  2253.     return PLUGIN_HANDLED_MAIN;
  2254. }
  2255.  
  2256. ///////////////////
  2257. /// Adv message ///
  2258. ///////////////////
  2259.  
  2260. public Adv_message(){
  2261.     ColorChat(0,"type ^4/premiumget ^1to check out what premium get.");
  2262.     ColorChat(0,"^1type^4 /status^1 to Check your ^3Game Info");
  2263.     ColorChat(0,"^1type^4 /wlevel^1 to Check the ^3Weapons Level Skins");
  2264. }
  2265.  
  2266. // Game Description
  2267. public fw_GetGameDescription(){
  2268.     new some[32];
  2269.     formatex(some,31,"eTs HitAndRun",PLUGIN_VERSION);
  2270.     //formatex(some,31,"eTs HitAndRun v%s",PLUGIN_VERSION);
  2271.     forward_return(FMV_STRING,some);
  2272.     return FMRES_SUPERCEDE;
  2273. }
  2274.  
  2275. public fw_ClientKill(client){
  2276.     if (!get_pcvar_num(g_cvars[ENABLED]) || !get_pcvar_num(g_cvars[BLOCKKILL]) || !is_user_alive(client))
  2277.         return FMRES_IGNORED;
  2278.    
  2279.     ColorChat(client,"You cann't kill yourself!");
  2280.     console_print(client,"You cann't kill yourself!");
  2281.    
  2282.     return FMRES_SUPERCEDE;
  2283. }
  2284.  
  2285. //////////////////////
  2286. /// Hide HUD Stuff ///
  2287. //////////////////////
  2288.  
  2289. public msgStatusIcon(msgid,msgdest,id){
  2290.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2291.         return 1;
  2292.    
  2293.     static szIcon[8];
  2294.     get_msg_arg_string(2,szIcon,7);
  2295.    
  2296.     if(equal(szIcon,"buyzone") && get_msg_arg_int(1))
  2297.     {
  2298.         set_pdata_int(id,235,get_pdata_int(id,235) & ~(1<<0));
  2299.         return 1;
  2300.     }
  2301.    
  2302.     return 0;
  2303. }  
  2304.  
  2305. public MessageMoney(msgid,dest,id){
  2306.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2307.         return;
  2308.    
  2309.     set_pdata_int(id,OFFSET_CSMONEY,0);
  2310.     set_msg_arg_int(1,ARG_LONG,0);
  2311. }
  2312.  
  2313. public MessageHideWeapon(msgid,dest,id){
  2314.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2315.         return;
  2316.    
  2317.     set_msg_arg_int(1,ARG_BYTE,get_msg_arg_int(1) | (1<<5));
  2318. }
  2319.  
  2320. public Event_ResetHUD(client){
  2321.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2322.         return;
  2323.    
  2324.     set_pdata_int(client,362,0);
  2325.     set_pdata_int(client,361,(1<<3)|(1<<4));
  2326. }
  2327.  
  2328. public Event_HideWeapon(client){
  2329.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2330.         return;
  2331.    
  2332.     new iFlags = read_data(1);
  2333.    
  2334.     new HudFlags;
  2335.    
  2336.     for (new i = 0; i <= 7; i++)
  2337.         HudFlags |= 1<<i;
  2338.    
  2339.     if(1<<3 && (iFlags & 1<<3 != 1<<3))
  2340.     {
  2341.         set_pdata_int(client,362,0);
  2342.         set_pdata_int(client,361,iFlags|(1<<3)|(1<<4));
  2343.     }
  2344.    
  2345.     if(iFlags & HudFlags && !(1<<3 & 1<<7) && is_user_alive(client))
  2346.         set_pdata_cbase(client,374,FM_NULLENT);
  2347. }
  2348.  
  2349. public Event_CurWeapon(client){
  2350.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2351.         return;
  2352.    
  2353.     if (g_powers[client][SPEED])
  2354.     {
  2355.         new maxspeed = pev(client,pev_maxspeed);
  2356.         maxspeed*=2.0;
  2357.         engfunc(EngFunc_SetClientMaxspeed,client,maxspeed);
  2358.         set_pev(client,pev_maxspeed,maxspeed);
  2359.     }
  2360. }
  2361.  
  2362. public Event_Flash(client){
  2363.     if (g_powers[client][NOFLASH])
  2364.     {
  2365.         message_begin(MSG_ONE,g_msgScreenFade,{0,0,0},client);
  2366.         write_short((1<<0));
  2367.         write_short((1<<0));
  2368.         write_short((1<<0));
  2369.         write_byte(0);
  2370.         write_byte(0);
  2371.         write_byte(0);
  2372.         write_byte(255);
  2373.         message_end();
  2374.     }
  2375. }
  2376.  
  2377. ////////////////////
  2378. /// Some Events ///
  2379. //////////////////
  2380.  
  2381. public Event_RoundStart(){
  2382.     if (g_winner)
  2383.         remove_task(g_winner);
  2384.    
  2385.     for (new i = 1; i <= g_maxplayers; i++)
  2386.     {
  2387.         if (is_user_connected(i))
  2388.         {
  2389.             if (cs_get_user_team(i) != CS_TEAM_T)
  2390.                 cs_set_user_team(i,CS_TEAM_T);
  2391.            
  2392.             if (!is_user_alive(i))
  2393.                 ExecuteHam(Ham_CS_RoundRespawn,i);
  2394.             fm_set_lights("m");
  2395.  
  2396.         }
  2397.     }
  2398.    
  2399.     remove_task(COUNTDOWN_TASKID);
  2400.     remove_task(GAMESTART_TASKID);
  2401.     remove_task(SOUNDS_TASKID);
  2402.     remove_task(TIMER_TASKID);
  2403.    
  2404.    
  2405.     GameStarted = false;
  2406.     EventStarted = false;
  2407.     infected = 0;
  2408.     g_lasthit = 0;
  2409.     g_lasttwo = false;
  2410.     g_event = 0;
  2411.     g_winner = 0;
  2412.     CreateFog(0,0,0,FOG_OFF);
  2413.    
  2414.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2415.         return;
  2416.    
  2417.     cd = 10;
  2418.    
  2419.     set_task(1.0,"StartCD",COUNTDOWN_TASKID,.flags="b");
  2420.     set_task(11.0,"Start_Game",GAMESTART_TASKID);
  2421.     client_cmd(0,"mp3 stop");
  2422.     fm_set_lights("m");
  2423.  
  2424. }
  2425.  
  2426. public StartCD(taskid){
  2427.     static szWord[32];
  2428.     num_to_word(cd,szWord,31);
  2429.    
  2430.     if (cd < 1)
  2431.     {
  2432.         remove_task(taskid);
  2433.         return;
  2434.     }
  2435.    
  2436.     client_cmd(0,"spk ^"\vox/%s second%s^"",szWord,cd > 1 ? "s":"");
  2437.    
  2438.     set_dhudmessage( 100, 100, 255,-1.0,0.14,1,6.0,0.5,0.25,0.25);
  2439.     show_dhudmessage(0,"Infection start in %i second%s!",cd,cd > 1 ? "s":"");
  2440.     fm_set_lights("m");
  2441.     fm_set_lights("m");
  2442.     fm_set_lights("m");
  2443.     fm_set_lights("m");
  2444.  
  2445.  
  2446.    
  2447.     cd--;
  2448. }
  2449.  
  2450. public Event_RoundEnd(){
  2451.     GameStarted = false;
  2452.     EventStarted = false;
  2453.     infected = 0;
  2454.     g_lasthit = 0;
  2455.     g_lasttwo = false;
  2456.     g_event = 0;
  2457.    
  2458.     CreateFog(0,0,0,FOG_OFF);
  2459.    
  2460.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2461.         return;
  2462.    
  2463.     for (new i = 1; i <= g_maxplayers; i++)
  2464.     {
  2465.         if (is_user_connected(i))
  2466.         {
  2467.             if (cs_get_user_team(i) == CS_TEAM_T)
  2468.             g_rounds[i]++;
  2469.            
  2470.             if (cs_get_user_team(i) != CS_TEAM_T)
  2471.             cs_set_user_team(i,CS_TEAM_T);
  2472.            
  2473.             g_powers[i][SPEED] = false;
  2474.             g_powers[i][INVISIBILITY] = false;
  2475.             g_powers[i][GRAVITY] = false;
  2476.             g_powers[i][NOHEGRENADE] = false;
  2477.             g_powers[i][NOFLASH] = false;
  2478.         }
  2479.     }
  2480. }
  2481.  
  2482. //////////////////////////
  2483. /// Some HAM functions ///
  2484. //////////////////////////
  2485.  
  2486. public fw_HamPlayerSpawn(client){
  2487.     if (!is_user_alive(client) || !get_pcvar_num(g_cvars[ENABLED]))
  2488.         return;
  2489.    
  2490.     else if (GameStarted)
  2491.     {
  2492.         fm_strip_user_weapons(client);
  2493.         user_silentkill(client);
  2494.         blind_player(client);
  2495.        
  2496.         ColorChat(client,"You cann't play when the game is running!");
  2497.        
  2498.         return;
  2499.     }
  2500.    
  2501.     PreparePlayer(client);
  2502.    
  2503.     g_powers[client][SPEED] = false;
  2504.     g_powers[client][INVISIBILITY] = false;
  2505.     g_powers[client][GRAVITY] = false;
  2506.     g_powers[client][NOHEGRENADE] = false;
  2507. }
  2508.  
  2509. public fw_HamPlayerKilled(victim, attacker, shouldgib){
  2510.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2511.         return;
  2512.    
  2513.     if (victim == infected && is_user_connected(victim))
  2514.     {
  2515.         fm_set_user_rendering(victim,kRenderFxNone,255,255,255,kRenderNormal,16);
  2516.         client_cmd(victim,"spk eTs/items/bb.wav");
  2517.        
  2518.        
  2519.        
  2520.         check_winner();
  2521.        
  2522.         last_two();
  2523.        
  2524.         blind_player(victim);
  2525.     }
  2526. }
  2527.  
  2528. public fw_HamTakeDamage(victim, idinflictor, attacker, Float:damage, damagebits, client, player, id){
  2529.    
  2530.    
  2531.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2532.         return HAM_IGNORED;
  2533.    
  2534.     if (is_user_alive(victim) && is_user_alive(attacker) &&  attacker == infected && victim != attacker)
  2535.     {
  2536.         if (g_powers[victim][NOHEGRENADE] && (damagebits & DMG_HEGRENADE))
  2537.             return HAM_SUPERCEDE;
  2538.        
  2539.        
  2540.        
  2541.         g_lasthit = attacker;
  2542.        
  2543.         make_user_statusicon(attacker,"dmg_bio",.status = STATUSICON_OFF);
  2544.        
  2545.        
  2546.         infect_player(victim,0);
  2547.         fm_set_user_rendering(attacker,kRenderFxNone,255,255,255,kRenderNormal,16);
  2548.        
  2549.         client_cmd(victim,"spk %s",g_infectesounds[random(MAX_INFECTE_SOUNDS)]);
  2550.        
  2551.         ColorChat(0, "^4%s ^1Hit ^3%s ^1In ^3[ ^4%.1f ^3]", get_player_name(g_lasthit),get_player_name(infected),  g_timer);
  2552.        
  2553.         cs_reset_user_model(attacker);
  2554.        
  2555.         return HAM_SUPERCEDE;
  2556.     }
  2557.     return HAM_SUPERCEDE;
  2558. }
  2559.  
  2560. public fw_ScoutCanDrop(entity){
  2561.     if (!get_pcvar_num(g_cvars[ENABLED]) ||!get_pcvar_num(g_cvars[SCOUTDROP]))
  2562.         return HAM_IGNORED;
  2563.    
  2564.     return HAM_SUPERCEDE;
  2565. }
  2566.  
  2567. public fw_M3CanDrop(entity){
  2568.     if (!get_pcvar_num(g_cvars[ENABLED]) ||!get_pcvar_num(g_cvars[M3DROP]))
  2569.         return HAM_IGNORED;
  2570.    
  2571.     return HAM_SUPERCEDE;
  2572. }
  2573.  
  2574. public fw_DeagleCanDrop(entity){
  2575.     if (!get_pcvar_num(g_cvars[ENABLED]) ||!get_pcvar_num(g_cvars[DeagleDROP]))
  2576.         return HAM_IGNORED;
  2577.        
  2578.     return HAM_SUPERCEDE;
  2579. }
  2580.  
  2581. public fw_FIVESEVENDROPCanDrop(entity){
  2582.     if (!get_pcvar_num(g_cvars[ENABLED]) ||!get_pcvar_num(g_cvars[FIVESEVENDROP]))
  2583.         return HAM_IGNORED;
  2584.        
  2585.     return HAM_SUPERCEDE;
  2586. }
  2587.  
  2588.  
  2589. public fw_HamPlayerJump(client){
  2590.     if (!get_pcvar_num(g_cvars[ENABLED]) ||!get_pcvar_num(g_cvars[NOSLOWDOWN]))
  2591.         return HAM_IGNORED;
  2592.    
  2593.     if (is_user_alive(client))
  2594.         set_pev(client,pev_fuser2,0.0);
  2595.    
  2596.     return HAM_IGNORED;
  2597. }
  2598.  
  2599. ////////////////
  2600. /// Events /////
  2601. ////////////////
  2602.  
  2603. public ActionEvent(event){
  2604.     g_round = 0;
  2605.     EventStarted = true;
  2606.    
  2607.     ExecuteForward(fwd_event,fwd_return,g_event);
  2608.    
  2609.     static players[32],pnum;
  2610.     get_players(players,pnum,"aceh","TERRORIST");
  2611.    
  2612.     switch(g_event)
  2613.     {
  2614.         case EVENT_KNIFE:
  2615.         {
  2616.             for (new i; i < pnum; i++)
  2617.             {
  2618.                 fm_strip_user_weapons(players[i]);
  2619.                 fm_give_item(players[i],"weapon_knife");
  2620.             }
  2621.         }
  2622.         case EVENT_AWP:
  2623.         {
  2624.             for (new i; i < pnum; i++)
  2625.             {
  2626.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  2627.                 show_dhudmessage(0,"AWP EVENT HAS BEEN STARTED");
  2628.                 fm_strip_user_weapons(players[i]);
  2629.                 fm_give_item(players[i],"weapon_awp");
  2630.                 cs_set_user_bpammo(players[i],CSW_AWP,256);
  2631.             }
  2632.         }
  2633.         case EVENT_MINIGUN:
  2634.         {
  2635.             for (new i; i < pnum; i++)
  2636.             {
  2637.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  2638.                 show_dhudmessage(0,"MINIGUN EVENT HAS BEEN STARTED");
  2639.                 CreateFog(random( 256 ), random( 256 ), random( 256 ),FOG_HIGH);
  2640.                 fm_strip_user_weapons(players[i]);
  2641.                 fm_give_item(players[i],"weapon_m249");
  2642.                 cs_set_user_bpammo(players[i],CSW_M249,2562);
  2643.                
  2644.             }
  2645.         }
  2646.         case EVENT_KNIFESMOKE:
  2647.         {
  2648.             for (new i; i < pnum; i++)
  2649.             {
  2650.                 set_dhudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.10,0,6.0,0.5,0.25,0.25);
  2651.                 show_dhudmessage(0,"HE EVENT HAS BEEN STARTED");
  2652.                 fm_strip_user_weapons(players[i]);
  2653.                 fm_give_item(players[i],"weapon_hegrenade");
  2654.                 cs_set_user_bpammo(players[i],CSW_HEGRENADE,2562);
  2655.             }
  2656.         }
  2657.        
  2658.        
  2659.     }
  2660.     set_task(4.0,"Infect_RandomPlayer");
  2661. }
  2662. //////////////////
  2663. /// Game Start ///
  2664. //////////////////
  2665.  
  2666. public Start_Game(){
  2667.     new client = get_randomplayer();
  2668.    
  2669.     GameStarted = true;
  2670.    
  2671.     last_two();
  2672.    
  2673.     if (client != -1 && get_playersnum() > 2)
  2674.     {
  2675.         g_round++;
  2676.        
  2677.         if (g_round == 6)
  2678.             ColorChat(0,"^3Random Event^1 will start next round!");
  2679.     }
  2680.    
  2681.     if (g_round == 7 && !g_lasttwo && get_playersnum() > 2)
  2682.     {
  2683.         ActionEvent(0);
  2684.         return;
  2685.     }
  2686.    
  2687.     infect_player(client,1);
  2688. }
  2689.  
  2690.  
  2691. public PreparePlayer(client){  
  2692.     fm_strip_user_weapons(client);
  2693.    
  2694.     fm_set_user_health(client,100);
  2695.    
  2696.     give_item(client,"weapon_knife");
  2697.     give_item(client,"weapon_scout");
  2698.    
  2699.     fm_give_item(client,"weapon_hegrenade");
  2700.     fm_give_item(client,"weapon_flashbang");
  2701.     fm_give_item(client,"weapon_flashbang");
  2702.     fm_give_item(client,"weapon_smokegrenade");
  2703.  
  2704.      
  2705.    
  2706.     if(playerlevel[client] >= 0)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 0);
  2707.     if(playerlevel[client] >= 1)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 1);
  2708.     if(playerlevel[client] >= 2)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 2);
  2709.     if(playerlevel[client] >= 3)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 3);
  2710.     if(playerlevel[client] >= 4)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 4);
  2711.     if(playerlevel[client] >= 5)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 5);
  2712.     if(playerlevel[client] >= 6)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 6);
  2713.     if(playerlevel[client] >= 7)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 7);
  2714.     if(playerlevel[client] >= 8)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 8);
  2715.     if(playerlevel[client] >= 9)       give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 9);
  2716.     if(playerlevel[client] >= 10)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 10);
  2717.     if(playerlevel[client] >= 11)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 11);
  2718.     if(playerlevel[client] >= 12)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 12);
  2719.     if(playerlevel[client] >= 13)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 13);
  2720.     if(playerlevel[client] >= 14)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 14);
  2721.     if(playerlevel[client] >= 15)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 15);
  2722.     if(playerlevel[client] >= 16)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 16);
  2723.     if(playerlevel[client] >= 17)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 17);
  2724.     if(playerlevel[client] >= 18)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 18);
  2725.     if(playerlevel[client] >= 19)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 19);
  2726.     if(playerlevel[client] >= 20)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 20);
  2727.     if(playerlevel[client] >= 21)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 21);
  2728.     if(playerlevel[client] >= 22)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 22);
  2729.     if(playerlevel[client] >= 23)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 23);
  2730.     if(playerlevel[client] >= 24)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 24);
  2731.     if(playerlevel[client] >= 25)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 25);
  2732.     if(playerlevel[client] >= 26)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 26);
  2733.     if(playerlevel[client] >= 27)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 27);
  2734.     if(playerlevel[client] >= 28)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 28);
  2735.     if(playerlevel[client] >= 29)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 29);
  2736.     if(playerlevel[client] >= 30)      give_item(client, "weapon_scout"), cs_set_user_bpammo(client, CSW_SCOUT, 30);
  2737.  
  2738.    
  2739.     if( Reset[client] >= 1 )
  2740.     {
  2741.         strip_user_weapons( client );
  2742.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2743.         cs_set_user_bpammo(client, CSW_FLASHBANG, 2);
  2744.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2745.     }
  2746.    
  2747.     if( Reset[client] >= 2 )
  2748.     {
  2749.         strip_user_weapons( client );
  2750.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2751.         cs_set_user_bpammo(client, CSW_FLASHBANG, 2);
  2752.         cs_set_user_bpammo(client, CSW_SMOKEGRENADE, 2);
  2753.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2754.         fm_give_item(client,"weapon_hegrenade");
  2755.         fm_give_item(client,"weapon_flashbang");
  2756.         fm_give_item(client,"weapon_flashbang");
  2757.         fm_give_item(client,"weapon_smokegrenade");
  2758.     }
  2759.    
  2760.     if( Reset[client] >= 3 )
  2761.     {
  2762.         strip_user_weapons( client );
  2763.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2764.         cs_set_user_bpammo(client, CSW_FLASHBANG, 2);
  2765.         cs_set_user_bpammo(client, CSW_HEGRENADE, 2);
  2766.         cs_set_user_bpammo(client, CSW_SMOKEGRENADE, 2);
  2767.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2768.         cs_set_weapon_ammo(give_item(client, "weapon_deagle"), 2);
  2769.         fm_give_item(client,"weapon_hegrenade");
  2770.         fm_give_item(client,"weapon_flashbang");
  2771.         fm_give_item(client,"weapon_flashbang");
  2772.         fm_give_item(client,"weapon_smokegrenade");
  2773.     }
  2774.    
  2775.     if( Reset[client] >= 4 )
  2776.     {
  2777.         strip_user_weapons( client );
  2778.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2779.         cs_set_user_bpammo(client, CSW_FLASHBANG, 3);
  2780.         cs_set_user_bpammo(client, CSW_HEGRENADE, 2);
  2781.         cs_set_user_bpammo(client, CSW_SMOKEGRENADE, 2);
  2782.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2783.         cs_set_weapon_ammo(give_item(client, "weapon_m3"), 2);
  2784.         fm_give_item(client,"weapon_hegrenade");
  2785.         fm_give_item(client,"weapon_flashbang");
  2786.         fm_give_item(client,"weapon_flashbang");
  2787.         fm_give_item(client,"weapon_smokegrenade");
  2788.     }
  2789.    
  2790.     if( Reset[client] >= 5 )
  2791.     {
  2792.         strip_user_weapons( client );
  2793.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2794.         cs_set_user_bpammo(client, CSW_FLASHBANG, 4);
  2795.         cs_set_user_bpammo(client, CSW_HEGRENADE, 2);
  2796.         cs_set_user_bpammo(client, CSW_SMOKEGRENADE, 2);
  2797.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2798.         cs_set_weapon_ammo(give_item(client, "weapon_m4a1"), 2);
  2799.         fm_give_item(client,"weapon_hegrenade");
  2800.         fm_give_item(client,"weapon_flashbang");
  2801.         fm_give_item(client,"weapon_flashbang");
  2802.         fm_give_item(client,"weapon_smokegrenade");
  2803.     }
  2804.    
  2805.     if( Reset[client] >= 6 )
  2806.     {
  2807.         strip_user_weapons( client );
  2808.         cs_set_weapon_ammo(give_item(client, "weapon_scout"), 10);
  2809.         cs_set_weapon_ammo(give_item(client, "weapon_knife"), 1);
  2810.         client_cmd(client,"eTsClientMode");
  2811.         fm_give_item(client,"weapon_hegrenade");
  2812.         fm_give_item(client,"weapon_flashbang");
  2813.         fm_give_item(client,"weapon_flashbang");
  2814.         fm_give_item(client,"weapon_smokegrenade");
  2815.            
  2816.     }
  2817.    
  2818.    
  2819.    
  2820.     if (pev(client,pev_weapons) & (1<<CSW_C4))
  2821.         engclient_cmd(client,"drop","weapon_c4");
  2822.    
  2823.     cs_reset_user_model(client);
  2824.    
  2825. }
  2826. public infect_player(client,rnd)
  2827. {
  2828.     if (!GameStarted || g_winner)
  2829.         return;
  2830.    
  2831.     if (!get_pcvar_num(g_cvars[ENABLED]))
  2832.         return;
  2833.     infected = client;
  2834.    
  2835.     if(!is_user_alive(infected))
  2836.     {
  2837.         set_hudmessage( 0, 85, 255, -2.0, 0.35, 1, 1.0, 5.0, 0.1, 0.1, -1 );
  2838.         show_hudmessage(0, "Trying again in 10 seconds");
  2839.         ColorChat(0,"^3Error: ^1there are not enough players. reconnecting in^3 10 ^1seconds.");
  2840.        
  2841.         GameStarted = false;
  2842.        
  2843.         set_task(10.0,"Event_RoundStart",GAMESTART_TASKID);
  2844.         return;
  2845.     }
  2846.    
  2847.     ExecuteForward(fwd_infected,fwd_return,infected);
  2848.    
  2849.    
  2850.     do_effect(infected,1);
  2851.    
  2852.     make_user_statusicon(infected,"dmg_bio",.status = STATUSICON_FLASH);
  2853.    
  2854.     MakeSickness();
  2855.    
  2856.    
  2857.  
  2858.     if(playerlevel[client] >= 0)       cs_set_user_model(infected,"AlienAngel");
  2859.     if(playerlevel[client] >= 20)       cs_set_user_model(infected,"AlienAngel");  
  2860.     if(playerlevel[client] >= 35)       cs_set_user_model(infected,"AlienAngel");  
  2861.     if(playerlevel[client] >= 45)       cs_set_user_model(infected,"AlienAngel");  
  2862.     if(get_user_flags(client) & ADMIN_LEVEL_C)       cs_set_user_model(infected,"AlienAngel");  
  2863.     if(get_user_flags(client) & ADMIN_IMMUNITY)       cs_set_user_model(infected,"AlienAngel");    
  2864.    
  2865.     //fm_set_user_rendering( infected, kRenderFxGlowShell,255,255,255);
  2866.    
  2867.    
  2868.     if (rnd)
  2869.     {
  2870.         set_dhudmessage( random( 256 ), random( 256 ), random( 256 ),-1.0,-1.0,0,6.0,10.0);    
  2871.         ColorChat(0,"^3%s^1 randomly ^4selected^1 to be ^3infected!",get_player_name(client));
  2872.        
  2873.         do_effect(infected,0);
  2874.        
  2875.         g_timer = 20.0;
  2876.         set_task(0.1,"ShowTimer",TIMER_TASKID,.flags="b");
  2877.        
  2878.         set_task(3.0,"TikTok",SOUNDS_TASKID);
  2879.         set_task(13.0,"Trrrrr",SOUNDS_TASKID);
  2880.     }
  2881.    
  2882.    
  2883. }
  2884.  
  2885. public TikTok() client_cmd(0,"mp3 play sound/eTs/items/alarm-thriller.mp3");
  2886.  
  2887. public Trrrrr() client_cmd(0,"mp3 play sound/eTs/items/Clock.mp3");
  2888.  
  2889. public Infect_RandomPlayer(){
  2890.     if (!GameStarted || is_user_alive(infected))
  2891.         return;
  2892.    
  2893.     new rnd = get_randomplayer();
  2894.     infect_player(rnd,1);
  2895. }
  2896.  
  2897.  
  2898. public ShowTimer(taskid,client,player){
  2899.    
  2900.     if (!GameStarted)
  2901.     {
  2902.         remove_task(TIMER_TASKID);
  2903.         return;
  2904.     }
  2905.    
  2906.     if (!is_user_connected(infected))
  2907.     {
  2908.         remove_task(TIMER_TASKID);
  2909.         set_task(4.0,"Infect_RandomPlayer");
  2910.         return;
  2911.     }
  2912.    
  2913.     if (g_timer < 0.1)
  2914.     {
  2915.        
  2916.         make_user_statusicon(infected,"dmg_bio",.status = STATUSICON_OFF);
  2917.        
  2918.         if (g_lasthit)
  2919.         {
  2920.             make_deathmsg(g_lasthit,infected,0,"");
  2921.             user_silentkill(infected);
  2922.            
  2923.             g_lasthit = 0;
  2924.         }
  2925.        
  2926.         else
  2927.             user_kill(infected,1);
  2928.        
  2929.         set_task(4.0,"Infect_RandomPlayer");
  2930.        
  2931.         remove_task(TIMER_TASKID);
  2932.         return;
  2933.     }
  2934.    
  2935.     set_dhudmessage(255, 85, 85,-1.0,0.68,1,0.0,0.12,0.0,0.0);
  2936.     show_dhudmessage(0,"Time Left: %.1f Seconds!",g_timer);
  2937.    
  2938.    
  2939.     set_hudmessage(random_num(1, 255),random_num(1, 255),random_num(1, 255),-1.0,0.71,1,0.0,0.12,0.0,0.0);
  2940.     show_hudmessage(0,"^n^"%s^" is infected",get_player_name(infected));
  2941.    
  2942.     g_timer-=0.1;
  2943. }    
  2944.  
  2945.  
  2946. public WinnerBeam1(index)
  2947. {
  2948.     new Float:Origin[ 3 ];
  2949.    
  2950.     entity_get_vector( index, EV_VEC_origin, Origin );
  2951.    
  2952.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0);
  2953.    
  2954.     write_byte( TE_SPRITETRAIL );
  2955.    
  2956.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  2957.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  2958.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] );
  2959.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  2960.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  2961.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] + 10 );
  2962.     write_short( WinnerBeamspr3 );
  2963.     write_byte( 30 );                       /* Count ( Number Of "Entities" ) */
  2964.     write_byte( 40 );                       /* Life Time */
  2965.     write_byte( 2 );                        /* Scale Size */
  2966.     write_byte( 55 );                       /* Velocity Along Vector */
  2967.     write_byte( 50 );                       /* Rendomness of Velocity */
  2968.     message_end( );
  2969.    
  2970.    
  2971.     entity_get_vector( index, EV_VEC_origin, Origin );
  2972.    
  2973.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0);
  2974.    
  2975.     write_byte( TE_SPRITETRAIL );
  2976.    
  2977.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  2978.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  2979.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] );
  2980.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  2981.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  2982.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] + 30 );
  2983.     write_short( WinnerBeamspr2 );
  2984.     write_byte( 25 );                       /* Count ( Number Of "Entities" ) */
  2985.     write_byte( 40 );                       /* Life Time */
  2986.     write_byte( 2 );                        /* Scale Size */
  2987.     write_byte( 55 );                       /* Velocity Along Vector */
  2988.     write_byte( 40 );                       /* Rendomness of Velocity */
  2989.     message_end( );
  2990.    
  2991.    
  2992.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0);
  2993.    
  2994.     write_byte( TE_SPRITETRAIL );
  2995.    
  2996.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  2997.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  2998.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] );
  2999.     engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
  3000.     engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
  3001.     engfunc( EngFunc_WriteCoord, Origin[ 2 ] + 30 );
  3002.     write_short( WinnerBeamspr );
  3003.     write_byte( 20 );                       /* Count ( Number Of "Entities" ) */
  3004.     write_byte( 30 );                       /* Life Time */
  3005.     write_byte( 2 );                        /* Scale Size */
  3006.     write_byte( 45 );                       /* Velocity Along Vector */
  3007.     write_byte( 40 );                       /* Rendomness of Velocity */
  3008.     message_end( );
  3009.    
  3010.    
  3011. }
  3012.  
  3013. public check_winner(){
  3014.     if (!get_pcvar_num(g_cvars[ENABLED]))
  3015.         return;
  3016.    
  3017.     static players[32],pnum;
  3018.     get_players(players,pnum,"aceh","TERRORIST");
  3019.    
  3020.     remove_task(TIMER_TASKID);
  3021.     remove_task(SOUNDS_TASKID);
  3022.    
  3023.     if (pnum == 1)
  3024.     {
  3025.         g_winner = players[0];
  3026.        
  3027.         ExecuteForward(fwd_win,fwd_return,g_winner);
  3028.        
  3029.         fm_set_lights("b");
  3030.        
  3031.         set_task(0.21,"WinnerBeam1",g_winner,.flags="b");
  3032.        
  3033.         set_task(15.0,"RestartGame");
  3034.        
  3035.         dance(g_winner);
  3036.         dance(g_winner);
  3037.  
  3038.         set_dhudmessage(0, 170, 255,-1.0,0.71,2,6.0,20.0);
  3039.         show_dhudmessage(0,"The winner is %s!",get_player_name(g_winner));
  3040.        
  3041.         new cash = (2 * get_playersnum());
  3042.         new xp = (10 * get_playersnum());
  3043.        
  3044.         if (EventStarted)
  3045.         {
  3046.             cash*=2;
  3047.             xp*=2;
  3048.         }
  3049.        
  3050.         playerxp[g_winner]+=cash;
  3051.         playercash[g_winner]+=cash;
  3052.         g_wins[g_winner]++;
  3053.        
  3054.         ColorChat(0,"Congratulations! The ^3winner^1%s is ^4%s^1!",(EventStarted ? " of the event":""),get_player_name(g_winner));
  3055.         ColorChat(0,"^3%s^1 won in ^4%i ^3xp^1 and ^4%i ^3cash^1 for winning the %s!",get_player_name(g_winner),cash,xp,(EventStarted ? "event":"game"));
  3056.        
  3057.         check_level(g_winner);
  3058.        
  3059.         client_cmd(0,"mp3 play sound/%s",g_winsounds[random(MAX_WIN_SOUNDS)]);
  3060.        
  3061.         set_task(15.0,"RestartGame");
  3062.        
  3063.        
  3064.         Event_RoundEnd();
  3065.         GameStarted = true;
  3066.        
  3067.         return;
  3068.     }  
  3069.     set_task(4.0,"Infect_RandomPlayer");
  3070.    
  3071. }      
  3072.  
  3073.  
  3074. public last_two(){
  3075.     static players[32],pnum;
  3076.     get_players(players,pnum,"aceh","TERRORIST");
  3077.    
  3078.     if (pnum == 2)
  3079.         g_lasttwo = true;
  3080. }
  3081.  
  3082. public RestartGame(){
  3083.     GameStarted = false;
  3084.     server_cmd("sv_restart 1");
  3085.     server_cmd("sv_restart 1");
  3086. }
  3087.  
  3088. public SaveData(id){
  3089.     if (!is_user_connected(id) || is_user_bot(id) || is_user_hltv(id))
  3090.         return;
  3091.    
  3092.     new SteamID[35];
  3093.     get_user_authid(id,SteamID,34);
  3094.    
  3095.     if(contain(SteamID,"_ID_LAN") != -1 || contain(SteamID,"STEAM_0:4") != -1 || contain(SteamID,"VALVE") != -1 || equali(SteamID,"STEAM_666:88:666"))
  3096.         get_user_ip(id,SteamID,34,1);
  3097.    
  3098.     new szData[40];
  3099.    
  3100.     g_totalrounds[id]+=g_rounds[id];
  3101.     g_totalwins[id]+=g_wins[id];
  3102.    
  3103.     formatex(szData,charsmax(szData),"%d %d %d %d %d %d",g_totalrounds[id],g_totalwins[id],playerlevel[id],playerxp[id],playercash[id], Reset[id]);
  3104.    
  3105.     fvault_set_data(g_szVault,SteamID,szData);
  3106. }
  3107.  
  3108. public LoadData(id){
  3109.     if (!is_user_connected(id) || is_user_bot(id) || is_user_hltv(id))
  3110.         return;
  3111.    
  3112.     new SteamID[35];
  3113.     get_user_authid(id, SteamID, 34);
  3114.    
  3115.     if(contain(SteamID,"_ID_LAN") != -1 || contain(SteamID,"STEAM_0:4") != -1 || contain(SteamID,"VALVE") != -1 || equali(SteamID,"STEAM_666:88:666"))
  3116.         get_user_ip(id,SteamID,34,1);
  3117.    
  3118.     new szData[40],szRounds[8],szWins[8],szLevel[8],szXp[8],szCash[8],szReset[8];
  3119.     if(fvault_get_data(g_szVault,SteamID,szData,charsmax(szData)))
  3120.     {
  3121.         parse(szData,szRounds,charsmax(szRounds),szWins,charsmax(szWins),szLevel,charsmax(szLevel),szXp,charsmax(szXp),szCash,charsmax(szCash), szReset, charsmax(szReset));
  3122.        
  3123.         g_totalrounds[id] = str_to_num(szRounds);
  3124.         g_totalwins[id] = str_to_num(szWins);
  3125.         playerlevel[id] = str_to_num(szLevel);
  3126.         playerxp[id] = str_to_num(szXp);
  3127.         playercash[id] = str_to_num(szCash);
  3128.         Reset[id] = str_to_num(szReset);
  3129.     }
  3130.    
  3131.     else
  3132.     {
  3133.         g_totalrounds[id] = 0;
  3134.         g_totalwins[id] = 0;
  3135.         playerlevel[id] = 0;
  3136.         playerxp[id] = 0;
  3137.         playercash[id] = 0;
  3138.         Reset[id] = 0;
  3139.     }
  3140.    
  3141.     g_wins[id] = 0;
  3142.     g_rounds[id] = 0;
  3143. }
  3144.  
  3145. //////////////
  3146. /// Stocks ///
  3147. //////////////
  3148.  
  3149.  
  3150. stock get_randomplayer(){
  3151.     static players[32],pnum;
  3152.     get_players(players,pnum,"aceh","TERRORIST");
  3153.    
  3154.     if (pnum < 2)
  3155.         return -1;
  3156.    
  3157.     return players[random(pnum)];
  3158. }
  3159.  
  3160. stock get_player_name(client){
  3161.     static szName[32];
  3162.     get_user_name(client,szName,31);
  3163.     return szName;
  3164. }
  3165.  
  3166. stock RemoveEntityAll(name[]){
  3167.     new ent = engfunc(EngFunc_FindEntityByString,0,"classname",name);
  3168.     new temp;
  3169.    
  3170.     while (ent)
  3171.     {
  3172.         temp = engfunc(EngFunc_FindEntityByString,ent,"classname",name);
  3173.         engfunc(EngFunc_RemoveEntity, ent);
  3174.         ent = temp;
  3175.     }
  3176.    
  3177.     log_amx("DEBUG: Entity ^"%s^" was removed from the map",name);
  3178. }
  3179.  
  3180. stock do_effect(index,type){
  3181.     static origin[3], srco[3];
  3182.     get_user_origin(index,origin);
  3183.    
  3184.     origin[2] -= 26;
  3185.     srco[0] = origin[0] + 150;
  3186.     srco[1] = origin[1] + 150;
  3187.     srco[2] = origin[2] + 400;
  3188.    
  3189.     switch(type)
  3190.     {
  3191.         case 0:
  3192.         {
  3193.             create_lightning(srco,origin);
  3194.             emit_sound(index,CHAN_ITEM,"ambience/thunder_clap.wav",1.0,ATTN_NORM,0,PITCH_NORM);
  3195.         }
  3196.        
  3197.         case 1: create_EarthQuake(index);
  3198.         }
  3199. }
  3200.  
  3201. stock check_level(client){
  3202.     if (!is_user_connected(client) || !get_pcvar_num(g_cvars[ENABLED]) || !get_pcvar_num(g_cvars[LEVELSYS]))
  3203.         return;
  3204.    
  3205.     if (playerlevel[client] == MAX_LEVELS)
  3206.         return;
  3207.    
  3208.     while (playerxp[client] > str_to_num(xps[playerlevel[client]]))
  3209.     {
  3210.         playerlevel[client]++;
  3211.         ColorChat(client,"Congratulations! You'r have level up! You'r new level is: ^4%i^1",playerlevel[client]);
  3212.         ColorChat(0,"^3%s^1 has level up to level ^4%i^1!",get_player_name(client),playerlevel[client]);
  3213.     }
  3214. }
  3215.  
  3216.  
  3217.  
  3218.  
  3219. stock fm_set_lights(const lights[])
  3220.     engfunc(EngFunc_LightStyle,0,lights);
  3221.  
  3222. stock bool:check_cash(client,amount)
  3223.     return (playercash[client] > amount ? true:false);
  3224.  
  3225. stock MakeSickness(){
  3226.     static Origin[3];
  3227.     get_user_origin(infected,Origin);
  3228.    
  3229.     message_begin(MSG_PVS,SVC_TEMPENTITY,Origin);
  3230.     write_byte(TE_IMPLOSION);
  3231.     write_coord(Origin[0]);
  3232.     write_coord(Origin[1]);
  3233.     write_coord(Origin[2]);
  3234.     write_byte(128);
  3235.     write_byte(20);
  3236.     write_byte(3);
  3237.     message_end();
  3238. }
  3239.  
  3240. stock create_lightning(vec1[3],vec2[3]){
  3241.     //Lightning
  3242.     message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3243.     write_byte(0);
  3244.     write_coord(vec1[0]);
  3245.     write_coord(vec1[1]);
  3246.     write_coord(vec1[2]);
  3247.     write_coord(vec2[0]);
  3248.     write_coord(vec2[1]);
  3249.     write_coord(vec2[2]);
  3250.     write_short(light);
  3251.     write_byte(1); // framestart
  3252.     write_byte(5);// framerate
  3253.     write_byte(2); // life
  3254.     write_byte(20); // width
  3255.     write_byte(30);// noise
  3256.     write_byte(200); // r, g, b
  3257.     write_byte(200); // r, g, b
  3258.     write_byte(200); // r, g, b
  3259.     write_byte(200); // brightness
  3260.     write_byte(200); // speed
  3261.     message_end();
  3262.    
  3263.     //Sparks
  3264.     message_begin(MSG_PVS,SVC_TEMPENTITY,vec2);
  3265.     write_byte(9);
  3266.     write_coord(vec2[0]);
  3267.     write_coord(vec2[1]);
  3268.     write_coord(vec2[2]);
  3269.     message_end();
  3270.    
  3271.     //Smoke
  3272.     message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2);
  3273.     write_byte(5);
  3274.     write_coord(vec2[0]);
  3275.     write_coord(vec2[1]);
  3276.     write_coord(vec2[2]);
  3277.     write_short(smoke);
  3278.     write_byte(10);
  3279.     write_byte(10);
  3280.     message_end();
  3281. }
  3282.  
  3283. stock create_EarthQuake(index){
  3284.     static msgScreenShake;
  3285.    
  3286.     if (!msgScreenShake)
  3287.         msgScreenShake = get_user_msgid("ScreenShake");
  3288.    
  3289.     message_begin(MSG_ONE,msgScreenShake,{0,0,0},index);
  3290.     write_short(255<<14); //ammount
  3291.     write_short(10<<14); //lasts this long
  3292.     write_short(255<<14); //frequency
  3293.     message_end();
  3294. }
  3295.  
  3296. ////////////////////////////////////////////
  3297. /// Thanks to Arkshine for this stock =] ///
  3298. ////////////////////////////////////////////
  3299. public CmdLoad(id)
  3300. {
  3301.     new sztData[ 100 ], szAuth[ 60 ];
  3302.     formatex(szAuth,charsmax(szAuth),"%s",GetAuth(id));
  3303.    
  3304.     if( !( fvault_get_data( szVault, szAuth, sztData, charsmax( sztData ) ) ) )
  3305.     {
  3306.         g_LevelBooster[ id ] = 0;
  3307.        
  3308.     }
  3309.     else
  3310.     {
  3311.         new gemsstr[ 5 ];
  3312.         parse( sztData, gemsstr, charsmax( gemsstr ));
  3313.        
  3314.         g_LevelBooster[ id ] = str_to_num( gemsstr );
  3315.        
  3316.     }
  3317.     if( !( fvault_get_data( szVault1, szAuth, sztData, charsmax( sztData ) ) ) )
  3318.     {
  3319.         g_MimiLevelBooster[ id ] = 0;
  3320.        
  3321.     }
  3322.     else
  3323.     {
  3324.         new gemsstr[ 5 ];
  3325.         parse( sztData, gemsstr, charsmax( gemsstr ));
  3326.        
  3327.         g_MimiLevelBooster[ id ] = str_to_num( gemsstr );
  3328.        
  3329.     }
  3330.    
  3331. }
  3332.  
  3333. stock CreateFog(iRed = 127,iGreen = 127,iBlue = 127,iDensity = 7){
  3334.     static msgFog;
  3335.    
  3336.     if (!msgFog)
  3337.         msgFog = get_user_msgid("Fog");
  3338.    
  3339.     // Fog density offsets [Thnx to DA]
  3340.     new const fog_density[] = { 0, 0, 0, 0, 111, 18, 3, 58, 111, 18, 125, 58, 66, 96, 27, 59, 90, 101, 60, 59, 90,
  3341.     101, 68, 59, 10, 41, 95, 59, 111, 18, 125, 59, 111, 18, 3, 60, 68, 116, 19, 60 };
  3342.    
  3343.     // Get the amount of density
  3344.     new dens;
  3345.     dens = (4 * iDensity);
  3346.    
  3347.     // The fog message
  3348.     message_begin(MSG_BROADCAST,msgFog,{0,0,0},0);
  3349.     write_byte(iRed); // Red
  3350.     write_byte(iGreen); // Green
  3351.     write_byte(iBlue); // Blue
  3352.     write_byte(fog_density[dens]); // SD
  3353.     write_byte(fog_density[dens + 1]); // ED
  3354.     write_byte(fog_density[dens + 2]); // D1
  3355.     write_byte(fog_density[dens + 3]); // D2
  3356.     message_end();
  3357. }
  3358.  
  3359. stock blind_player(index){
  3360.     message_begin(MSG_ONE,g_msgScreenFade,.player = index);
  3361.     write_short(1<<15);
  3362.     write_short(1<<10);
  3363.     write_short(1<<12);
  3364.     write_byte(0); // Red
  3365.     write_byte(0); // Green
  3366.     write_byte(0); // Blue
  3367.     write_byte(255); // Alpha
  3368.     message_end();
  3369. }
  3370.  
  3371.  
  3372.  
  3373. stock make_user_statusicon(index, const spr[], r = 0, g = 255, b = 255, status = STATUSICON_ON){
  3374.     static iconstatus;
  3375.    
  3376.     if (!iconstatus)
  3377.         iconstatus = get_user_msgid("StatusIcon");
  3378.    
  3379.     message_begin((index ? MSG_ONE:MSG_ALL),iconstatus,.player = index);
  3380.     write_byte(status); // status (0=hide, 1=show, 2=flash)
  3381.     write_string(spr); // sprite name
  3382.     write_byte(r); // red
  3383.     write_byte(g); // green
  3384.     write_byte(b); // blue
  3385.     message_end();
  3386. }
  3387. stock szName( const index )
  3388. {
  3389.     static mName[ 32 ];
  3390.    
  3391.     get_user_name( index, mName, charsmax( mName ) );
  3392.    
  3393.     return mName;
  3394. }
  3395. stock GetUserName( client )
  3396. {
  3397.     new szName[ 33 ];
  3398.    
  3399.     get_user_name( client, szName, charsmax( szName ) );
  3400.    
  3401.     return szName;
  3402. }
  3403.  
  3404. stock get_user_booster( const index )
  3405.     return g_LevelBooster[index];
  3406.  
  3407. stock set_user_booster( const index, Bosterr )
  3408. {
  3409.     if ( !is_user_connected( index ) )
  3410.         return 1;
  3411.    
  3412.     if ( Bosterr < 0 )
  3413.         Bosterr = 0;
  3414.    
  3415.     g_LevelBooster[ index ] = Bosterr;
  3416.    
  3417.     CmdSave( index );
  3418.    
  3419.     return 1;
  3420. }
  3421.  
  3422. public CmdSave(id)
  3423. {
  3424.     new szData[ 100 ],szAuth[ 60 ];
  3425.     formatex(szAuth,charsmax(szAuth),"%s",GetAuth(id));
  3426.    
  3427.     formatex( szData, charsmax( szData ), "%d", g_LevelBooster[ id ]);
  3428.     fvault_set_data( szVault,szAuth, szData );
  3429.    
  3430.     formatex( szData, charsmax( szData ), "%d", g_LevelBooster[ id ]);
  3431.     fvault_set_data( szVault1,szAuth, szData );
  3432.    
  3433.    
  3434.     return 1;
  3435. }
  3436.  
  3437. stock GetAuth( id )
  3438. {
  3439.     static szAuth[ 60 ];
  3440.     get_user_authid( id, szAuth, charsmax( szAuth ) );
  3441.     if( contain( szAuth, "VALVE_" ) != -1 || contain( szAuth, "ID_LAN" ) != -1 )
  3442.         get_user_ip( id, szAuth, charsmax( szAuth ), 1 );
  3443.     return szAuth;
  3444. }
  3445. stock GetUserAuth( index )
  3446. {
  3447. new iAuth[ 35 ];
  3448. get_user_authid( index, iAuth, sizeof iAuth -1 );
  3449.  
  3450. return iAuth;
  3451. }
  3452. stock ColorChat(const id,const string[],any:...){
  3453.     new msg[191], players[32], count = 1;
  3454.     static len; len = formatex(msg,charsmax(msg),"^3[^1eTs^3]^1 ");
  3455.     vformat(msg[len],charsmax(msg) - len,string,3);
  3456.    
  3457.     static msgSayText;
  3458.    
  3459.     if (!msgSayText)
  3460.         msgSayText = get_user_msgid("SayText");
  3461.    
  3462.     if(id)  players[0] = id;
  3463.     else    get_players(players,count,"ch");
  3464.    
  3465.     for (new i = 0; i < count; i++)
  3466.     {
  3467.         if(is_user_connected(players[i]))
  3468.         {
  3469.             message_begin(MSG_ONE_UNRELIABLE,msgSayText,.player = players[i]);
  3470.             write_byte(players[i]); // Sender ID
  3471.             write_string(msg); // String 1
  3472.             message_end();
  3473.         }
  3474.     }
  3475. }
  3476.  
  3477.  
  3478.  
  3479.  
  3480. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  3481. *{\\ rtf1\\ fbidis\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1037\\ f0\\ fs16 \n\\ par }
  3482. */
  3483. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  3484. *{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1037\\ f0\\ fs16 \n\\ par }
  3485. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top