Quote:
Originally Posted by gamer_Z
here you go:
pawn Код:
#include <a_samp>
new pDrunkLevelLast[MAX_PLAYERS]; new pFPS[MAX_PLAYERS];
public OnFilterScriptInit(){ SetTimer("DisplayFPS",1000,1); return 1; }
public OnPlayerConnect(playerid) { pDrunkLevelLast[playerid] = 0; pFPS[playerid] = 0; }
public OnPlayerUpdate(playerid) {
// handle fps counters.
new 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;
pDrunkLevelLast[playerid] = drunknew; }
}
}
damn, it's easy, useful and works
forward DisplayFPS(); public DisplayFPS(){ new FPSmsg[20]; for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i)){ format(FPSmsg,20,"Your FPS is: %d",pFPS[i]); //Show it here on-screen and set PVar } }
rest you can do yourself
|
it's easy, useful and works