AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help... (https://forums.alliedmods.net/showthread.php?t=47106)

USvER 11-10-2006 07:35

Help...
 
Hello from Ukraine...
Sorry for my English...
I'm beginner and i need help...

I want to create plugin that gives all gamers: "sv_restart 1" and "changelevel ..."
Code:
#include <amxmodx> #include <amxmisc> new PLUGIN[]="Cuted Rights" new AUTHOR[]="USvER" new VERSION[]="0.01b" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("server_restart", "server_restart", ADMIN_SLAY, "")      register_concmd("server_changelevel", "server_changelevel", ADMIN_SLAY, "<map>")      return PLUGIN_CONTINUE } public server_changelevel() {      new Arg1[24]      read_argv(1, Arg1, 23)      server_exec("changelevel %s",Arg1)      return PLUGIN_HANDLED } public server_restart() {      server_exec("sv_restart","1")      return PLUGIN_HANDLED }

And i get error:
Code:

usver.sma(20) : error 088: number of arguments does not match definition
usver.sma(26) : error 088: number of arguments does not match definition

What is a problem in? I can't find the arguments for "server_exec()"...

jim_yang 11-10-2006 09:04

Re: Help...
 
yea, server_exec() has no arguments
use server_cmd(" ")
besides server_changelevel() is a forward, you'd better change the concmd name.

USvER 11-10-2006 10:12

Re: Help...
 
Thx... Now its working...
Good idea to make plugin like firewall with rules like:
user_identifier:command1[param1|param2|paramN],command2[param1|param2|paramN],commandN[param1|param2|paramN]
To open usage of some commands to some_user


All times are GMT -4. The time now is 06:54.

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