wanted a help on this plugin so that vip only buy on BUYZONE and also how i put a price on vip weapons because i'm not spending money
Код:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>
#include <fakemeta_util>
#include <hamsandwich>
#include <cromchat>
#define STRIP_WEAPONS
#if defined STRIP_WEAPONS
#include <stripweapons>
#else
enum
{
Grenades = 0,
Primary,
Secondary
}
#endif
#define PLUGIN "weapon menu"
#define VERSION "2.0"
#define xPrefix "vip guns"
#define xPrefixChat "&x03[&x04vip guns&x03]"
new xRememberSelection[33], acao[33], xNaoMostrar[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "vip guns")
register_clcmd("say /armas", "xMenuGuns")
RegisterHam(Ham_Spawn, "player", "xHam_Spawn", true)
}
public xHam_Spawn(id)
{
if(is_user_alive(id), !xNaoMostrar[id] || xRememberSelection[id])
set_task(0.5, "xGetGuns", id)
}
public xGetGuns(id)
{
static menu
if(xRememberSelection[id])
{
_xMenuGuns(id, menu, acao[id])
}
else
{
xMenuGuns(id)
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public client_putinserver(id)
{
xRememberSelection[id] = false
xNaoMostrar[id] = false
}
// Menu Guns
public xMenuGuns(id)
{
if(xRememberSelection[id])
{
xRememberSelection[id] = false
CC_SendMessage(id, "%s &x01Voce reativou o &x04menu de armas.", xPrefixChat)
}
new xTeam
xTeam = get_user_team(id)
new xMenu[500]
formatex(xMenu, 499, "%s \wMenu de Armas^n", xPrefix)
new menu = menu_create(xMenu, "_xMenuGuns")
if(xTeam == 1) // Armas TR
{
menu_additem(menu, "\wKIT \d[\yAK47 + Desert\d]", "1")
menu_additem(menu, "\wKIT \d[\yAWP + Desert\d]", "2")
menu_additem(menu, "\wKIT \d[\ygalil + Desert\d]", "3")
menu_additem(menu, "\wKIT \d[\yG3/SG-1 + Desert\d]^n", "4")
menu_additem(menu, "\w[\rVIP\w] \d- [\yM4A1+ Desert\d]^n", "5")
}
else // Armas CTS
{
menu_additem(menu, "\wKIT \d[\yM4A1 + Desert\d]", "1")
menu_additem(menu, "\wKIT \d[\yAWP + Desert\d]", "2")
menu_additem(menu, "\wKIT \d[\yFamas + Desert\d]", "3")
menu_additem(menu, "\wKIT \d[\ySG-550 + Desert\d]^n", "4")
menu_additem(menu, "\w[\rVIP\w] \d- [\yAK47 + Desert\d]^n", "5")
}
if(xRememberSelection[id])
{
menu_additem(menu, "\w[\rRelembrar Selecao?\w] \r[\dON\r]^n", "6")
}
else
{
menu_additem(menu, "\w[\rRelembrar Selecao?\w] \r[\dOFF\r]^n", "6")
}
menu_additem(menu, "\w[\rNao Exibir\w] este menu novamanete.", "7")
menu_setprop(menu, MPROP_EXITNAME, "Sair")
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public _xMenuGuns(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu); return PLUGIN_HANDLED;
}
// new xTeam
// xTeam = get_user_team(id)
if(!is_user_connected(id)) return PLUGIN_HANDLED
switch(item)
{
case 0:
{
if(get_user_team(id) == 1)
{
client_cmd(id,"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
}
else
{
client_cmd(id, "defuser;vesthelm;m4a1;deagle;secammo;primammo;hegren;flash;flash")
}
acao[id] = item
}
case 1:
{
if(get_user_team(id) == 1)
{
client_cmd(id,"vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
}
else
{
client_cmd(id, "defuser;vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
}
acao[id] = item
}
case 2:
{
if(get_user_team(id) == 1)
{
client_cmd(id, "vesthelm;galil;deagle;secammo;primammo;hegren;flash;flash")
}
else
{
client_cmd(id, "defuser;vesthelm;famas;deagle;secammo;primammo;hegren;flash;flash")
}
acao[id] = item
}
case 3:
{
if(get_user_team(id) == 1)
{
client_cmd(id,"vesthelm;g3sg1;deagle;secammo;primammo;hegren;flash;flash")
}
else
{
client_cmd(id, "defuser;vesthelm;sg550;deagle;secammo;primammo;hegren;flash;flash")
}
acao[id] = item
}
case 4:
{
if(get_user_team(id) == 1 && get_user_flags(id) & ADMIN_KICK)
{
strip_user_weapons(id);
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 90);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
give_item(id,"weapon_knife");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_c4");
}
else if(get_user_team(id) == 2 && get_user_flags(id) & ADMIN_KICK)
{
strip_user_weapons(id);
give_item(id, "weapon_ak47");
cs_set_user_bpammo(id, CSW_AK47, 90);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
give_item(id,"weapon_knife");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
cs_set_user_defuse(id, 1) ;
}
else
{
CC_SendMessage(id, "&x04[Vip guns] &x01Desculpe voce nao é &x04vips")
return PLUGIN_HANDLED;
}
acao[id] = item
}
case 5:
{
if(xRememberSelection[id])
{
xRememberSelection[id] = false;
}
else
{
xRememberSelection[id] = true;
CC_SendMessage(id, "%s &x01Voce Ativou &x03Relembrar-Selecao de armas&x01, Digita &x04/armas &x01para re-ativar.", xPrefixChat)
xGetGuns(id)
}
}
case 6:
{
xNaoMostrar[id] = true;
CC_SendMessage(id, "%s &x03PRONTO!!, &x01Para ativa digita &x04/armas", xPrefixChat)
}
}
return PLUGIN_HANDLED
}