02.06.2013, 07:49
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:
But they won't be called too. I haven't got any filterscripts loaded. What could be the problem?
Regards.
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;
}
Regards.

