PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
if(ServerInfo[ReadCmds] == 1)
{
new string[150];
format(string, sizeof(string)-1, "[Unknow CMD] %s [ID: %d] Command: %s", pName(playerid), playerid, cmdtext);
foreach (new i : Player)
{
if(PlayerInfo[i][Level] > PlayerInfo[playerid][Level] && PlayerInfo[i][Level] >= 6 && i != playerid)
{
SendClientMessage(i, 0xF6BB0AA, string);
}
}
}
ShowPlayerDialog(playerid, 199, DIALOG_STYLE_MSGBOX, "{b0b0b0}ERROR:Unknow Command", "\n{c6e2ff}you have typed an unknow commands.\n\n{c6e2ff}you can spawn any vehicles by type /veh\n\n{c6e2ff}Type /cmds and cmds2 to display the most commonly used commands", "Aceptar", "");
return 1;
}
else
{
if(ServerInfo[ReadCmds] == 1)
{
new string[150];
format(string, sizeof(string)-1, "[CMD] %s [ID: %d] Command: %s", pName(playerid), playerid, cmdtext);
foreach (new i : Player)
{
if(PlayerInfo[i][Level] > PlayerInfo[playerid][Level] && PlayerInfo[i][Level] >= 6 && i != playerid)
{
SendClientMessage(i, 0xF6BB0AA, string);
}
}
}
SetPVarInt(playerid, "PSPAM", 1); //spam to 1 use pvars so other scripts wont let you spam too
SetTimerEx("SpamDelay", 1000, false, "i", playerid); //delay
return 1;
}
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
{
if(strcmp(cmdtext,"/forgotpassword", true) == 1 || strcmp(cmdtext,"/forgotpassword", true) == -1 && strcmp(cmdtext,"/login", true) == 1 || strcmp(cmdtext,"/login", true) == -1)
{
SendClientMessage(playerid,red,"You are registered and not logged in!, login to use commands");
return 1;
}
return 0;
}
if(GetPVarInt(playerid, "PSPAM") == 1) //if spam still on
{
SendClientMessage(playerid, 0xFF0000FF, "Do not spam!");
return 0; //do not execute the command
}
return 1;
}