Back Button For menu
ok i have no idea how to add a back button to my menu . can smeone help me ? here my main menu . can so meon show me the way to add a back button , after picking from this main menu it breaks down into every weapon , i want it to go back here if the user hits 9
Code:
|
Re: Back Button For menu
look at the source code of the plugin called weapon menu by bender and xeroblood
|
Re: Back Button For menu
That, no offense by the way, is really bad scripting.
Use switch(key) instead of 'if' over and over again. Also looks like you aren't defining key in the function either. Code:
Code:
This is called branching. Code:
Use this instead. Code:
|
Re: Back Button For menu
kool , ill use the case switches. I know about them but im not comfortable using them because i never tried them before. but my code is like 800 lines now (a huge in game comand menu) so , i should use them. can you pease tell me why that number 4 isnt neccesary? and can you tell me how to make a back and exit button using the case statements u used .
other than that it sounds good :) thanks for helping :up: +karma EDIT; OMG ! the case switches already cut out 100 lines from my code :o i cant believe i didnt use these before . oh can you show me the right way to do a else stateent with a case switch ? |
Re: Back Button For menu
Store what there menu page/postion is through a global var. You can find more information by searching for like the AMXX menu template (it's not offical, but was used for a long while and still is).
Code:
|
Re: Back Button For menu
can you tell me why it says "can only have 1 line following a case statemet" . how can i make it accept more then one line or is it imposable?
|
Re: Back Button For menu
->
Code:
public MyMenuHook(id, key) |
Re: Back Button For menu
Oh woops, added that while I was at school ^^.
|
Re: Back Button For menu
800 lines?? Judging from like the 50 lines I just compressed for you to like 5-10 lines, it could be just a 400 line project? Its not the size, its the effeciancy of the plugin that matters.
You can make either a very small plugin, or a very effeciant one. Some cases could have both. O.o I currently had a 3600'ish line plugin, I was able to compress it to 3100, and get rid of a few mysql bugs in the process. :P |
Re: Back Button For menu
you guys didn't figure it out yet? it's raphero with his BattleField Mod lulz, :)
|
| All times are GMT -4. The time now is 04:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.