LOW FPS
#1

Anyone help me for Anti Low FPS ??
If your fps is 16 you have kick from the server
Reply
#2

pawn Код:
#include <a_samp>

#define MIN_FPS_ALLOWED     16
#define MAX_FPS_WARNINGS    5

IsPlayerSpawned(playerid)
{
    switch(GetPlayerState(playerid))
    {
        case 1, 2, 3, 8:
            return 1;
    }
    return 0;
}

public OnPlayerUpdate(playerid)
{
    static  old_drunk       [MAX_PLAYERS],
            fps_warnings    [MAX_PLAYERS];

    if(IsPlayerSpawned(playerid))
    {
        new new_drunk = GetPlayerDrunkLevel(playerid);
        if(new_drunk <= 100)
            SetPlayerDrunkLevel(playerid, 2000);
        else if(new_drunk != old_drunk[playerid])
        {
            new fps = old_drunk[playerid] - new_drunk;
            if(fps >= 0)
            {
                if(fps <= MIN_FPS_ALLOWED)
                {
                    if(++ fps_warnings[playerid] >= MAX_FPS_WARNINGS)
                    {
                        Kick(playerid);
                        fps_warnings[playerid] = 0;
                    }
                }
                else if(fps_warnings[playerid] > 0)
                    fps_warnings[playerid] = 0;
            }
            old_drunk[playerid] = new_drunk;
        }
    }
    else if(fps_warnings[playerid] > 0)
        fps_warnings[playerid] = 0;
    return 1;
}
I didn't test this but it should work. Try it out and tell me if it doesn't work!
Reply
#3

EDIT: nevermind
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)