Hello, my last post may have been to broad so this is a narrowed down one. I have read the documentation and tutorials for amx and amxx over and over and still cannot figure out how to make this certain part of the plugin I'm making work. I can't figure out how to get a command executed on a person who is chosen through a menu. Here is the part of the code that I believe is causing the problem:
Code:
public TGOMenuCommand(id,key) {
new player = g_menuPlayers[id][g_nTGOMenuPosition[id] * 7 + key]
new name[32], name2[32], authid[32],authid2[32]
get_user_name(player,name2,31)
get_user_authid(id,authid,31)
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
new userid2 = get_user_userid(player)
switch (key) {
case 7: {
++g_menuOption[id]
g_menuOption[id] %= 3
switch(g_menuOption[id])
{
case 0: g_menuSettings[id] = 0
case 1: g_menuSettings[id] = 5
case 2: g_menuSettings[id] = 60
}
ShowTGOMenu(id,g_nTGOMenuPosition[id])
}
case 8: ShowTGOMenu(id,++g_nTGOMenuPosition[id])
case 9: ShowTGOMenu(id,--g_nTGOMenuPosition[id])
default: {
log_amx("GodmodeOther: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")",
name,get_user_userid(id),authid, name2,userid2,authid2, g_menuSettings[id] )
switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_2",name,name2)
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_1",name2)
}
g_menuPlayers[id]
if(get_user_godmode(player, 0 ) == 1)
{
set_user_godmode(player, 1 ) // turn on
}
else
{ // if already on
set_user_godmode(player, 0 ) // turn off
}
}
server_exec()
ShowTGOMenu(id,g_nTGOMenuPosition[id])
}
}
return PLUGIN_HANDLED
}