[Modificare] Plugin VIP

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
hyperrr
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 17 Jul 2019, 06:50
Detinator Steam: Nu
CS Status: Ginko biloba, aloha, coca, sokeres, mota
Fond eXtream: 0

30 Jul 2019, 05:34

Buna ziua. Doresc si eu o modificare la acest plugin de vip. Mai exact sa adaugati si awp la meniul de vip gold atata, silverul sa ramana asa cum este + eventul de vip sa fie modificat intre orele 22:00 - 12:00 ziua, si la primul meniu adica cel cu pistoale cand iti da sa alegi un pistol, e o problema alegi deagle si iti da glock spre exemplu daca puteti remedia si problema asta, multumesc frumos
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>

//#include <sockets>
//#include <nvault>

#define PLUGIN "V.I.P CLASSIC"
#define VERSION "6.0"
#define AUTHOR "PedoBear"

new vipcmd;
new g_Round, g_Weapon[33];
new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk;
new vip_opened[33];
new pistols[6] = {CSW_USP, CSW_GLOCK18, CSW_ELITE, CSW_FIVESEVEN, CSW_P228, CSW_DEAGLE}
new bool: g_chosen[33] = false;

//Adaugare VIP
new File[120];
new bool: IsUserVip[33] = false;
new Trie: LoadVip;
new Pass;

//Multi Jump
new jumpnum[33], bool: dojump[33], cvar_addjump_vip, cvar_addjump_player;

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"*/}
new const secondaryWeapons[][] = {"weapon_p228", "weapon_elite", "weapon_fiveseven", "weapon_usp", "weapon_glock18", "weapon_deagle"}

enum cvars {
money_per_damage,
money_kill,
money_hs,
hp_kill,
hp_hs,
max_hp_kill
};
new cvar[cvars];

//Bullet damage
new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2;

//BuyZone V.I.P MENU
new bool:UserInBuyZone[33];
new i_Menu, i_Menu_Pistol;

//VIP Free
//#define VIP_FLAG read_flags("z")

new const vip_time[] = {00, 00};

new g_sync, cvar_freevip;
new vip_free = 0;

//Advertise PRET + VIPS
#define ADVERTISING_TIME 149.0

stock const messages[][] = {
"* Pentru a afla beneficiile vip-ului tasteaza in chat /vip !",
"* Pentru a afla vip-ii online tasteaza /vips !"
}

//Deactivated Maps
new bool:remove_vip = false

//Licenta
static const ServerLicensedIp[] = "109.163.232.111"; //Ip Oficial AVENGERS: 109.163.232.111
static const ServerLicensedIpTESTE[] = "109.163.232.111"; //Ip Server Teste: 109.163.232.111|| 109.163.232.111 || 109.163.232.111 || 109.163.232.111

public plugin_init()
{
server_print("^n%s v%s, Copyright (C)2019 by %s^n", PLUGIN, VERSION, AUTHOR)

register_plugin
(
.plugin_name = PLUGIN,
.version = VERSION,
.author = AUTHOR
);

new szIp[25];
get_user_ip(0, szIp, sizeof (szIp) -1, 1);
if(equal(szIp, ServerLicensedIp) || equal(szIp, ServerLicensedIpTESTE))
{
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)

register_event("HLTV", "round_start", "a", "1=0", "2=0")
register_logevent("LogEvent_RoundStart", 2, "1=Round_Start");
register_event("TextMsg", "round_restart", "a", "2=#Game_will_restart_in", "2=#Game_Commencing");

register_event("DeathMsg", "event_DeathMsg", "a");
register_event("StatusIcon", "Event_StatusIcon_Show_buyzone", "be", "1=1", "2=buyzone");
register_event("StatusIcon", "StatusIcon_buyzone_OFF", "be", "1=0", "2=buyzone");

//register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");

//RegisterHam(Ham_Item_PreFrame, "player", "player_maxspeed", 1);
//register_event("Damage", "Damage", "b");

//register_clcmd("vmenu", "main_menu")
register_clcmd("say /vipmenu", "arataMeniuVIPs");
register_clcmd("say_team /vipmenu", "arataMeniuVIPs");
register_clcmd("say /vm", "arataMeniuVIPs");
register_clcmd("say_team /vm", "arataMeniuVIPs");
register_clcmd("say /vmenu", "arataMeniuVIPs");
register_clcmd("say_team /vmenu", "arataMeniuVIPs");

register_clcmd("say /vip", "vip_info");
register_clcmd("say /wantvip", "vip_info");
register_clcmd("say /vreauvip", "vip_info");

register_clcmd("say", "hook_say");
register_clcmd("say_team", "hook_say");

register_clcmd("say /resetscore", "reset_score")
register_clcmd("say /restartscore", "reset_score")
register_clcmd("say /rs", "reset_score")
register_clcmd("say /rz", "reset_score")
register_clcmd("say !rs", "reset_score")

register_clcmd("say_team /resetscore", "reset_score")
register_clcmd("say_team /restartscore", "reset_score")
register_clcmd("say_team /rs", "reset_score")
register_clcmd("say_team /rz", "reset_score")
register_clcmd("say_team !rs", "reset_score")

register_clcmd("say /resetscoredead", "reset_score_dead")
register_clcmd("say /restartscoredead", "reset_score_dead")
register_clcmd("say /rsd", "reset_score_dead")
register_clcmd("say /rzd", "reset_score_dead")
register_clcmd("say !rsd", "reset_score_dead")

register_clcmd("say_team /resetscoredead", "reset_score_dead")
register_clcmd("say_team /restartscoredead", "reset_score_dead")
register_clcmd("say_team /rsd", "reset_score_dead")
register_clcmd("say_team /rzd", "reset_score_dead")
register_clcmd("say_team !rsd", "reset_score_dead")

//register_clcmd("say /pistoale", "first_menu");
//register_clcmd("say_team /pistoale", "first_menu");

cvar_round = register_cvar("vip_openmenu_round", "3")
cvar_open = register_cvar("vip_zaround", "1")
cvar_show = register_cvar("vip_showmenu", "1")
cvar_chat = register_cvar("vip_showchat", "1")
cvar_pistols = register_cvar("vip_auto_fill", "1")
cvar_funk = register_cvar("vip_taskmanager", "1")

cvar[hp_kill] = register_cvar("vip_receive_hp_kill", "10"); // 0 = dezactivat
cvar[hp_hs] = register_cvar("vip_receive_hp_hs", "20"); // 0 = dezactivat
cvar[money_kill] = register_cvar("vip_receive_money_kill", "250"); // 0 = dezactivat
cvar[money_hs] = register_cvar("vip_receive_money_hs", "500"); // 0 = dezactivat
cvar[max_hp_kill] = register_cvar("vip_receive_max_hp_kill", "120"); // valoarea maxima de hp pe care o poti obtine facand killuri

cvar[money_per_damage] = register_cvar("vip_money_per_damage", "3") //How many $ VIP will get per 1 damage -> nu functioneaza

//Multi Jump
cvar_addjump_vip = register_cvar("vip_cvar_addjump_vip", "1") // Are 1 salturi in plus
cvar_addjump_player = register_cvar("vip_cvar_addjump_player", "1") // Are 0 salt in plus

//V.I.P LIST
Pass = get_cvar_pointer("amx_password_field")
LoadVip = TrieCreate()
get_configsdir(File, charsmax(File))
format(File, charsmax(File), "%s/avengers-csone-vip/%s", File, "vip_list.ini")
new FilePointer, Key[32], Password[32], FileData[256]
if(!file_exists(File))
{
FilePointer = fopen(File, "w")
fclose(FilePointer)
}

FilePointer = fopen(File, "rt")
if(FilePointer)
{
while(!feof(FilePointer))
{
fgets(FilePointer, FileData, charsmax(FileData))
parse(FileData, Key, charsmax(Key), Password, charsmax(Password))
TrieSetString(LoadVip, Key, Password)
}
fclose(FilePointer)
}

//Map List
new path[64];
get_localinfo("amxx_configsdir", path, charsmax(path));
formatex(path, charsmax(path), "%s/avengers-hyperrr-vip/vip_maps.ini", path);

new file_maps = fopen(path, "r+");

if(!file_exists(path))
{
write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
}

new mapname[32];
get_mapname(mapname, charsmax(mapname));

new text[121], maptext[32];
while(!feof(file_maps))
{
fgets(file_maps, text, charsmax(text));
trim(text);

if(text[0] == ';' || !strlen(text))
continue;

parse(text, maptext, charsmax(maptext));

if(equal(maptext, mapname))
{
log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
remove_vip = true;
break;
}
}
fclose(file_maps);

//bullet damage
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
g_type = register_cvar("amx_bulletdamage", "3")
g_recieved = register_cvar("amx_bulletdamage_recieved", "1")

g_hudmsg1 = CreateHudSyncObj()
g_hudmsg2 = CreateHudSyncObj()

//VIP FREE
register_clcmd("say /timevip", "time_remain");

set_task(1.0, "check_time");
set_task(60.0, "check_time", _, _, _, "b");
set_task(1.0, "hud_mess", _, _, _, "b");

cvar_freevip = register_cvar("vip_free", "0");

cached_vars();
g_sync = CreateHudSyncObj();
//g_maxplayers = get_maxplayers();

//Advertise Message
set_task(ADVERTISING_TIME, "show_messages", _, _, _,"b");

//set_task(5.0, "_ProtectCheck_", 21412321, _,_, "b")
server_print("[%s] Felicitari! Detii o licenta valida, iar pluginul functioneaza perfect!", PLUGIN);
server_print("[%s] Pentru mai multe detalii y/m: ravravy@yahoo.com", PLUGIN);
server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);
}
else
{
new szPluginName[32];
formatex(szPluginName, sizeof(szPluginName) -1, "[IP Nelicentiat] %s", PLUGIN);
register_plugin(szPluginName, PLUGIN, "PedoBear");

server_print("[%s] Nu detii o licenta valabila! Plugin-ul nu va functiona corespunzator!", PLUGIN);
server_print("[%s] Pentru mai multe detalii Y!M: ravravy@yahoo.com", PLUGIN);
server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);

