Raised This Month: $ Target: $400
 0% 

Harbu/Menu Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
geertjan88
Member
Join Date: May 2006
Old 12-02-2006 , 04:17   Harbu/Menu Help
Reply With Quote #1

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.
__________________
if i help? +karma!
geertjan88 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode