Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("PeepShowConfigLoader","1","Revelation")
register_menucmd(register_menuid("Choose Option"), keys, "LoadConfig")
register_clcmd("peepshowcfgmenu", "ShowPSCfgMenu")
}
public ShowPSCfgMenu(id)
{
new menu[256]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5
format(menu, 255, "Choose Option^n^n1. Load PUBLIC Server Settings^n2. Load WAR Server Settings^n3. 3 Restarts then Live^n4. 4 Restarts the Knives^n5. Restart Round")
show_menu(id, key, menu)
return PLUGIN_HANDLED
}
public LoadConfig(id, key)
{
if (key == 0)
{
server_cmd("exec cfgs/public.cfg")
}
else if (key == 1)
{
server_cmd("exec cfgs/war.cfg")
}
else if (key == 2)
{
server_cmd("exec cfgs/live.cfg")
}
else if (key == 3)
{
server_cmd("exec cfgs/knives.cfg")
}
else if (key == 4)
{
server_cmd("sv_restartround 1")
}
}
As you can see I know nothing at all about scripting, I tried to copy it from the amxmodx help files. Im trying to make a menu with 5 options for my server. I get a couple of errors, they are
Code:
/home/users/amxmodx/tmp/phpLw775l.sma(1) : error 055: start of function body without function header
/home/users/amxmodx/tmp/phpLw775l.sma(4) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp/phpLw775l.sma(11) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp/phpLw775l.sma(20) : error 029: invalid expression, assumed zero
4 Errors.
please can someone fix it, Ive tried for ages
p.s I'd like 2 more things adding to it, that I dunno what to do, they are:
1. Another option, when a user presses the 0 key it exists the meny
2. Id like it so that only admins with admin level "u" or "ADMIN_MENU" can load the menu
Thanks in advance Rev.