pause("ade");
}
}

//VIP SCOREBOARD
#define SCOREATTRIB_NONE 0
#define SCOREATTRIB_DEAD (1 << 0)
#define SCOREATTRIB_BOMB (1 << 1)
#define SCOREATTRIB_VIP (1 << 2)

public MessageScoreAttrib(iMsgID, iDest, iReceiver)
{
new iPlayer = get_msg_arg_int(1);
if(is_user_connected(iPlayer) && ((is_vip(iPlayer)) || has_flag(iPlayer, "t") || get_user_flags(iPlayer) & read_flags("y") || vip_free))
set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
}

//Advertise Mesaje
public show_messages()
{
new Buffer[256];
formatex(Buffer, sizeof Buffer - 1, "^x02%s", messages[random(sizeof messages)]);

new players[32], num, id;
get_players(players, num);

for(new i = 0 ; i < num ; i++)
{
id = players

message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
write_byte(id);
write_string(Buffer);
message_end();
}
}

public plugin_cfg()
if(get_pcvar_num(g_recieved))
g_showrecieved = true; //Checks of g_received is 1 and if so, sets g_showrecieved to true

public vip_info(id)
show_motd(id, "/addons/amxmodx/configs/vip_info.html");

public reset_score(id)
{
static name[32]
get_user_name(id, name, 31)

new frags = get_user_frags(id);
new deaths = get_user_deaths(id);

if(frags == 0 && deaths == 0)
{
chat_color(id, "!g[AVENGERS|RS]!t Ai scorul deja !y0 !g- !y0 !t!")
return PLUGIN_HANDLED
}
else
{
if(is_vip(id) || get_user_flags(id) & read_flags("y"))
{
for(new i = 0; i < 2; i++)
{
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}

chat_color(id, "!g[AVENGERS|RS]!t Scorul tau a fost resetat! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
}
else
{
for(new i = 0; i < 2; i++)
{
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}

chat_color(id, "!g[AVENGERS|RS]!t Scorul tau a fost resetat! Bafta la fraguri !g%s!t Have fun!", name)
}
}

return PLUGIN_HANDLED
}

public reset_score_dead(id)
{
if(!is_vip(id))
return PLUGIN_HANDLED

static name[32]
get_user_name(id, name, 31)

new deaths = get_user_deaths(id);

if(deaths == 0)
{
chat_color(id, "!g[AVENGERS|RS]!t Ai !gdeath-urile !tdeja !y0 !g- !y0 !t!")
return PLUGIN_HANDLED
}
else
{
for(new i = 0; i < 2; i++)
cs_set_user_deaths(id, 0);

if(is_vip(id))
chat_color(id, "!g[AVENGERS|RS - VIP]!t Dead-urile tale au fost resetate! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
}

return PLUGIN_HANDLED
}

public plugin_precache()
{
}

public bool:_get_vip(iPlugin, iParams)
{
new id = get_param(1);
if(is_vip(id) || has_flag(id, "y")) return true;

return false;
}

public native_vip_free(id) return vip_free

public on_damage(id)
{
if(g_enabled)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)

if(g_showrecieved && (is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_hudmsg2, "%i^n", damage)
}

if(is_user_connected(attacker) && (is_vip(attacker) || get_user_flags(attacker) & read_flags("y") || vip_free))
{
switch(g_enabled)
{
case 1:
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
case 2:
{
if(fm_is_ent_visible(attacker,id))
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
}
}
}
}
}

public client_authorized(id)
{
g_Weapon[id] = 0;

new Key[32], Password[32], OldPassword[32]
get_user_name(id, Key, charsmax(Key))
get_user_info(id, "_pw", Password, charsmax(Password))

if(TrieKeyExists(LoadVip, Key))
{
TrieGetString(LoadVip, Key, OldPassword, charsmax(OldPassword))
if(equal(Password, OldPassword))
IsUserVip[id] = true
else
{
server_cmd("kick #%i ^"Acest player are VIP!^"", get_user_userid(id))
IsUserVip[id] = false
}
}
}

public client_infochanged(id)
{
new oldname[32], newname[32], Password[32], OldPassword[32], PasswordField[5]
get_user_name(id, oldname, charsmax(oldname))
get_user_info(id, "name", newname, charsmax(newname))

if(equal(newname, oldname))
return

if(TrieKeyExists(LoadVip, newname))
{
get_pcvar_string(Pass, PasswordField, charsmax(PasswordField))
get_user_info(id, PasswordField, OldPassword, charsmax(OldPassword))
TrieGetString(LoadVip, newname, Password, charsmax(Password))

if(equal(OldPassword, Password))
IsUserVip[id] = true
else
{
server_cmd("kick #%i ^"NU esti VIP!^"", get_user_userid(id))
IsUserVip[id] = false
}
}
else
IsUserVip[id] = false
}

public plugin_end()
TrieDestroy(LoadVip)

public client_putinserver(id)
{
new xP[32], xN
get_players(xP, xN, "c")
for (new i=0; i< xN; i++)
{
if(!is_user_connected(xP))
continue

client_cmd(xP, "cl_minmodels 0")
}

//JUMP
jumpnum[id] = 0
dojump[id] = false

/*if(vip_free && !(get_user_flags(id) & read_flags("x") && !(get_user_flags(id) & read_flags("y"))))
{
new flags = get_user_flags(id);
flags |= VIP_FLAG
set_user_flags(id, flags);
}*/

if(is_vip(id) || get_user_flags(id) & read_flags("y"))
{
new name[33];
get_user_name(id, name, charsmax(name));
//chat_color(0, "!g[AVENGERS.CSONE.RO]!t VIP-ul [!g%s!t] se conecteaza pe server...", name);
}

//set_task(0.9, "vip_menu", id);
return PLUGIN_CONTINUE;
}

//VIP FREE
public cached_vars()
vip_free = get_pcvar_num(cvar_freevip);

public check_time()
{
new o;
time(o, _, _);

if(!vip_free)
{
if(o >= vip_time[22] || o < vip_time[12])
{
vip_free = 1;
set_pcvar_num(cvar_freevip, 1);
chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost activat!");
}
}
else
{
if(o < vip_time[22] && o >= vip_time[12])
{
vip_free = 0;
set_pcvar_num(cvar_freevip, 0);
chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost dezactivat!");
}
}
}

public time_remain(id)
{
if(vip_free)
chat_color(id, "^4[^3AVENGERS.CSONE.RO^4]^1 Timp ramas pana se termina vip-ul free^3 %s", time_left_vip());
else if(!vip_free)
chat_color(id, "^4[^3AVENGERS.CSONE.RORO^4]^1 Timp ramas pana incepe vip-ul free^3 %s", time_left_vip());
}

public hud_mess()
{
if(!vip_free)
return;

set_hudmessage(random(256), random(256), random(256), 0.00, 0.17, 0, 1.1, 1.0);
ShowSyncHudMsg(0, g_sync, "TS.CSONE.RO - CANALUL AVENGERS");
}

stock time_left_vip()
{
new timp_ramas[16], len = 0;
new h, m, lh, lm;
time(h, m, _);
switch(vip_free)
{
case 0: lh = vip_time[0] - h;
case 1:
{
new l = vip_time[1];
if(h > l)
l += add_time(h) + h;
lh = l - h;
}
}
lm = 60 - m;
if(lm < 60)
lh--;

if(lh > 0)
len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, "%d or%s", lh, lh == 1 ? "a" : "e");

if(lm < 60)
len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, " %d minut%s", lm, lm == 1 ? "" : "e");

return timp_ramas;
}

