SA-MP Forums Archive
FPS - 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: FPS (/showthread.php?tid=586655)



FPS - SumX - 23.08.2015

Hello ! Is this efficient? It will make lag? i want to detect the FPS

PHP код:
new pDrunkLevelLast[MAX_PLAYERS];
new 
pFPS[MAX_PLAYERS];
 
public 
OnPlayerConnect(playerid) {
    
pDrunkLevelLast[playerid]    = 0;
    
pFPS[PlayerID]            = 0;
}
 
public 
OnPlayerUpdate(playerid) {
    
    
// handle fps counters.
    
    
new drunknew;
    
drunknew GetPlayerDrunkLevel(playerid);
    
    if (
drunknew 100) { // go back up, keep cycling.
        
SetPlayerDrunkLevel(playerid2000);
    } else {
        
        if (
pDrunkLevelLast[playerid] != drunknew) {
            
            new 
wfps pDrunkLevelLast[playerid] - drunknew;
            
            if ((
wfps 0) && (wfps 200))
                
pFPS[playerid] = wfps;
            
            
pDrunkLevelLast[playerid] = drunknew;
        }
        
    }
    




Re: FPS - Abagail - 23.08.2015

It's not the most efficient, but it's not the worst either. A very bad side effect of this is that you won't be able to use the SetPlayerDrunkLevel functions since the FPS system will constantly change the player's drunk level.


Re: FPS - SumX - 23.08.2015

So are there another FPS getting methods?


Re: FPS - Abagail - 23.08.2015

It should work fine.


Re: FPS - SumX - 23.08.2015

I have a /drink command using setplayerdrunklevel so whithout the drunk level there is no fun anymore.


Re: FPS - DarkLored - 23.08.2015

Quote:
Originally Posted by SumX
Посмотреть сообщение
I have a /drink command using setplayerdrunklevel so whithout the drunk level there is no fun anymore.
Then decide if you want to have an FPS checker without being able to use the drunk effect in your command or you won't make the FPS checker and you'll be able to use the command with the effect. There are many video recorders that show your fps out there, in my opinion the FPS feature in a server is unnecessary as you are being limited after doing so.