01.06.2017, 12:09
anti spam and anti command spam.
![](http://i.imgur.com/Y4m23SS.png)
i want to mute player when player sent message 4
"Please Wait Before Sending a message again"
here is anti spam
also kick player when spamming 6 commands
here is command spam
![](http://i.imgur.com/Y4m23SS.png)
i want to mute player when player sent message 4
"Please Wait Before Sending a message again"
here is anti spam
PHP код:
public OnPlayerText(playerid, text[])
{
if (PlayerInfo[playerid][pMute] == 0 && PlayerInfo[playerid][pTextdraw] == 0)
{
if (!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] == 0) PlayerInfo[playerid][pTxtSpam] ++;
if (PlayerInfo[playerid][pTxtSpam] == 3 || PlayerInfo[playerid][pTxtSpam] == 4 || PlayerInfo[playerid][pTxtSpam] == 5)
{
SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Sending A Message Again.");
return 0;
}
return 1;
}
return 1;
}
here is command spam
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if (!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] == 0) PlayerInfo[playerid][pCmdSpam] ++;
if (PlayerInfo[playerid][pCmdSpam] == 3 || PlayerInfo[playerid][pCmdSpam] == 4 || PlayerInfo[playerid][pCmdSpam] == 5)
{
return SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Using A Command Again.");
}
return 1;
}