stock add_time(x)
{
new j;
switch(x)
{
case 0: j = 24;
case 1: j = 23;
case 2: j = 22;
case 3: j = 21;
case 4: j = 20;
case 5: j = 19;
case 6: j = 18;
case 7: j = 17;
case 8: j = 16;
case 9: j = 15;
case 10: j = 14;
case 11: j = 13;
case 12: j = 12;
case 13: j = 11;
case 14: j = 10;
case 15: j = 9;
case 16: j = 8;
case 17: j = 7;
case 18: j = 6;
case 19: j = 5;
case 20: j = 4;
case 21: j = 3;
case 22: j = 2;
case 23: j = 1;
}
if(x < vip_time[1])
j = 0;

return j;
}

public plugin_natives()
{
set_native_filter("native_filter")
register_native("get_vip", "_get_vip", 0)
register_native("free_vip", "native_vip_free", 0)

//register_native("get_map_disabled", "map_disabled", 0)
//register_native("check_map_disabled", "check_map", 0)
}

public map_disabled() return remove_vip

public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false

remove_task(id)
g_Weapon[id] = 0;
g_chosen[id] = false;
IsUserVip[id] = false
}

public client_PreThink(id)
{
if(remove_vip)
return;

if(!is_user_alive(id))
return

new BUTON = get_user_button(id)
new OLDBUTON = get_user_oldbutton(id)
new JUMP_VIP = get_pcvar_num(cvar_addjump_vip)
new JUMP_PLAYER = get_pcvar_num(cvar_addjump_player)

if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
{
if(((is_vip(id)) && (jumpnum[id] < JUMP_VIP)) || (!(is_vip(id)) && (jumpnum[id] < JUMP_PLAYER)) || vip_free && (jumpnum[id] < JUMP_VIP))
{
dojump[id] = true
jumpnum[id]++
}
}

if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
jumpnum[id] = 0
}

public client_PostThink(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE

if(dojump[id] == true)
{
new Float: velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
velocity[2] = random_float(265.0, 285.0)
entity_set_vector(id, EV_VEC_velocity, velocity)
dojump[id] = false
}

return PLUGIN_CONTINUE
}

public round_start()
{
if(!remove_vip)
{
g_Round++
vipcmd = 1;
}

//bullet damage
g_enabled = get_pcvar_num(g_type)
if(get_pcvar_num(g_recieved)) g_showrecieved = true
}

public LogEvent_RoundStart(id)
if(!remove_vip)
UserInBuyZone[id] = true;

public round_restart()
{
if(remove_vip)
return;

g_Round = 0
}

public player_maxspeed(id)
{
if(is_vip(id) && is_user_alive(id) && is_user_connected(id))
set_user_maxspeed(id, 450.0);

return PLUGIN_HANDLED
}

public player_spawn(Player)
{
if(remove_vip)
return HAM_IGNORED;

vip_opened[Player] = 0;
if((is_vip(Player) || (has_flag(Player, "y") || vip_free) && is_user_alive(Player) && is_user_connected(Player)))
{
UserInBuyZone[Player] = true;

if(g_Weapon[Player] == 0)
first_menu(Player)

if(get_pcvar_num(cvar_funk) )
task_funk(Player);

if(get_pcvar_num(cvar_show) && g_Round >= get_pcvar_num(cvar_round))
main_menu(Player);
}

return PLUGIN_HANDLED;
}

public arataMeniuVIPs(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED
}

if(is_vip(id) || has_flag(id, "y") || vip_free)
{
if(is_user_alive(id) && is_user_connected(id))
{
if(vipcmd == 0)
{
main_menu(id)
chat_color(id, "!g[VIP MENU]!t Aceasta comanda o poti folosi doar odata pe runda. Scuzele noastre! !g:)!t")
}
else
{
vipcmd = 0
}
}
else
chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi folosita doar daca esti in viata!")
}
else
chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi utilizata doar de catre VIP")

return PLUGIN_HANDLED;
}

public task_funk(id)
{
if(vip_free && !is_vip(id))
{
give_item(id, "weapon_knife")
give_item(id, "item_thighpack")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "item_assaultsuit")
}
else if(is_vip(id) && (vip_free || !vip_free))
{
give_item(id, "weapon_knife")
give_item(id, "item_thighpack")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "item_assaultsuit")
}

if(get_pcvar_num(cvar_pistols))
{
for(new i = 0;i <6;i++)
fm_strip_user_gun(id, pistols)

switch(g_Weapon[id])
{
case 1:
{
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
give_item(id, "weapon_usp");
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
give_item(id, "weapon_glock18");
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}
}
}

/* Meniurile cu arme *** */
public main_menu(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED;
}

if(is_user_alive(id))
{
if(vip_opened[id] < get_pcvar_num(cvar_open) || get_pcvar_num(cvar_open) )
{
if(g_Round >= get_pcvar_num(cvar_round))
{
new s_Title[64], s_Name[32], s_Pistol[32], szMenuMulti[64]
get_user_name(id, s_Name, charsmax(s_Name))
switch(g_Weapon[id])
{
case 0: s_Pistol = "Fara Pistol!";
case 1: s_Pistol = "Deagle";
case 2: s_Pistol = "Usp";
case 3: s_Pistol = "Glock";
}

formatex(s_Title, charsmax(s_Title), "VIP System [AVENGERS.CSONE.RO]", s_Name)
i_Menu = menu_create(s_Title, "main_handler", 1);

formatex(szMenuMulti, charsmax(szMenuMulti), "M4A1 + %s + Grenade", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "1", 0)

formatex(szMenuMulti, charsmax(szMenuMulti), "AK47 + %s + Grenade", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "2", 0)

if(is_vip(id))
{
//formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + %s + Grenade (Terrorist)", s_Pistol)
//menu_additem(i_Menu, szMenuMulti, "4", 0)

//formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + %s + Grenade (Counter-Terrorist)", s_Pistol)
//menu_additem(i_Menu, szMenuMulti, "5", 0)
}
else if(!is_vip(id) || !has_flag(id, "x"))
{
//formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + [PISTOL] + Grenade \r[GOLD ONLY]")
//menu_additem(i_Menu, szMenuMulti, "4", ADMIN_ADMIN)

//formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + [PISTOL] + Grenade \r[GOLD ONLY]")
//menu_additem(i_Menu, szMenuMulti, "5", ADMIN_ADMIN)
}

/*if(vip_opened[id] && g_Weapon[id] && g_chosen[id])
{
formatex(szMenuMulti, charsmax(szMenuMulti), "<<< Primul Meniu (Pistoale)")
menu_additem(i_Menu, szMenuMulti, "6", 0)
}*/

formatex(szMenuMulti, charsmax(szMenuMulti), "\y<<< \rPrimul Meniu \y(\wPistoale\y)")
menu_additem(i_Menu, szMenuMulti, "6", 0)

//g_chosen[id] = false;
//vip_opened[id] = 0;
//g_Weapon[id] = 0;

menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, i_Menu, 0)
}
else
{
if(get_pcvar_num(cvar_round))
{
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
return PLUGIN_HANDLED;
}
else
{
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
return PLUGIN_HANDLED;
}
}
}
else
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Sincer... ceva nu merge bine. Contacteaza-ne pe !gwww.EPIC-GAMERS.ro/forum")
}
else
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Esti mort... nu poti folosi meniul!")
//else
//chat_color(id, "!g[AVENGERS.CSONE.RO]!t Nu esti !gVIP!t. Foloseste comanda !g/help!t pentru afisare detalii")

return PLUGIN_HANDLED;
}

public main_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}

if(!is_user_alive(id) && !is_user_connected(id))
return PLUGIN_HANDLED;

new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)
new name[32]
get_user_name(id, name, charsmax(name))

switch(g_Weapon[id])
{
case 0:
{
first_menu(id);
menu_destroy(menu);
}
case 1:
{
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
if(pev(id, pev_weapons) & 1 << CSW_GLOCK18)
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}

switch(i_Key)
{
case 1:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[AVENGERS.CSONE.RO]!t VIP-ul !g%s!t a primit M4A1 gratuit + !gGrenade", name)
}
case 2:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[AVENGERS.CSONE.RO]!t VIP-ul !g%s!t a primit Ak47 gratuit + !gGrenade", name)
}

case 3:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[RELAX.EPIC-GAMERS.RO]!t VIP-ul !g%s!t a primit G3SG1 (D3/AU-1) gratuit + !gGrenade", name)
}
case 4:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons[i])

give_item(id, "weapon_sg550")
cs_set_user_bpammo(id, CSW_SG550, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[AVENGERS.CSONE.RO]!t VIP-ul !g%s!t a primit SG550 (Counter-Terorist) gratuit + !gGrenade", name)
}
case 5:
{
g_chosen[id] = false;
vip_opened[id] = 0;
g_Weapon[id] = 0;
first_menu(id);
}
}

//menu_destroy(menu);
return PLUGIN_CONTINUE;
}

