public OnRconCommand(cmd[])
{
printf("You typed %s!",cmd);
return 1;
}
if(cmd == "ban 1")
if(strcmp(cmd, "ban", true) == 0)
// or
if(strcmp(cmd, "rcon ban", true) == 0)
public OnRconCommand(cmd[])
{
if(strcmp(cmd, "rcon gmx", true) == 0)
{
SaveAccount();
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Server is restarting!");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Account's saved!");
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendRconCommand("gmx");
}
if(strcmp(cmd, "gmx", true) == 0)
{
SaveAccount();
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Server is restarting!");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Account's saved!");
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendRconCommand("gmx");
}
if(strcmp(cmd, "/rcon gmx", true) == 0)
{
SaveAccount();
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Server is restarting!");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Account's saved!");
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendRconCommand("gmx");
}
return 1;
}
if(!strcmp(cmd, "gmx", true))
{
//code here
}
public OnRconCommand(cmd[])
{
if(strcmp(cmd, "gmx", true) == 0)
{
SaveAccount();
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Server is restarting!");
SendClientMessageToAll(COLOR_GREEN,"( ! ) Server: Account's saved!");
SendClientMessageToAll(COLOR_YELLOW,"_____________________________________");
SendRconCommand("gmx");
}
return 1;
}
OnRconCommand works in filterscripts only.
And this code is the right one, but I think you can't redefine already existing RCON commands like "gmx". pawn Код:
|