SA-MP Forums Archive
[Pedido] GetPlayerFPS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] GetPlayerFPS (/showthread.php?tid=372420)



GetPlayerFPS - GhosT_[] - 26.08.2012

Olб pessoal estava a procura da funзгo em que geta o FPS do player procurei no shearch e no ****** e oque eu achei foi essa stock que nгo funciona pois quando vou ver o FPS sempre estб 0

se alguйm souber ai porfavor preciso muito desta funзгo

a stock que eu achei e nгo funciona й essa
pawn Код:
stock GetPlayerFPS(playerid)
{
    SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
    if(GetPVarInt(playerid, "DrunkL") < 100)
    {
        SetPlayerDrunkLevel(playerid, 2000);
    }
    else
    {
        if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
        {
            SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
            SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
            if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
            {
                return GetPVarInt(playerid, "FPS") - 1;
            }
        }
    }
    return 0;
}
OBS: nгo sei se falta algo para fazer ela funcionar

Obrigado a todos desde jб


Re: GetPlayerFPS - Crueliz0n - 26.08.2012

pawn Код:
// inicio
static pFPS[MAX_PLAYERS], pDrunkLevelLast[MAX_PLAYERS];  // FPS

public OnPlayerUpdate(playerid)
{
    new drunknew = GetPlayerDrunkLevel(playerid);
    if(drunknew < 100) return SetPlayerDrunkLevel(playerid, 2000);
    else
    {
        if (pDrunkLevelLast[playerid] != drunknew)
        {
            new wfps = pDrunkLevelLast[playerid] - drunknew;
            if ((wfps > 0) && (wfps < 200)) pFPS[playerid] = wfps;
            pDrunkLevelLast[playerid] = drunknew;
        }
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    pDrunkLevelLast[playerid] = 0;
    pFPS[playerid] = 0;
    return 1;
}


// variavel pra getar fps -
pFPS[playerid]



Re: GetPlayerFPS - GhosT_[] - 26.08.2012

Vou testar aqui ja volto pra ver se deu certo

@EDIT

Funcionou valeu donnely ^^