Quote:
Also, I wrote the tutorial a long time ago, and I explained using the add() function for combining strings, but you should use format().. anyway, not a big deal there.. You could find it here! (Maybe Bailopan has written a better one since tho, be sure to check for his in the AMXX Docs!!) Hope it helps!! |
Xeroblood , I looked in the Amx scripting section I saw your stickie a long time ago , I just thought of it right now , thanks it really helps :) One question though , I know how to set the menu up , but how do you set actions up for each option?
|
I hate to jack someone else's help thread, but what is the significance of i++?
|
No problem man. This is for all to get help :) I am a noob but I think that would mean , i could be more? Just a guess.
|
@Peli:
first, of course, you display the menu (I know you got that), but that will only show it on screen.. when you register the Menu with AMX/X, it will call any function you specify when a user chooses one of the options.. register it like: Code:
where "\yYour Menu:" is whatever you named your menu when displaying it (the very first part of the string) If I did the above in code I am telling AMX/X that my menu uses all 10 options: (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8 |1<<9|1<<0) 1<<0 = KeyPad Key 1 1<<1 = KeyPad Key 2 1<<2 = KeyPad Key 3 ... ... 1<<8 = KeyPad Key 9 1<<9 = KeyPad Key 0 and when any one of those keys is pressed by the user, AMX/X will hide the on-screen menu and call the "MenuCommand" function.. now in your MenuCommand function (you can name it anything) you would 'catch' the key pressed by the user (sent from AMX/X) in a parameter (ussually called 'key') so that your code knows what option was chosen: id = the user who seen then menu and chose option, key = the option they chose (as a bit, so if they Press 1 on keypad, you get 0 in code, just like above) Code:
Hope that helps!! @Gor.d: i++ is a postfix 'increment' operation.. i++ is simply i = i + 1 after the current usage of i (postfix) ++i is simply i = i + 1 before the current usage of i (prefix) so if i = 5 and I did: call_some_ex_func( i++ ) then the function "call_some_ex_func" would recieve a value of '5' then, the i gets incremented by one.. however, if I did: call_some_ex_func( ++i ) then i gets incremented first to '6' then the function gets called, passing the new value of 6!! Hope that didn't confuze you.. |
No, it actually helped alot. Thanks Xeroblood.
|
Nevermind :)
|
| All times are GMT -4. The time now is 10:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.