anti spam cmd help
#2

PHP код:

public OnPlayerConnect(playerid)
{
    
SetPVarInt(playerid"PSPAM"0);
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    
SetPVarInt(playerid"PSPAM"0); //reset spam on disconnect
    
return 1;
}
public 
OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(
success)
    {
         
SetPVarInt(playerid"PSPAM"1); //spam to 1 use pvars so other scripts wont let you spam too
            
SetTimerEx("SpamDelay"1000false"i"playerid); //delay
    
}
}
public 
OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
GetPVarInt(playerid"PSPAM") == 1//if spam still on
    
{
        
SendClientMessage(playerid0xFF0000FF"Do not spam!");
        return 
0//do not execute the command
    
}
    return 
1;
}
forward SpamDelay(playerid);
public 
SpamDelay(playerid)
{
    
SetPVarInt(playerid"PSPAM"0); //setting to no spam after 1 second

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)