SA-MP Forums Archive
FPS jump over 100 - 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 jump over 100 (/showthread.php?tid=632858)



FPS jump over 100 - iDark - 20.04.2017

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


Re: FPS jump over 100 - [WSF]ThA_Devil - 20.04.2017

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.


Re: FPS jump over 100 - DRIFT_HUNTER - 21.04.2017

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.