29.08.2010, 00:06
here you go:
rest you can do yourself
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;
}
}
}
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
}
}