MessageToAdmins Spam
#1




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?
Reply
#2

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.
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)