In harbu there is an menu called atm_menu.
Code:
///////////////////////////////
//
// ATM CODE
//
///////////////////////////////
// ATM Menu 1. Deposit, 2. Withdraw
public actionMenuatm(id,key)
{
switch(key){
case 0:{
showMenudep(id)
}
case 1:{
showMenuwit(id)
}
}
return PLUGIN_HANDLED
}
public Menu_Atm(id)
{
if(get_item_amount(id,get_cvar_num("rp_itemid_atmcard"),"money") == 0)
{
client_print(id,print_chat,"[Bank] You need an ATM Card to use this^n")
return PLUGIN_HANDLED
}
if(cuffed[id] == 1)
{
client_print(id,print_chat,"[Bank] Can't deposit or withdraw money when cuffed^n")
return PLUGIN_HANDLED
}
new menuBodyp[512]
new len = format(menuBodyp,511,"ATM Menu^n^n")
len += format(menuBodyp[len],511-len,"1. Deposit^n2. Withdraw^n^n0. Exit")
show_menu(id,((1<<0)|(1<<1)|(1<<9)),menuBodyp)
return PLUGIN_HANDLED
}
Now this is probably a really stupid question, but well also donkey's can learn things. When you use an atm it shows up Menu_atm wich is shown above. But how does amx knows when you press 1 or 2 it should excecute what is written in ActionMenuAtm how are those two things connected i mean how do you connect them. I tried to search all over the code but i can't find the piece of code where it is coded that when someone presses a key in menu_atm that after that it should excecute the action in actionMenuatm.
__________________