open.mp forum
[Pawn] How do i get a player FPS? - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] How do i get a player FPS? (/showthread.php?tid=1834)



How do i get a player FPS? - Cosmic - 2021-04-04

How do i get a player FPS with GetPlayerDrunkLevel ??


RE: How do i get a player FPS? - ImOver - 2021-04-04

(2021-04-04, 07:46 AM)Cosmic Wrote: How do i get a player FPS with GetPlayerDrunkLevel ??



Hey. Take a look at this.



https://github.com/PatrickGTR/gta-open/blob/master/gamemodes/utils/utils_player.inc#L6


RE: How do i get a player FPS? - destiezk - 2021-04-04

Code:
stock GetPlayerFPS(playerid) return pFPS[playerid];

new pDrunkLeveLast[MAX_PLAYERS];



    new drunknew;

    drunknew = GetPlayerDrunkLevel(playerid);

    if (drunknew < 100) {

        SetPlayerDrunkLevel(playerid, 2000);

    } else {



        if (pDrunkLevelLast[playerid] != drunknew) {



            new wfps = pDrunkLevelLast[playerid] - drunknew;



            if ((wfps > 0) && (wfps < 400))

            pFPS[playerid] = wfps;



            pDrunkLevelLast[playerid] = drunknew;

        }



    }

and call GetPlayerFPS(playerid); where you have to.


RE: How do i get a player FPS? - Cosmic - 2021-04-07

Works. Thanks