public first_menu(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED;
}

if(remove_vip)
return PLUGIN_HANDLED;

if(!is_user_connected(id))
return PLUGIN_HANDLED;

i_Menu_Pistol = menu_create("Ce pistol doresti?", "first_menu_handler")

menu_additem(i_Menu_Pistol, "Deagle [35 Gloante]", "1", 0)
menu_additem(i_Menu_Pistol, "USP [100 Gloante]", "2", 0)
menu_additem(i_Menu_Pistol, "Glock [120 Gloante]", "3", 0)

menu_setprop(i_Menu_Pistol, MPROP_EXIT, MEXIT_ALL);
menu_display(id, i_Menu_Pistol, 0)

return PLUGIN_HANDLED;
}

public first_menu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)

for(new i = 0;i <6;i++)
fm_strip_user_gun(id, pistols[i])

switch(i_Key)
{
case 1:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons[i])
}

g_chosen[id] = true;
g_Weapon[id] = 1;
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons[i])
}

g_chosen[id] = true;
g_Weapon[id] = 2;
give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons[i])
}

g_chosen[id] = true;
g_Weapon[id] = 3;
give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}

//menu_destroy(menu);
return PLUGIN_CONTINUE;
}

stock get_vips_online()
{
new players[32], pnum, vs, i, userid
get_players(players, pnum, "ch")

for(i = 0; i < pnum; i++)
{
userid = players[i]

if(!(is_vip(userid)))
continue;

vs ++;
}

return vs
}

stock chat_message(index, const message[], any:...)
{
new sBuffer[256], dest
vformat(sBuffer[1], charsmax(sBuffer), message, 3)

sBuffer[0] = '^1'

replace_all(sBuffer[1], charsmax(sBuffer), "!y", "^1")
replace_all(sBuffer[1], charsmax(sBuffer), "!t", "^3")
replace_all(sBuffer[1], charsmax(sBuffer), "!g", "^4")

sBuffer[192] = '^0'

if(index)
{
dest = MSG_ONE_UNRELIABLE
}
else
{
dest = MSG_BROADCAST
}

message_begin(dest, get_user_msgid("SayText"), {0, 0, 0}, index)
write_byte(index)
write_string(sBuffer)
message_end()
}

/*public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
if(get_user_flags(id) & VIP_FLAG) //Checks if player is VIP
{
new money = read_data(2) * get_pcvar_num(cvar[money_hs]
if(hitpoint==1) money += get_pcvar_num(cvar[money_hs] //Checks if player damages enemy by head shot
cs_set_user_money(attacker,cs_get_user_money(attacker) + money) //Gives money for damaging enemys
}
}*/

public event_DeathMsg()
{
if(remove_vip)
return PLUGIN_HANDLED;

new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
new hp = headshot ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
new money = headshot ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);

if(is_vip(victim))
if(!g_chosen[victim])
set_task(1.0, "first_menu", victim)

if(is_user_alive(killer) && (is_vip(killer) || get_user_flags(killer) & read_flags("y") || vip_free))
{
if(killer == victim) return PLUGIN_HANDLED;
if(hp != 0) set_user_health(killer, clamp(get_user_health(killer) + hp, 1, get_pcvar_num(cvar[max_hp_kill])));
if(money != 0) cs_set_user_money(killer, clamp(cs_get_user_money(killer) + money - 300, 1, 16000));

set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(killer, "Healed +%d HP", hp);

message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, killer);
write_short(1<<10);
write_short(1<<10);
write_short(0x0000);
write_byte(0);
write_byte(0);
write_byte(200);
write_byte(75);
message_end();
}

return PLUGIN_CONTINUE;
}

public hook_say(id)
{
/*static szAllArgs[1023];
read_args(szAllArgs, charsmax(szAllArgs))
if((containi(szAllArgs, "/vip")!= -1 || containi(szAllArgs, "/vips")!= -1))
return PLUGIN_HANDLED;*/

new said[192];
read_args(said,192);
if(contain(said, "/vips") != -1)
set_task(0.1,"check_vips",id);

return PLUGIN_CONTINUE;
}

public check_vips(id)
{
new sBuffer[128], sVipname[32], sSlots[34], userid, vs, i

formatex(sBuffer, charsmax(sBuffer), "!t[-!gV!tI!gP's!t-] !gOnline: ")

new z;
if((z = get_vips_online()))
{
new players[32], pnum
get_players(players, pnum, "ch")

for(i = 0; i < pnum; i++)
{
userid = players[i]

if(!(is_vip(userid)))
continue;

vs ++;
get_user_name(userid, sVipname, charsmax(sVipname))
formatex(sSlots, charsmax(sSlots), "!t%s!g%s", sVipname, z == vs ? ".":", ")
add(sBuffer, charsmax(sBuffer), sSlots)
}
}
else if(!get_vips_online())
{
add(sBuffer, charsmax(sBuffer), "!tThere is no vip's !gOnline!")
}

chat_message(id, sBuffer)
}

public print_adminlist(user)
{
new adminnames[33][32];
new message[256];
new id, count, x, len;

for(id = 1 ; id <= get_maxplayers() ; id++)
if(is_user_connected(id))
if(is_vip(id) || get_user_flags(id) & read_flags("y"))
get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));

len = format(message, 255, "^1VIP-ii online sunt:^4 ");
if(count > 0)
{
for(x = 0 ; x < count ; x++)
{
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
if(len > 96)
{
print_message(user, message);
len = format(message, 255, " ");
}
}
print_message(user, message);
}
else
chat_color(id, "!g[CS - VIP]!t ^1Nu sunt ^4VIP^1-i online.")

return PLUGIN_CONTINUE;
}

public StatusIcon_buyzone_OFF(id)
{
if(!remove_vip)
{
UserInBuyZone[id] = false;
CheckMenuClose(id);
}
}

public Event_StatusIcon_Show_buyzone(id)
if((is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
UserInBuyZone[id] = true;

CheckMenuClose(id)
{
new oldMenuId, newMenuId;
player_menu_info(id, oldMenuId, newMenuId)
if(newMenuId > -1 && newMenuId == i_Menu || newMenuId > -1 && newMenuId == i_Menu_Pistol)
menu_cancel(id);
}

print_message(id, msg[])
{
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
write_byte(id);
write_string(msg);
message_end();
}

stock bool: is_vip(const id)
{
if(!is_user_connected(id))
return false;

if(IsUserVip[id] || get_user_flags(id) & read_flags("x")) /*|| equali(name, "seven|sin")|| equali(name, "PedoBear"))*/
return true;

return false;
}

stock chat_color(const id, const input[], any:...)
{
new count = 1, Jucatori[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")//Culoarea Verde
replace_all(msg, 190, "!y", "^1")//Culoarea Normala a Chat-ului (galben)
replace_all(msg, 190, "!t", "^3")//Culoarea Echipei : CT = Albastru | T = Rosu.

if (id)Jucatori[0] = id;else get_players(Jucatori, count, "ch")
{
for (new Y = 0;Y <count;Y++)
{
if (is_user_connected(Jucatori[Y]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Jucatori[Y])
write_byte(Jucatori[Y]);
write_string(msg);
message_end();
}
}
}
}


P.S: ma scuzati daca sunt reclame in vip..
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
hyperrr
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 17 Jul 2019, 06:50
Detinator Steam: Nu
CS Status: Ginko biloba, aloha, coca, sokeres, mota
Fond eXtream: 0

02 Aug 2019, 05:38

UP !! Chiar nimeni ?
User avatar
Gheorghe_cs16
Membru, skill +2
Membru, skill +2
Posts: 547
Joined: 16 May 2018, 03:31
Detinator Steam: Da
CS Status: You are Noob?
SteamID: Privat
Fond eXtream: 0
Location: AREA 51
Has thanked: 13 times
Been thanked: 3 times
Contact:

02 Aug 2019, 12:38

NU L-AM TESTAT DAR INCEARCAL :) si ti-am am bagat awp
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>

//#include <sockets>
//#include <nvault>

#define PLUGIN "V.I.P CLASSIC"
#define VERSION "6.0"
#define AUTHOR "PedoBear"

new vipcmd;
new g_Round, g_Weapon[33];
new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk;
new vip_opened[33];
new pistols[6] = {CSW_USP, CSW_GLOCK18, CSW_ELITE, CSW_FIVESEVEN, CSW_P228, CSW_DEAGLE}
new bool: g_chosen[33] = false;

//Adaugare VIP
new File[120];
new bool: IsUserVip[33] = false;
new Trie: LoadVip;
new Pass;

//Multi Jump
new jumpnum[33], bool: dojump[33], cvar_addjump_vip, cvar_addjump_player;

new const primaryWeapons[][] = {"weapon_shield", "weapon_awp", "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"*/}
new const secondaryWeapons[][] = {"weapon_p228", "weapon_elite", "weapon_fiveseven", "weapon_usp", "weapon_glock18", "weapon_deagle"}

enum cvars {
money_per_damage,
money_kill,
money_hs,
hp_kill,
hp_hs,
max_hp_kill
};
new cvar[cvars];

//Bullet damage
new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2;

//BuyZone V.I.P MENU
new bool:UserInBuyZone[33];
new i_Menu, i_Menu_Pistol;

//VIP Free
//#define VIP_FLAG read_flags("z")

new const vip_time[] = {22, 12};

new g_sync, cvar_freevip;
new vip_free = 0;

//Advertise PRET + VIPS
#define ADVERTISING_TIME 149.0

stock const messages[][] = {
"* Pentru a afla beneficiile vip-ului tasteaza in chat /vip !",
"* Pentru a afla vip-ii online tasteaza /vips !"
}

//Deactivated Maps
new bool:remove_vip = false

//Licenta
static const ServerLicensedIp[] = "109.163.232.111"; //Ip Oficial AVENGERS: 109.163.232.111
static const ServerLicensedIpTESTE[] = "109.163.232.111"; //Ip Server Teste: 109.163.232.111|| 109.163.232.111 || 109.163.232.111 || 109.163.232.111

public plugin_init()
{
server_print("^n%s v%s, Copyright (C)2019 by %s^n", PLUGIN, VERSION, AUTHOR)

register_plugin
(
.plugin_name = PLUGIN,
.version = VERSION,
.author = AUTHOR
);

new szIp[25];
get_user_ip(0, szIp, sizeof (szIp) -1, 1);
if(equal(szIp, ServerLicensedIp) || equal(szIp, ServerLicensedIpTESTE))
{
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)

register_event("HLTV", "round_start", "a", "1=0", "2=0")
register_logevent("LogEvent_RoundStart", 2, "1=Round_Start");
register_event("TextMsg", "round_restart", "a", "2=#Game_will_restart_in", "2=#Game_Commencing");

register_event("DeathMsg", "event_DeathMsg", "a");
register_event("StatusIcon", "Event_StatusIcon_Show_buyzone", "be", "1=1", "2=buyzone");
register_event("StatusIcon", "StatusIcon_buyzone_OFF", "be", "1=0", "2=buyzone");

//register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");

//RegisterHam(Ham_Item_PreFrame, "player", "player_maxspeed", 1);
//register_event("Damage", "Damage", "b");

//register_clcmd("vmenu", "main_menu")
register_clcmd("say /vipmenu", "arataMeniuVIPs");
register_clcmd("say_team /vipmenu", "arataMeniuVIPs");
register_clcmd("say /vm", "arataMeniuVIPs");
register_clcmd("say_team /vm", "arataMeniuVIPs");
register_clcmd("say /vmenu", "arataMeniuVIPs");
register_clcmd("say_team /vmenu", "arataMeniuVIPs");

register_clcmd("say /vip", "vip_info");
register_clcmd("say /wantvip", "vip_info");
register_clcmd("say /vreauvip", "vip_info");

register_clcmd("say", "hook_say");
register_clcmd("say_team", "hook_say");

register_clcmd("say /resetscore", "reset_score")
register_clcmd("say /restartscore", "reset_score")
register_clcmd("say /rs", "reset_score")
register_clcmd("say /rz", "reset_score")
register_clcmd("say !rs", "reset_score")

register_clcmd("say_team /resetscore", "reset_score")
register_clcmd("say_team /restartscore", "reset_score")
register_clcmd("say_team /rs", "reset_score")
register_clcmd("say_team /rz", "reset_score")
register_clcmd("say_team !rs", "reset_score")

register_clcmd("say /resetscoredead", "reset_score_dead")
register_clcmd("say /restartscoredead", "reset_score_dead")
register_clcmd("say /rsd", "reset_score_dead")
register_clcmd("say /rzd", "reset_score_dead")
register_clcmd("say !rsd", "reset_score_dead")

register_clcmd("say_team /resetscoredead", "reset_score_dead")
register_clcmd("say_team /restartscoredead", "reset_score_dead")
register_clcmd("say_team /rsd", "reset_score_dead")
register_clcmd("say_team /rzd", "reset_score_dead")
register_clcmd("say_team !rsd", "reset_score_dead")

//register_clcmd("say /pistoale", "first_menu");
//register_clcmd("say_team /pistoale", "first_menu");

cvar_round = register_cvar("vip_openmenu_round", "3")
cvar_open = register_cvar("vip_zaround", "1")
cvar_show = register_cvar("vip_showmenu", "1")
cvar_chat = register_cvar("vip_showchat", "1")
cvar_pistols = register_cvar("vip_auto_fill", "1")
cvar_funk = register_cvar("vip_taskmanager", "1")

cvar[hp_kill] = register_cvar("vip_receive_hp_kill", "10"); // 0 = dezactivat
cvar[hp_hs] = register_cvar("vip_receive_hp_hs", "20"); // 0 = dezactivat
cvar[money_kill] = register_cvar("vip_receive_money_kill", "250"); // 0 = dezactivat
cvar[money_hs] = register_cvar("vip_receive_money_hs", "500"); // 0 = dezactivat
cvar[max_hp_kill] = register_cvar("vip_receive_max_hp_kill", "120"); // valoarea maxima de hp pe care o poti obtine facand killuri

cvar[money_per_damage] = register_cvar("vip_money_per_damage", "3") //How many $ VIP will get per 1 damage -> nu functioneaza

//Multi Jump
cvar_addjump_vip = register_cvar("vip_cvar_addjump_vip", "1") // Are 1 salturi in plus
cvar_addjump_player = register_cvar("vip_cvar_addjump_player", "1") // Are 0 salt in plus

//V.I.P LIST
Pass = get_cvar_pointer("amx_password_field")
LoadVip = TrieCreate()
get_configsdir(File, charsmax(File))
format(File, charsmax(File), "%s/avengers-csone-vip/%s", File, "vip_list.ini")
new FilePointer, Key[32], Password[32], FileData[256]
if(!file_exists(File))
{
FilePointer = fopen(File, "w")
fclose(FilePointer)
}

FilePointer = fopen(File, "rt")
if(FilePointer)
{
while(!feof(FilePointer))
{
fgets(FilePointer, FileData, charsmax(FileData))
parse(FileData, Key, charsmax(Key), Password, charsmax(Password))
TrieSetString(LoadVip, Key, Password)
}
fclose(FilePointer)
}

//Map List
new path[64];
get_localinfo("amxx_configsdir", path, charsmax(path));
formatex(path, charsmax(path), "%s/avengers-hyperrr-vip/vip_maps.ini", path);

new file_maps = fopen(path, "r+");

if(!file_exists(path))
{
write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
}

new mapname[32];
get_mapname(mapname, charsmax(mapname));

new text[121], maptext[32];
while(!feof(file_maps))
{
fgets(file_maps, text, charsmax(text));
trim(text);

if(text[0] == ';' || !strlen(text))
continue;

parse(text, maptext, charsmax(maptext));

if(equal(maptext, mapname))
{
log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
remove_vip = true;
break;
}
}
fclose(file_maps);

//bullet damage
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
g_type = register_cvar("amx_bulletdamage", "3")
g_recieved = register_cvar("amx_bulletdamage_recieved", "1")

g_hudmsg1 = CreateHudSyncObj()
g_hudmsg2 = CreateHudSyncObj()

//VIP FREE
register_clcmd("say /timevip", "time_remain");

set_task(1.0, "check_time");
set_task(60.0, "check_time", _, _, _, "b");
set_task(1.0, "hud_mess", _, _, _, "b");

cvar_freevip = register_cvar("vip_free", "0");

cached_vars();
g_sync = CreateHudSyncObj();
//g_maxplayers = get_maxplayers();

//Advertise Message
set_task(ADVERTISING_TIME, "show_messages", _, _, _,"b");

//set_task(5.0, "_ProtectCheck_", 21412321, _,_, "b")
server_print("[%s] Felicitari! Detii o licenta valida, iar pluginul functioneaza perfect!", PLUGIN);
server_print("[%s] Pentru mai multe detalii y/m: ravravy@yahoo.com", PLUGIN);
server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);
}
else
{
new szPluginName[32];
formatex(szPluginName, sizeof(szPluginName) -1, "[IP Nelicentiat] %s", PLUGIN);
register_plugin(szPluginName, PLUGIN, "PedoBear");

server_print("[%s] Nu detii o licenta valabila! Plugin-ul nu va functiona corespunzator!", PLUGIN);
server_print("[%s] Pentru mai multe detalii Y!M: ravravy@yahoo.com", PLUGIN);
server_print("[%s] Ip-ul Licentiat: [%s] || Ip-ul Serverului: [%s]", PLUGIN, szIp, ServerLicensedIp);

pause("ade");
}
}

