Menu thing
give me a full code of making a menu with 9 options.. and on all of em theres client_cmds(just show me where to put the client command code u dont have to put em there)
|
Re: Menu thing
|
Here is the code from the link Avalanche gave , it is Xeroblood's tutorial to make menus , works for AMX Mod and AMX Mod X. All you have to do is change #include <amxmod> to #include <amxmodx> but I did that for you , I added comments where you put the client commands , and where you put the messages you want when that client uses that command. :
Code:
|
btw: the author of the linked tutorial didn't tell us why you can also use
Code:
new keys = 1023Code:
new keys=(1<<0|1<<1|1<<2|1<<3|..|1<<9)With the above code you set bits. Written side by side, this looks as following: Code:
Keys: 9 8 7 6 5 4 3 2 1 0Let's see what happens if u only need keys 0-4: Code:
Keys: 9 8 7 6 5 4 3 2 1 0I think it's a lot easier using the bitwise notation cuz u won't lose the overview there, just wanted to give a hint... |
Coo, thanks.
|
@MistaGee:
I understand BitWise operations fully, the question I had (way back then) was not "Why is the number 1023", but more like "Why do we even need keys there, when the show_menu() function ultimately ignores them and uses its own keys anyway"... (Nice explanaition tho! But you didn't explain the math to them! ;)) Also, please don't use that code bit containing the add() functions.. use this instead: Code:
Just replace the same function from above with this one.. |
Quote:
Quote:
Quote:
To get a decimal number out of a binary do the following: for example: 1101010 decimal = 1*2^7 + 1*2^6 + 0*2^5 + 1*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0 = 26 or just ask your calc.exe in scientific mode (can be switched via menu "View") :D |
(..double-post..)
|
Quote:
|
Noooo, not math!!
xero, read your gmail =]. |
| All times are GMT -4. The time now is 19:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.