anti spam cmd help
#5

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
Try this:
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
     if(!
success)
     {
        if(
ServerInfo[ReadCmds] == 1)
        {
               new 
string[150];
               
format(stringsizeof(string)-1"[Unknow CMD] %s [ID: %d] Command: %s"pName(playerid), playeridcmdtext);
            foreach (new 
Player)
            {
                   if(
PlayerInfo[i][Level] > PlayerInfo[playerid][Level] && PlayerInfo[i][Level] >= && != playerid)
                   {
                    
SendClientMessage(i0xF6BB0AAstring);
                }
            }
        }
        
ShowPlayerDialog(playerid199DIALOG_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(stringsizeof(string)-1"[CMD] %s [ID: %d] Command: %s"pName(playerid), playeridcmdtext);
            foreach (new 
Player)
            {
                if(
PlayerInfo[i][Level] > PlayerInfo[playerid][Level] && PlayerInfo[i][Level] >= && != playerid)
                {
                    
SendClientMessage(i0xF6BB0AAstring);
                }
            }
        }
        
SetPVarInt(playerid"PSPAM"1); //spam to 1 use pvars so other scripts wont let you spam too
        
SetTimerEx("SpamDelay"1000false"i"playerid); //delay
        
return 1;
    }
    return 
1;
}
public 
OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
PlayerInfo[playerid][Registered] == && PlayerInfo[playerid][LoggedIn] == 0)
    {
        if(
strcmp(cmdtext,"/forgotpassword"true) == || strcmp(cmdtext,"/forgotpassword"true) == -&& strcmp(cmdtext,"/login"true) == || 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(playerid0xFF0000FF"Do not spam!");
        return 
0//do not execute the command
    
}
    return 
1;

thanks I work but this bug anti spam cmd bug does not walk the cmd of the gamemode
Reply


Messages In This Thread
anti spam cmd help - by nbx2000 - 20.05.2018, 16:18
Re: anti spam cmd help - by Lokii - 20.05.2018, 16:35
Re: anti spam cmd help - by nbx2000 - 20.05.2018, 17:15
Re: anti spam cmd help - by Kraeror - 20.05.2018, 17:26
Re: anti spam cmd help - by nbx2000 - 20.05.2018, 17:50
Re: anti spam cmd help - by nbx2000 - 21.05.2018, 04:21

Forum Jump:


Users browsing this thread: 1 Guest(s)