//VIP SCOREBOARD
#define SCOREATTRIB_NONE 0
#define SCOREATTRIB_DEAD (1 << 0)
#define SCOREATTRIB_BOMB (1 << 1)
#define SCOREATTRIB_VIP (1 << 2)

public MessageScoreAttrib(iMsgID, iDest, iReceiver)
{
new iPlayer = get_msg_arg_int(1);
if(is_user_connected(iPlayer) && ((is_vip(iPlayer)) || has_flag(iPlayer, "t") || get_user_flags(iPlayer) & read_flags("y") || vip_free))
set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
}

//Advertise Mesaje
public show_messages()
{
new Buffer[256];
formatex(Buffer, sizeof Buffer - 1, "^x02%s", messages[random(sizeof messages)]);

new players[32], num, id;
get_players(players, num);

for(new i = 0 ; i < num ; i++)
{
id = players

message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
write_byte(id);
write_string(Buffer);
message_end();
}
}

public plugin_cfg()
if(get_pcvar_num(g_recieved))
g_showrecieved = true; //Checks of g_received is 1 and if so, sets g_showrecieved to true

public vip_info(id)
show_motd(id, "/addons/amxmodx/configs/vip_info.html");

public reset_score(id)
{
static name[32]
get_user_name(id, name, 31)

new frags = get_user_frags(id);
new deaths = get_user_deaths(id);

if(frags == 0 && deaths == 0)
{
chat_color(id, "!g[AVENGERS|RS]!t Ai scorul deja !y0 !g- !y0 !t!")
return PLUGIN_HANDLED
}
else
{
if(is_vip(id) || get_user_flags(id) & read_flags("y"))
{
for(new i = 0; i < 2; i++)
{
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}

chat_color(id, "!g[AVENGERS|RS]!t Scorul tau a fost resetat! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
}
else
{
for(new i = 0; i < 2; i++)
{
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}

chat_color(id, "!g[AVENGERS|RS]!t Scorul tau a fost resetat! Bafta la fraguri !g%s!t Have fun!", name)
}
}

return PLUGIN_HANDLED
}

public reset_score_dead(id)
{
if(!is_vip(id))
return PLUGIN_HANDLED

static name[32]
get_user_name(id, name, 31)

new deaths = get_user_deaths(id);

if(deaths == 0)
{
chat_color(id, "!g[AVENGERS|RS]!t Ai !gdeath-urile !tdeja !y0 !g- !y0 !t!")
return PLUGIN_HANDLED
}
else
{
for(new i = 0; i < 2; i++)
cs_set_user_deaths(id, 0);

if(is_vip(id))
chat_color(id, "!g[AVENGERS|RS - VIP]!t Dead-urile tale au fost resetate! Bafta la fraguri !y[!gVIP!y] !g%s!t Have fun!", name)
}

return PLUGIN_HANDLED
}

public plugin_precache()
{
}

public bool:_get_vip(iPlugin, iParams)
{
new id = get_param(1);
if(is_vip(id) || has_flag(id, "y")) return true;

return false;
}

public native_vip_free(id) return vip_free

public on_damage(id)
{
if(g_enabled)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)

if(g_showrecieved && (is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_hudmsg2, "%i^n", damage)
}

if(is_user_connected(attacker) && (is_vip(attacker) || get_user_flags(attacker) & read_flags("y") || vip_free))
{
switch(g_enabled)
{
case 1:
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
case 2:
{
if(fm_is_ent_visible(attacker,id))
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
}
}
}
}
}

public client_authorized(id)
{
g_Weapon[id] = 0;

new Key[32], Password[32], OldPassword[32]
get_user_name(id, Key, charsmax(Key))
get_user_info(id, "_pw", Password, charsmax(Password))

if(TrieKeyExists(LoadVip, Key))
{
TrieGetString(LoadVip, Key, OldPassword, charsmax(OldPassword))
if(equal(Password, OldPassword))
IsUserVip[id] = true
else
{
server_cmd("kick #%i ^"Acest player are VIP!^"", get_user_userid(id))
IsUserVip[id] = false
}
}
}

public client_infochanged(id)
{
new oldname[32], newname[32], Password[32], OldPassword[32], PasswordField[5]
get_user_name(id, oldname, charsmax(oldname))
get_user_info(id, "name", newname, charsmax(newname))

if(equal(newname, oldname))
return

if(TrieKeyExists(LoadVip, newname))
{
get_pcvar_string(Pass, PasswordField, charsmax(PasswordField))
get_user_info(id, PasswordField, OldPassword, charsmax(OldPassword))
TrieGetString(LoadVip, newname, Password, charsmax(Password))

if(equal(OldPassword, Password))
IsUserVip[id] = true
else
{
server_cmd("kick #%i ^"NU esti VIP!^"", get_user_userid(id))
IsUserVip[id] = false
}
}
else
IsUserVip[id] = false
}

public plugin_end()
TrieDestroy(LoadVip)

public client_putinserver(id)
{
new xP[32], xN
get_players(xP, xN, "c")
for (new i=0; i< xN; i++)
{
if(!is_user_connected(xP))
continue

client_cmd(xP, "cl_minmodels 0")
}

//JUMP
jumpnum[id] = 0
dojump[id] = false

/*if(vip_free && !(get_user_flags(id) & read_flags("x") && !(get_user_flags(id) & read_flags("y"))))
{
new flags = get_user_flags(id);
flags |= VIP_FLAG
set_user_flags(id, flags);
}*/

if(is_vip(id) || get_user_flags(id) & read_flags("y"))
{
new name[33];
get_user_name(id, name, charsmax(name));
//chat_color(0, "!g[AVENGERS.CSONE.RO]!t VIP-ul [!g%s!t] se conecteaza pe server...", name);
}

//set_task(0.9, "vip_menu", id);
return PLUGIN_CONTINUE;
}

//VIP FREE
public cached_vars()
vip_free = get_pcvar_num(cvar_freevip);

public check_time()
{
new o;
time(o, _, _);

if(!vip_free)
{
if(o >= vip_time[22] || o < vip_time[12])
{
vip_free = 1;
set_pcvar_num(cvar_freevip, 1);
chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost activat!");
}
}
else
{
if(o < vip_time[22] && o >= vip_time[12])
{
vip_free = 0;
set_pcvar_num(cvar_freevip, 0);
chat_color(0, "^4[^3VIP^4]^1 Eventul^3 Free VIP^1 a fost dezactivat!");
}
}
}

public time_remain(id)
{
if(vip_free)
chat_color(id, "^4[^3AVENGERS.CSONE.RO^4]^1 Timp ramas pana se termina vip-ul free^3 %s", time_left_vip());
else if(!vip_free)
chat_color(id, "^4[^3AVENGERS.CSONE.RORO^4]^1 Timp ramas pana incepe vip-ul free^3 %s", time_left_vip());
}

public hud_mess()
{
if(!vip_free)
return;

set_hudmessage(random(256), random(256), random(256), 0.00, 0.17, 0, 1.1, 1.0);
ShowSyncHudMsg(0, g_sync, "TS.CSONE.RO - CANALUL AVENGERS");
}

stock time_left_vip()
{
new timp_ramas[16], len = 0;
new h, m, lh, lm;
time(h, m, _);
switch(vip_free)
{
case 0: lh = vip_time[0] - h;
case 1:
{
new l = vip_time[1];
if(h > l)
l += add_time(h) + h;
lh = l - h;
}
}
lm = 60 - m;
if(lm < 60)
lh--;

if(lh > 0)
len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, "%d or%s", lh, lh == 1 ? "a" : "e");

if(lm < 60)
len += formatex(timp_ramas[len], charsmax(timp_ramas) - len, " %d minut%s", lm, lm == 1 ? "" : "e");

return timp_ramas;
}

stock add_time(x)
{
new j;
switch(x)
{
case 0: j = 24;
case 1: j = 23;
case 2: j = 22;
case 3: j = 21;
case 4: j = 20;
case 5: j = 19;
case 6: j = 18;
case 7: j = 17;
case 8: j = 16;
case 9: j = 15;
case 10: j = 14;
case 11: j = 13;
case 12: j = 12;
case 13: j = 11;
case 14: j = 10;
case 15: j = 9;
case 16: j = 8;
case 17: j = 7;
case 18: j = 6;
case 19: j = 5;
case 20: j = 4;
case 21: j = 3;
case 22: j = 2;
case 23: j = 1;
}
if(x < vip_time[1])
j = 0;

return j;
}

public plugin_natives()
{
set_native_filter("native_filter")
register_native("get_vip", "_get_vip", 0)
register_native("free_vip", "native_vip_free", 0)

//register_native("get_map_disabled", "map_disabled", 0)
//register_native("check_map_disabled", "check_map", 0)
}

public map_disabled() return remove_vip

public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false

remove_task(id)
g_Weapon[id] = 0;
g_chosen[id] = false;
IsUserVip[id] = false
}

public client_PreThink(id)
{
if(remove_vip)
return;

if(!is_user_alive(id))
return

new BUTON = get_user_button(id)
new OLDBUTON = get_user_oldbutton(id)
new JUMP_VIP = get_pcvar_num(cvar_addjump_vip)
new JUMP_PLAYER = get_pcvar_num(cvar_addjump_player)

if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
{
if(((is_vip(id)) && (jumpnum[id] < JUMP_VIP)) || (!(is_vip(id)) && (jumpnum[id] < JUMP_PLAYER)) || vip_free && (jumpnum[id] < JUMP_VIP))
{
dojump[id] = true
jumpnum[id]++
}
}

if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
jumpnum[id] = 0
}

public client_PostThink(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE

if(dojump[id] == true)
{
new Float: velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
velocity[2] = random_float(265.0, 285.0)
entity_set_vector(id, EV_VEC_velocity, velocity)
dojump[id] = false
}

return PLUGIN_CONTINUE
}

public round_start()
{
if(!remove_vip)
{
g_Round++
vipcmd = 1;
}

//bullet damage
g_enabled = get_pcvar_num(g_type)
if(get_pcvar_num(g_recieved)) g_showrecieved = true
}

public LogEvent_RoundStart(id)
if(!remove_vip)
UserInBuyZone[id] = true;

public round_restart()
{
if(remove_vip)
return;

g_Round = 0
}

public player_maxspeed(id)
{
if(is_vip(id) && is_user_alive(id) && is_user_connected(id))
set_user_maxspeed(id, 450.0);

return PLUGIN_HANDLED
}

public player_spawn(Player)
{
if(remove_vip)
return HAM_IGNORED;

vip_opened[Player] = 0;
if((is_vip(Player) || (has_flag(Player, "y") || vip_free) && is_user_alive(Player) && is_user_connected(Player)))
{
UserInBuyZone[Player] = true;

if(g_Weapon[Player] == 0)
first_menu(Player)

if(get_pcvar_num(cvar_funk) )
task_funk(Player);

if(get_pcvar_num(cvar_show) && g_Round >= get_pcvar_num(cvar_round))
main_menu(Player);
}

return PLUGIN_HANDLED;
}

public arataMeniuVIPs(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED
}

if(is_vip(id) || has_flag(id, "y") || vip_free)
{
if(is_user_alive(id) && is_user_connected(id))
{
if(vipcmd == 0)
{
main_menu(id)
chat_color(id, "!g[VIP MENU]!t Aceasta comanda o poti folosi doar odata pe runda. Scuzele noastre! !g:)!t")
}
else
{
vipcmd = 0
}
}
else
chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi folosita doar daca esti in viata!")
}
else
chat_color(id, "!g[VIP MENU]!t Aceasta comanda poate fi utilizata doar de catre VIP")

return PLUGIN_HANDLED;
}

public task_funk(id)
{
if(vip_free && !is_vip(id))
{
give_item(id, "weapon_knife")
give_item(id, "item_thighpack")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "item_assaultsuit")
}
else if(is_vip(id) && (vip_free || !vip_free))
{
give_item(id, "weapon_knife")
give_item(id, "item_thighpack")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "item_assaultsuit")
}

if(get_pcvar_num(cvar_pistols))
{
for(new i = 0;i <6;i++)
fm_strip_user_gun(id, pistols)

switch(g_Weapon[id])
{
case 1:
{
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
give_item(id, "weapon_usp");
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
give_item(id, "weapon_glock18");
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}
}
}

/* Meniurile cu arme *** */
public main_menu(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED;
}

if(is_user_alive(id))
{
if(vip_opened[id] < get_pcvar_num(cvar_open) || get_pcvar_num(cvar_open) )
{
if(g_Round >= get_pcvar_num(cvar_round))
{
new s_Title[64], s_Name[32], s_Pistol[32], szMenuMulti[64]
get_user_name(id, s_Name, charsmax(s_Name))
switch(g_Weapon[id])
{
case 0: s_Pistol = "Fara Pistol!";
case 1: s_Pistol = "Deagle";
case 2: s_Pistol = "Usp";
case 3: s_Pistol = "Glock";
}

formatex(s_Title, charsmax(s_Title), "VIP System [AVENGERS.CSONE.RO]", s_Name)
i_Menu = menu_create(s_Title, "main_handler", 1);

formatex(szMenuMulti, charsmax(szMenuMulti), "M4A1 + %s + Grenade", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "1", 0)

formatex(szMenuMulti, charsmax(szMenuMulti), "AK47 + %s + Grenade", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "2", 0)

if(is_vip(id))
{ 
//formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + %s + Grenade (Terrorist)", s_Pistol)
//menu_additem(i_Menu, szMenuMulti, "4", 0)

//formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + %s + Grenade (Counter-Terrorist)", s_Pistol)
//menu_additem(i_Menu, szMenuMulti, "5", 0)
}
else if(!is_vip(id) || !has_flag(id, "x"))
{
//formatex(szMenuMulti, charsmax(szMenuMulti), "G3SG1 + [PISTOL] + Grenade \r[GOLD ONLY]")
//menu_additem(i_Menu, szMenuMulti, "4", ADMIN_ADMIN)

//formatex(szMenuMulti, charsmax(szMenuMulti), "SG550 + [PISTOL] + Grenade \r[GOLD ONLY]")
//menu_additem(i_Menu, szMenuMulti, "5", ADMIN_ADMIN)
}

//formatex(szMenuMulti, charsmax(szMenuMulti), "AWP + [PISTOL] + Grenade \r[GOLD ONLY]")
//menu_additem(i_Menu, szMenuMulti, "7", ADMIN_ADMIN)
}

/*if(vip_opened[id] && g_Weapon[id] && g_chosen[id])
{
formatex(szMenuMulti, charsmax(szMenuMulti), "<<< Primul Meniu (Pistoale)")
menu_additem(i_Menu, szMenuMulti, "6", 0)
}*/

formatex(szMenuMulti, charsmax(szMenuMulti), "\y<<< \rPrimul Meniu \y(\wPistoale\y)")
menu_additem(i_Menu, szMenuMulti, "6", 0)

//g_chosen[id] = false;
//vip_opened[id] = 0;
//g_Weapon[id] = 0;

menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, i_Menu, 0)
}
else
{
if(get_pcvar_num(cvar_round))
{
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
return PLUGIN_HANDLED;
}
else
{
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Meniul se deschide doar dupa !g%d!t runde!", get_pcvar_num(cvar_round))
return PLUGIN_HANDLED;
}
}
}
else
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Sincer... ceva nu merge bine. Contacteaza-ne pe !gwww.EPIC-GAMERS.ro/forum")
}
else
chat_color(id, "!g[AVENGERS.CSONE.RO]!t Esti mort... nu poti folosi meniul!")
//else
//chat_color(id, "!g[AVENGERS.CSONE.RO]!t Nu esti !gVIP!t. Foloseste comanda !g/help!t pentru afisare detalii")

return PLUGIN_HANDLED;
}

public main_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}

if(!is_user_alive(id) && !is_user_connected(id))
return PLUGIN_HANDLED;

new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)
new name[32]
get_user_name(id, name, charsmax(name))

switch(g_Weapon[id])
{
case 0:
{
first_menu(id);
menu_destroy(menu);
}
case 1:
{
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
if(pev(id, pev_weapons) & 1 << CSW_GLOCK18)
for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)

give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}

switch(i_Key)
{
case 1:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[EXTREAMCS]!t VIP-ul !g%s!t a primit M4A1 gratuit + !gGrenade", name)
}
case 2:
{
vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[EXTREAMCS]!t VIP-ul !g%s!t a primit Ak47 gratuit + !gGrenade", name)
}

case 3:
{

vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[EXTREAMCS]!t VIP-ul !g%s!t a primit G3SG1 (D3/AU-1) gratuit + !gGrenade", name)
}
case 4:
{

vip_opened[id]++
/*if(user_has_weapon(id, CSW_C4))
engclient_cmd(id, "drop", "weapon_c4")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_sg550")
cs_set_user_bpammo(id, CSW_SG550, 90)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[EXTREAMCS]!t VIP-ul !g%s!t a primit SG550 (Counter-Terorist) gratuit + !gGrenade", name)
}
case 5:
{

vip_opened[id]++
/*if(user_has_weapon(id, CSW_AWP))
engclient_cmd(id, "drop", "weapon_awp")*/

for(new i = 0;i < sizeof primaryWeapons;i++)
engclient_cmd(id, "drop", primaryWeapons)

give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 18)

if(get_pcvar_num(cvar_chat) )
chat_color(id, "!g[EXTREAMCS]!t VIP-ul !g%s!t a primit SG550 (Counter-Terorist) gratuit + !gGrenade", name)
}
case 8:
{

g_chosen[id] = false;
vip_opened[id] = 0;
g_Weapon[id] = 0;
first_menu(id);
}
}

