Raised This Month: $ Target: $400
 0% 

willing to help a noob on a noob script?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Revelation
Junior Member
Join Date: Jan 2005
Old 01-11-2005 , 14:03   willing to help a noob on a noob script?
Reply With Quote #1

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.
Attached Files
File Type: sma Get Plugin or Get Source (peepshowconfigloader.sma - 83 views - 1.4 KB)
Revelation is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode