Raised This Month: $ Target: $400
 0% 

Need help with a restart plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
faliment
New Member
Join Date: Dec 2009
Old 12-24-2009 , 17:11   Re: Need help with a restart plugin
Reply With Quote #3

Thank you, now it works.

I found this somewhere, but when i execute any of the commands in that plugin, is says that the command is uknown, but still works.

Code:
public restartround(id,level,cid) 
{
	if (!cmd_access(id,level,cid,1))
		return PLUGIN_HANDLED
	cvar_cmd(id,"sv_restartround")
	return PLUGIN_CONTINUE
}

cvar_cmd(id,cvarname[]) 
{
	
	if (read_argc() > 1) 
	{ 
		new cmd[32], argv[32]
		read_argv(0,cmd,31)
		read_argv(1,argv,31)
		set_cvar_string(cvarname,argv)
		show_cmd(id,cmd,argv)
		return PLUGIN_HANDLED
	}
	new cmd[32], argv[32]
	read_argv(0,cmd,31)
	read_argv(1,argv,31)
	get_cvar_string(cvarname,argv,31)
	console_print(id,"^"%s^" is set to ^"%s^"",cvarname,argv)
	return PLUGIN_CONTINUE
}
show_cmd(id,cmd[],data[]) 
{
	new name[32]
	get_user_name(id,name,31)
	switch(get_cvar_num("amx_show_activity")) 
	{
		case 2:	client_print(0,print_chat,"ADMIN %s: %s %s",name,cmd,data)
		case 1:	client_print(0,print_chat,"ADMIN: %s %s",cmd,data)
	}
}
Here's what i'm saying: it works but still shows that unknown command. what can i do to fix it?

amx_restart 1
"sv_restartround" changed to "1"
Unknown command: amx_restart
The game will restart in 1 SECOND

And which method is more efficient if there is more than one command in the plugin? The first one posted, or this one?

Last edited by faliment; 12-24-2009 at 17:14.
faliment is offline
 



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 04:06.


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