#1

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;
        }
        
    }
    

Reply
#2

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

So are there another FPS getting methods?
Reply
#4

It should work fine.
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)