Server Attack - B0t - Ping - ETC
#14

Just something I was thinking of... Try in OnPlayerConnect well.. Add this:
pawn Code:
#define MAX_PING_ALLOWED 1000 // Or whatever you want it to be.
public OnPlayerConnect(playerid)
{
    if(GetPlayerPing(playerid) >= MAX_PING_ALLOWED)
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "You have been kicked. Reason: Max Ping.");
        Kick(playerid);
    }
    return 1;
}
// OR:

// Add to OnGameModeInit:

SetTimer("PingCheckTimer", 5000, true); // 5000 == 5 Seconds. True == Repeating Timer. False == Non-Repeating Timer. // Meaning it will repeat the check, every 5 seconds.

// And now the Checker.

#define MAX_PING_ALLOWED 1000 // Or whatever you want it to be.
forward PingCheckTimer(playerid);
public PingCheckTimer(playerid)
{
    // Kick players with a high ping
    if(GetPlayerPing(playerid) >= MAX_PING_ALLOWED)
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "You have been kicked. Reason: Max Ping."); // 0xFFFFFFAA  == White.
        Kick(playerid);
    }
    return 1;
}
For more help, visit: https://sampwiki.blast.hk/wiki/Category:..._Documentation
- Scripting Help.
For more help specifically with this (What I just gave.).
Visit:
Reply


Messages In This Thread
Server Attack - B0t - Ping - ETC - by nGen.SoNNy - 04.07.2012, 13:05
Re: Server Attack - B0t - Ping - ETC - by tiernantheman - 04.07.2012, 13:16
Re: Server Attack - B0t - Ping - ETC - by dugi - 04.07.2012, 13:17
Re: Server Attack - B0t - Ping - ETC - by nGen.SoNNy - 04.07.2012, 13:27
Re: Server Attack - B0t - Ping - ETC - by Mark™ - 04.07.2012, 13:29
Re: Server Attack - B0t - Ping - ETC - by nGen.SoNNy - 04.07.2012, 13:36
Re: Server Attack - B0t - Ping - ETC - by Mark™ - 04.07.2012, 14:00
Re: Server Attack - B0t - Ping - ETC - by [SF]OutLawZ - 04.07.2012, 14:47
Re: Server Attack - B0t - Ping - ETC - by nGen.SoNNy - 04.07.2012, 15:14
Re: Server Attack - B0t - Ping - ETC - by ColorHost-Kevin - 04.07.2012, 15:26
Re: Server Attack - B0t - Ping - ETC - by nGen.SoNNy - 04.07.2012, 16:42
Re: Server Attack - B0t - Ping - ETC - by int3s0 - 04.07.2012, 19:40
Re: Server Attack - B0t - Ping - ETC - by Mark™ - 05.07.2012, 04:04
Re: Server Attack - B0t - Ping - ETC - by Dubya - 05.07.2012, 04:43

Forum Jump:


Users browsing this thread: 1 Guest(s)