question
#5

This uses JerneJL's GetPlayerFPS.

pawn Код:
#define   MIN_FPS    25 //feel free to change

new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
 
public OnPlayerConnect(playerid) {
    pDrunkLevelLast[playerid]   = 0;
    pFPS[PlayerID]          = 0;
}
 
public OnPlayerUpdate(playerid) {
   
   
    new drunknew;
    drunknew = GetPlayerDrunkLevel(playerid);
   
    if (drunknew < 100) { // go back up, keep cycling.
        SetPlayerDrunkLevel(playerid, 2000);
    } else {
       
        if (pDrunkLevelLast[playerid] != drunknew) {
           
            new wfps = pDrunkLevelLast[playerid] - drunknew;
           
            if ((wfps > 0) && (wfps < 200)) {
                pFPS[playerid] = wfps;
            }

            if ((wfps > 0) && (wfps < MIN_FPS)) {
                pFPS[playerid]= wfps;
                //kick the player here
            }

            pDrunkLevelLast[playerid] = drunknew;
        }
       
    }
   
}
Reply


Messages In This Thread
question - by ivndosos - 19.02.2018, 19:52
Re: question - by RxErT - 19.02.2018, 20:03
Re: question - by ivndosos - 19.02.2018, 20:05
Re: question - by RxErT - 19.02.2018, 20:09
Re: question - by GRiMMREAPER - 19.02.2018, 20:12
Re: question - by Mugala - 19.02.2018, 22:11
Re: question - by ivndosos - 20.02.2018, 03:32
Re: question - by PepsiCola23 - 20.02.2018, 11:13
Re: question - by NaS - 20.02.2018, 12:09

Forum Jump:


Users browsing this thread: 1 Guest(s)