help please - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help please (
/showthread.php?tid=635100)
help please -
JuzDoiT - 01.06.2017
anti spam and anti command spam.

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;
}
also kick player when spamming 6 commands
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;
}
Re: help please -
JasonRiggs - 01.06.2017
This is for mute
Код:
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)
{
SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Sending A Message Again.");
return 0;
}
if(PlayerInfo[playerid][pTxtSpam] == 4)
{
PlayerInfo[playerid][pMute] = 1;
return 1;
}
return 1;
}
return 1;
}
This is for Kick
Код:
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.");
}
if(PlayerInfo[playerid][pCmdSpam] == 6)
{
Kick(playerid);
}
return 1;
}
Re: help please -
JuzDoiT - 01.06.2017
thanks
Re: help please -
Sew_Sumi - 01.06.2017
Cruising around other peoples servers, then screenshotting their features, coming back to the SA-MP forums and asking "how to do this" will only get you so far...
You're going to need to learn to script, and have ideas of your own.