| manuelpuyol |
11-08-2011 16:33 |
[Help] Menu Plugin
Some time ago, I found a menu plugin in the web and i edited it, but when I try to use it, nothing happens. The plugin doesn't work.
here's the code:
PHP Code:
#include <amxmodx>
#include <cstrike>
public plugin_init()
{
register_plugin("PLUGIN", "VERSION", "AUTHOR")
register_clcmd("say /menu", "jbmenu")
register_clcmd("chooseteam", "hooknvg");
}
public hooknvg(id)
{
jbmenu(id);
return PLUGIN_HANDLED;
}
public jbmenu(id)
{
new Menu = menu_create("\r[rL' JB] Menu", "antinoobmenu")
menu_additem(Menu, "\wPassar para o time dos \bPrisioneiros" , "1", 0)
menu_additem(Menu, "\wPassar para o time dos \rGuardas" , "2", 0)
menu_additem(Menu, "\wPassar para \ySPEC" , "3", 0)
menu_setprop(Menu,MPROP_EXITNAME,"Sair")
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, Menu, 0)
}
public antinoobmenu(id, Menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu, item, iAccess, iData, 5, iName, 63, iCallback)
switch (str_to_num(iData))
{
case 1:
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
client_print(id, print_chat, "[rL' JB] Voce ja esta no time dos Prisioneiros.")
}
else
{
new name[32]
get_user_name(id,name,31)
if(is_user_alive(id)) user_kill(id)
cs_set_user_team ( id, CS_TEAM_T, CS_T_TERROR)
client_print(0, print_chat, "[rL' JB] %s trocou para o time dos Prisioneiros.", name)
}
}
case 2:
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
client_print(id, print_chat, "[rL' JB] Voce ja esta no time dos Guardas.")
return PLUGIN_HANDLED
}
else
{
new name[32]
get_user_name(id,name,31)
if(is_user_alive(id)) user_kill(id)
cs_set_user_team ( id, CS_TEAM_CT, CS_CT_URBAN)
client_print(0, print_chat, "[rL' JB] %s trocou para o time dos Guardas.", name)
}
}
case 3:
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "[rL' JB] Voce ja eh SPEC.")
return PLUGIN_HANDLED
}
else
{
new name[32]
get_user_name(id,name,31)
if(is_user_alive(id)) user_kill(id)
cs_set_user_team ( id, CS_TEAM_SPECTATOR )
client_print(0, print_chat, "[rL' JB] %s foi para SPEC.", name)
}
}
}
return PLUGIN_HANDLED
}
I would be very happy if you can help me.
|