FPS jump over 100
#1

Hello,

I'm using this to get player FPS
Код:
new drunknew = GetPlayerDrunkLevel(playerid), fps[100];
			if (drunknew < 100) { 
				SetPlayerDrunkLevel(playerid, 2000);
			} else {

				if(playerVariables[playerid][pDrunkLevelLast] != drunknew) {

					new wfps = playerVariables[playerid][pDrunkLevelLast] - drunknew;

					if ((wfps > 0) && (wfps < 200))
						playerVariables[playerid][pFPS] = wfps;

					playerVariables[playerid][pDrunkLevelLast] = drunknew;
				}
			}
, but from time to time (some minutes) FPS jumps to 180+ (for one second) and then is normal again. This function is called every second.

What is the problem?

I tried on a empty script and same problem...
Reply
#2

Timers aren't perfect in sa-mp and they tend to not be accurate once in a while. Client/Server lag can cause this as well.
Reply
#3

You are relying on calculating how fast player drunk level is getting down/lower. If there was a lag (delay) between your server and client it would affect that calculation and that explains why its usually normal but it spikes sometimes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)