//menu_destroy(menu);
return PLUGIN_CONTINUE;
}

public first_menu(id)
{
if(!UserInBuyZone[id] && is_user_alive(id))
{
client_print(id, print_center, "Doar din Spawn iti poti sa iti iei iteme pentru VIP!");
return PLUGIN_HANDLED;
}

if(remove_vip)
return PLUGIN_HANDLED;

if(!is_user_connected(id))
return PLUGIN_HANDLED;

i_Menu_Pistol = menu_create("Ce pistol doresti?", "first_menu_handler")

menu_additem(i_Menu_Pistol, "Deagle [35 Gloante]", "1", 0)
menu_additem(i_Menu_Pistol, "USP [100 Gloante]", "2", 0)
menu_additem(i_Menu_Pistol, "Glock [120 Gloante]", "3", 0)

menu_setprop(i_Menu_Pistol, MPROP_EXIT, MEXIT_ALL);
menu_display(id, i_Menu_Pistol, 0)

return PLUGIN_HANDLED;
}

public first_menu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)

for(new i = 0;i <6;i++)
fm_strip_user_gun(id, pistols)

switch(i_Key)
{
case 1:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)
}

g_chosen[id] = true;
g_Weapon[id] = 1;
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
case 2:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)
}

g_chosen[id] = true;
g_Weapon[id] = 2;
give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 100)
}
case 3:
{
if(vip_opened[id] == 0 && g_Round >= get_pcvar_num(cvar_round))
{
main_menu(id)

for(new i = 0;i < sizeof secondaryWeapons;i++)
engclient_cmd(id, "drop", secondaryWeapons)
}

g_chosen[id] = true;
g_Weapon[id] = 3;
give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_GLOCK18, 120)
}
}

//menu_destroy(menu);
return PLUGIN_CONTINUE;
}

stock get_vips_online()
{
new players[32], pnum, vs, i, userid
get_players(players, pnum, "ch")

for(i = 0; i < pnum; i++)
{
userid = players

if(!(is_vip(userid)))
continue;

vs ++;
}

return vs
}

stock chat_message(index, const message[], any:...)
{
new sBuffer[256], dest
vformat(sBuffer[1], charsmax(sBuffer), message, 3)

sBuffer[0] = '^1'

replace_all(sBuffer[1], charsmax(sBuffer), "!y", "^1")
replace_all(sBuffer[1], charsmax(sBuffer), "!t", "^3")
replace_all(sBuffer[1], charsmax(sBuffer), "!g", "^4")

sBuffer[192] = '^0'

if(index)
{
dest = MSG_ONE_UNRELIABLE
}
else
{
dest = MSG_BROADCAST
}

message_begin(dest, get_user_msgid("SayText"), {0, 0, 0}, index)
write_byte(index)
write_string(sBuffer)
message_end()
}

/*public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
if(get_user_flags(id) & VIP_FLAG) //Checks if player is VIP
{
new money = read_data(2) * get_pcvar_num(cvar[money_hs]
if(hitpoint==1) money += get_pcvar_num(cvar[money_hs] //Checks if player damages enemy by head shot
cs_set_user_money(attacker,cs_get_user_money(attacker) + money) //Gives money for damaging enemys
}
}*/

public event_DeathMsg()
{
if(remove_vip)
return PLUGIN_HANDLED;

new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
new hp = headshot ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
new money = headshot ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);

if(is_vip(victim))
if(!g_chosen[victim])
set_task(1.0, "first_menu", victim)

if(is_user_alive(killer) && (is_vip(killer) || get_user_flags(killer) & read_flags("y") || vip_free))
{
if(killer == victim) return PLUGIN_HANDLED;
if(hp != 0) set_user_health(killer, clamp(get_user_health(killer) + hp, 1, get_pcvar_num(cvar[max_hp_kill])));
if(money != 0) cs_set_user_money(killer, clamp(cs_get_user_money(killer) + money - 300, 1, 16000));

set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(killer, "Healed +%d HP", hp);

message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, killer);
write_short(1<<10);
write_short(1<<10);
write_short(0x0000);
write_byte(0);
write_byte(0);
write_byte(200);
write_byte(75);
message_end();
}

return PLUGIN_CONTINUE;
}

public hook_say(id)
{
/*static szAllArgs[1023];
read_args(szAllArgs, charsmax(szAllArgs))
if((containi(szAllArgs, "/vip")!= -1 || containi(szAllArgs, "/vips")!= -1))
return PLUGIN_HANDLED;*/

new said[192];
read_args(said,192);
if(contain(said, "/vips") != -1)
set_task(0.1,"check_vips",id);

return PLUGIN_CONTINUE;
}

public check_vips(id)
{
new sBuffer[128], sVipname[32], sSlots[34], userid, vs, i

formatex(sBuffer, charsmax(sBuffer), "!t[-!gV!tI!gP's!t-] !gOnline: ")

new z;
if((z = get_vips_online()))
{
new players[32], pnum
get_players(players, pnum, "ch")

for(i = 0; i < pnum; i++)
{
userid = players

if(!(is_vip(userid)))
continue;

vs ++;
get_user_name(userid, sVipname, charsmax(sVipname))
formatex(sSlots, charsmax(sSlots), "!t%s!g%s", sVipname, z == vs ? ".":", ")
add(sBuffer, charsmax(sBuffer), sSlots)
}
}
else if(!get_vips_online())
{
add(sBuffer, charsmax(sBuffer), "!tThere is no vip's !gOnline!")
}

chat_message(id, sBuffer)
}

public print_adminlist(user)
{
new adminnames[33][32];
new message[256];
new id, count, x, len;

for(id = 1 ; id <= get_maxplayers() ; id++)
if(is_user_connected(id))
if(is_vip(id) || get_user_flags(id) & read_flags("y"))
get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));

len = format(message, 255, "^1VIP-ii online sunt:^4 ");
if(count > 0)
{
for(x = 0 ; x < count ; x++)
{
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
if(len > 96)
{
print_message(user, message);
len = format(message, 255, " ");
}
}
print_message(user, message);
}
else
chat_color(id, "!g[CS - VIP]!t ^1Nu sunt ^4VIP^1-i online.")

return PLUGIN_CONTINUE;
}

public StatusIcon_buyzone_OFF(id)
{
if(!remove_vip)
{
UserInBuyZone[id] = false;
CheckMenuClose(id);
}
}

public Event_StatusIcon_Show_buyzone(id)
if((is_vip(id) || get_user_flags(id) & read_flags("y") || vip_free))
UserInBuyZone[id] = true;

CheckMenuClose(id)
{
new oldMenuId, newMenuId;
player_menu_info(id, oldMenuId, newMenuId)
if(newMenuId > -1 && newMenuId == i_Menu || newMenuId > -1 && newMenuId == i_Menu_Pistol)
menu_cancel(id);
}

print_message(id, msg[])
{
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
write_byte(id);
write_string(msg);
message_end();
}

stock bool: is_vip(const id)
{
if(!is_user_connected(id))
return false;

if(IsUserVip[id] || get_user_flags(id) & read_flags("x")) /*|| equali(name, "seven|sin")|| equali(name, "PedoBear"))*/
return true;

return false;
}

stock chat_color(const id, const input[], any:...)
{
new count = 1, Jucatori[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")//Culoarea Verde
replace_all(msg, 190, "!y", "^1")//Culoarea Normala a Chat-ului (galben)
replace_all(msg, 190, "!t", "^3")//Culoarea Echipei : CT = Albastru | T = Rosu.

if (id)Jucatori[0] = id;else get_players(Jucatori, count, "ch")
{
for (new Y = 0;Y <count;Y++)
{
if (is_user_connected(Jucatori[Y]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Jucatori[Y])
write_byte(Jucatori[Y]);
write_string(msg);
message_end();
}
}
}
}
:hand_with_pen:
:lifting_eyes:
MY GAMING SETUP + PERIFERICE:
| Afiseaza codul
PROCESOR: AMD Ryzen 5 2600X 3.6GHz   (in curand update la 3700x)

PLACA VIDEO: MSI GeForce GTX 1660Ti ARMOR OC 6GB GDDR6

MOBO:  GIGABYTE B450 AORUS ELITE

RAM:    8GB DDR4 3000MHz CL16  de la ADATA RGB

HDD:  Seagate Barracuda 2TB + Hard disk extern Seagate Backup Plus Hub 6TB USB 3.0 Black

SSD: Kingston A400 120GB SATA 2.5inch (OS: Windows 10 Home 64-bit)

CASE :   Raidmax Neon G21 RGB Neagra

Supply: Corsair VS Series VS650 650W 

Monitor: LED ASUS Gaming VP228HE 21.5 inch 1 ms Black
Casti: Gaming Redragon Siren 2 Black
Mousepad: Redragon Archelon M
Mouse: Gaming Redragon Titanoboa 2
Tastatura: Redragon Visnu RGB Mecanica
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests