PHP Code:
public client_putinserver(id)
{
set_task( 0.5, "show_terms", id )
}
public show_terms(id)
{
new menu = menu_create("\rTerms of Agreement^n\y-------------^n\
\w1. Rule One.^n\
2. Rule Two.^n\
3. Rule 3.^n\
4. Rule 4.", "terms_handler")
menu_additem(menu, "I agree", "1", 0)
menu_additem(menu, "I disagree \r(You will be kicked!)", "2", 0)
menu_display(id, menu, 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
}
public terms_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
show_terms(id)
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo( menu, item, access, data, 6, iName, 63, callback )
new key = str_to_num( data );
switch( key )
{
case 1:
{
Weapons_Menu(id);
}
case 2:
{
client_print(id, print_console, "You have been kicked for denying our Terms of Agreement.")
client_cmd(id, "toggleconsole")
client_cmd(id, "disconnect")
}
}
return PLUGIN_HANDLED;
}
The only issue I seem to be having is with the handler. The menu shows and what not, but none of the options work (exit, agree, disagree)
I've been trying everything I can to fix it, I suppose everything I have isn't enough. Anything you see wrong here?
Note:
5:46 PM ( I ran the menu on player spawn, and it works completely fine. It only has issues with set_task )
__________________