Function GetPlayerFps

NozmaD

Администратор
Команда форума
Администратор
Сообщения
165
Баллы
208
Данная функция измеряет FPS игрока

C++:
stock GetPlayerFPS(playerid)
{
    SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
    if(GetPVarInt(playerid, "DrunkL") < 50)
    {
        SetPlayerDrunkLevel(playerid, 5000);
    }
    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;
}
Пример использования:
C++:
format(string,sizeof(string),"FPS игрока: %d", GetPlayerFPS(playerid));
 
Верх