[Tutorial] GetPlayerFPS example
#8

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
Reply


Messages In This Thread
GetPlayerFPS example - by JernejL - 28.08.2010, 22:33
Re: GetPlayerFPS example - by [03]Garsino - 28.08.2010, 22:37
Re: GetPlayerFPS example - by Brian_Furious - 28.08.2010, 22:46
Re: GetPlayerFPS example - by Kitten - 28.08.2010, 22:47
Re: GetPlayerFPS example - by JernejL - 28.08.2010, 23:15
Re: GetPlayerFPS example - by [03]Garsino - 28.08.2010, 23:50
Re: GetPlayerFPS example - by Gamer_Z - 29.08.2010, 00:06
Re: GetPlayerFPS example - by Brian_Furious - 29.08.2010, 00:13
Re: GetPlayerFPS example - by [L3th4l] - 29.08.2010, 00:20
Re: GetPlayerFPS example - by Flake. - 29.08.2010, 04:01
Re: GetPlayerFPS example - by nemesis- - 29.08.2010, 07:06
Re: GetPlayerFPS example - by JernejL - 29.08.2010, 08:25
Re: GetPlayerFPS example - by Hiddos - 29.08.2010, 08:47
Re: GetPlayerFPS example - by Calgon - 29.08.2010, 08:52
Re: GetPlayerFPS example - by Cank - 29.08.2010, 11:04
Re: GetPlayerFPS example - by MrDeath537 - 29.08.2010, 11:35
Re: GetPlayerFPS example - by [XST]O_x - 29.08.2010, 11:37
Re: GetPlayerFPS example - by JernejL - 29.08.2010, 20:41
Re: GetPlayerFPS example - by MrDeath537 - 29.08.2010, 22:12
Re: GetPlayerFPS example - by Flake. - 30.08.2010, 07:32
Re: GetPlayerFPS example - by ipsBruno - 09.09.2010, 14:51
Respuesta: GetPlayerFPS example - by TheChaoz - 20.09.2010, 04:43
Re: GetPlayerFPS example - by gymmyyy - 25.08.2011, 23:12
Re: GetPlayerFPS example - by Davz*|*Criss - 26.08.2011, 00:09
Re: GetPlayerFPS example - by Kaperstone - 26.08.2011, 09:50
AW: Re: GetPlayerFPS example - by Nero_3D - 26.08.2011, 13:10
Re: AW: Re: GetPlayerFPS example - by Kaperstone - 26.08.2011, 13:33
Re: GetPlayerFPS example - by Gh0sT_ - 26.08.2011, 13:58
Re: GetPlayerFPS example - by Kaperstone - 07.09.2011, 15:10
Re: GetPlayerFPS example - by mrsamp - 23.07.2012, 16:45
Re: GetPlayerFPS example - by Psat - 23.07.2012, 18:35
Re: GetPlayerFPS example - by JaKe Elite - 14.10.2012, 01:20
Re: GetPlayerFPS example - by Lordzy - 16.10.2012, 02:17

Forum Jump:


Users browsing this thread: 2 Guest(s)