This function works:
Code:
<font size="2">
register_menucmd( register_menuid("Do you want to execute command: ?"), 1023, "Confirm" )
public Askmenu(id){
new szMenuBody[256]
new keys
format( szMenuBody, 255, "Do you want to execute command: ? ^n1. Yes!^n2 No!^n3. Exit")
keys = (1<<0|1<<1|1<<2)
show_menu( id, keys, szMenuBody, -1 )
return PLUGIN_HANDLED
}
public Confirm( id , key )
{
switch( key )
{
case 0: {
client_print(id,print_chat,"Yes")
log_amx("YES")
}
case 1: {
client_print(id,print_chat,"No")
log_amx("YES")
}
default:
{
client_print(id,print_chat,"DEBUG!")
}
}
return PLUGIN_HANDLED
}
</font>
But this doesn't work (i use this function inside another function),both players are recognised but 'yes' or 'no' does not work, i get the original botmenu (ESF).
Code:
<font size="2">
register_menucmd( register_menuid("Do you want to do things with: ?"), 1023, "Confirm" )
public FusionAskmenu(id,id2){
new szMenuBody[256]
new keys
new szUserName[32]
get_user_name( id2, szUserName, 31 )
format( szMenuBody, 255, "Do you want to do things with: %s? ^n1. Yes!^n2 No!^n3. Exit",szUserName)
keys = (1<<0|1<<1|1<<2)
show_menu( id, keys, szMenuBody, -1 )
return PLUGIN_HANDLED
}
public Confirm( id , key )
{
switch( key )
{
case 0: {
client_print(id,print_chat,"Yes")
log_amx("YES")
}
case 1: {
client_print(id,print_chat,"No")
log_amx("YES")
}
default:
{
client_print(id,print_chat,"DEBUG!")
}
}
return PLUGIN_HANDLED
}
</font>
Does this problem has to do with implenting the name in the 'Ask menu'?
Thanks in advance
__________________