BANNED
Join Date: Sep 2008
Location: Here
|
09-14-2009
, 06:36
[HELP]Tags Teams
|
#1
|
hello, I dont know what is wrong with this code, because when I choose the menu option it gives only 1 player from each team and not all ...:/
Code...
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc>
#define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "#8 SickneSS"
new tagTt, tagTtSide, tagCt, tagCtSide new g_tagsON
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_concmd("say /menu","Menu",ADMIN_CVAR) register_concmd("mm_tag","cmdTags",ADMIN_CVAR) g_tagsON = register_cvar("mm_enable_tags","0") tagTt = register_cvar("mm_tagtt","Terrrorist") tagCt = register_cvar("mm_tagct","Counter-Terrorist") tagTtSide = register_cvar("mm_tagtt_side","0") tagCtSide = register_cvar("mm_tagct_side","1") } public cmdTags(id) { if(get_pcvar_num(g_tagsON) == 1){ new NNick[32] new Tt[32] new Ct[32] new Name[32] new Team[32] get_user_team(id,Team,31) get_user_name(id,Name,31) get_pcvar_string(tagTt, Tt, 31) get_pcvar_string(tagCt, Ct, 31)
if (strcmp(Team,"TERRORIST") == 0 || strcmp(Team,"@terrorist") == 0 ) { if (containi(Name,Tt) != -1 ) return PLUGIN_HANDLED if (get_pcvar_num(tagTtSide) == 1) { format(NNick, 31, "%s%s", Name, Tt) set_user_info(id, "name", NNick) } else { format(NNick, 31, "%s%s", Tt, Name) set_user_info(id, "name", NNick) } client_print(id,print_chat,"The new tag for Terrorists is %s.",Tt) return PLUGIN_HANDLED }
if (strcmp(Team,"CT") == 0 || strcmp(Team,"@counter") == 0) { if (containi(Name,Ct) != -1 ) return PLUGIN_HANDLED if (get_pcvar_num(tagCtSide) == 1) { format(NNick, 31, "%s%s", Name, Ct) set_user_info(id, "name", NNick) } else { format(NNick, 31, "%s%s", Ct, Name) set_user_info(id, "name", NNick) } client_print(id,print_chat,"The new tag for Counter-Terrorists is %s.",Ct)
return PLUGIN_HANDLED } return PLUGIN_HANDLED } return PLUGIN_HANDLED } public Menu(id,level,cid) { if ( !cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED new menu = menu_create("Menu","menu_handler") menu_additem(menu, "Switch tags on teams", "1", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) return PLUGIN_HANDLED } public Menu_Handler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_CONTINUE } 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: { for(new i = 1; i <= get_maxplayers(); i ++) { if(is_user_connected(i)) cmdTags(i) menu_destroy(menu) } } } menu_display(id, menu, 0) return PLUGIN_HANDLED }
ps : sorry for my bad english ... im from argentina
Thanks
Last edited by #8 SickneSS; 09-14-2009 at 08:59.
|
|