MessageToAdmins Spam - 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: MessageToAdmins Spam (
/showthread.php?tid=414908)
MessageToAdmins Spam -
Neil. - 10.02.2013
pawn Код:
forward CheckSpeed(playerid);
public CheckSpeed(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new speed = GetPlayerSpeed(playerid);
if(speed >= 365)
{
new message[256];
format(message, sizeof(message), "[Speed Hack] %s", PlayerName(playerid));
SendMessageToAllAdmins(message,0xFF0000AA);
}
return 1;
}
With a timer on the callback "OnPlayerConnect"
pawn Код:
SetTimerEx("CheckSpeed", 500, true, "i", playerid);
Long story short, when a player goes for more than 365 it sends a SPAM message every 500ms. How can I stop this and possibly alert the admins once every 10 minutes?
Re: MessageToAdmins Spam -
Backwardsman97 - 11.02.2013
Well it is doing what it's supposed to be. Try creating a variable to store the time when they are detected and check it before looking into them further.
Re: MessageToAdmins Spam -
Neil. - 11.02.2013
Quote:
Originally Posted by Backwardsman97
Well it is doing what it's supposed to be. Try creating a variable to store the time when they are detected and check it before looking into them further.
|
Thanks. Though I created a new variable not to store time, but to store if it's already been detected.
Re: MessageToAdmins Spam -
kamzaf - 14.03.2013
pawn Код:
forward CheckSpeed(playerid);
public CheckSpeed(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new speed = GetPlayerSpeed(playerid);
if(speed >= 365)
{
SetTimerEx("SpeedMessage", 10000, false, "i", playerid);
return 1;
}
return 1;
}
forward SpeedMessage(playerid);
public SpeedMessage(playerid)
{
new message[256];
format(message, sizeof(message), "[Speed Hack] %s", PlayerName(playerid));
SendMessageToAllAdmins(message,0xFF0000AA);
return 1;
}
Note: I haven't tested this so this may not work.