menu scripting
I need serious help with my menu. I am brand new, started yesterday, at attempting to script in AMXX mod. this is my immediate plugin.
#include <amxmod> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() { register_plugin("MultiMenu","1.0","Bent") register_menucmd(register_menuid("MultiMenu") ,1023,"actionMenu") register_clcmd("amx_menu","showMenu",ADMIN_SL AY,"-displays Bent's menu") new modName[32] get_modname(modName,31) } public actionMenu(id,key) { switch(key){ case 0:{ if (get_cvar_num("amx_kyle")==0) return PLUGIN_HANDLED set_user_health(id, get_user_health(id) +250) return PLUGIN_HANDLED } case 1:{ if (get_cvar_num("amx_kyle")==0) return PLUGIN_HANDLED cs_set_user_money(id, cs_get_user_money(id) +1000) return PLUGIN_HANDLED } case 2:{ if (get_cvar_num("amx_kyle")==0) return PLUGIN_HANDLED set_user_armor(id, get_user_armor(id) +100) return PLUGIN_HANDLED } case 3:{ if (get_cvar_num("amx_kyle")==0) return PLUGIN_HANDLED set_user_maxspeed(id, 400000000.0) return PLUGIN_HANDLED } } return PLUGIN_HANDLED } public showMenu(id,level,cid) { if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED new menuBody[512] new len = format(menuBody,255 "\yFirst Menu:^n";) len += format(menuBody[len],511-len,"1. Health^n2. Money^n3. Armor^n4. Slight Speed^n^n0. Exit") show_menu(id,((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1< <9)),menuBody) return PLUGIN_HANDLED } What am i doing wrong??? Anyones help would be appreciated. Good Luck, and Thank You. By the way, this entire thing was done by me :| PLEASE HELP! |
Re: PLEASE HELP! MENU SCRIPTING!
indent your code please.
Code:
|
Re: PLEASE HELP! MENU SCRIPTING!
and you can try amxx studio, it has a menu generator
|
Re: PLEASE HELP! MENU SCRIPTING!
+ You haven't registered the cvar "amx_kyle". You'll have to register it in plugin_init():
Code:
And this: Code:
or something. |
Re: PLEASE HELP! MENU SCRIPTING!
I beleve 999 is maximum user speed.
|
Re: PLEASE HELP! MENU SCRIPTING!
1 Attachment(s)
Here is the .sma file, i figure it will be easier to understand.
Problem 1 : line 31 loose indentation Problem 2 : line 66 expected token "," but found "-string-" Problem 3 : line 66 expression has no affect Problem 4 : line 66 invalid expression assumed zero Once again thank you all, and hopefully you can help. :up: |
Re: PLEASE HELP! MENU SCRIPTING!
1 Attachment(s)
This one compiles without errors or warnings.
All credits goes to soccdoodcss. |
Re: PLEASE HELP! MENU SCRIPTING!
set_user_maxspeed(id, 1000.0)
1.0 is normal speed ( i beleve it's 320 ) 2.0 is twice as much. you only need like 3.2 to get max speed. |
Re: menu scripting
I fixed the subject of your thread for you.
Quote:
Do make your subject specific and descriptive of the issue you want help with. |
Re: menu scripting
Quote:
|
| All times are GMT -4. The time now is 06:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.