OnRconCommand - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnRconCommand (
/showthread.php?tid=441250)
OnRconCommand -
IgrexolonO - 02.06.2013
Hello! I'm trying to write commands in onrconcommand in any way, but every single command I wrote won't be called.
I was trying even commands from other topics on this forum, like:
Код:
public OnRconCommand(cmd[])
{
if(!strcmp(cmd, "msg", false, 3))
{// length of "msg" ^
new
msg[128],
user;
if(sscanf(cmd[3], "us[128]", user, msg))
{// ^ length of "msg"
print("SYNTAX: msg [user] [message]");
return 1;
}
if(user != INVALID_PLAYER_ID)
{
SendClientMessage(user, -1, msg);
}
else
{
print("ERROR: player is not connected.");
}
return 1;
}
if(!strcmp(cmd, "restart", false, 7))
{// length of "restart" ^
new
time;
if(sscanf(cmd[7], "d", time))
{// ^ length of "restart"
print("SYNTAX: restart [time]");
return 1;
}
printf("SERVER: server will restart in %d seconds.", time);
SetTimer("Rcon_Restart", time * 1000, false);
return 1;
}
return 1;
}
But they won't be called too. I haven't got any filterscripts loaded. What could be the problem?
Regards.
AW: OnRconCommand -
Nero_3D - 02.06.2013
Quote:
Originally Posted by IgrexolonO
What could be the problem?
|
Quote:
Originally Posted by IgrexolonO
I haven't got any filterscripts loaded.
|
OnRconCommand - Read the important note
Just put that into a filterscript, compile it and load it when the server starts
pawn Код:
forward OnRconCommand(cmd[]); public OnRconCommand(cmd[]) return false;
Re: AW: OnRconCommand -
IgrexolonO - 02.06.2013
Lol. Thank you.
Regards.