[Ajuda] Getando FPS do player
#1

Ele ta dando erro no GetPlayerFPS

Topo do gm:
pawn Код:
new Text:fpsfps[MAX_PLAYERS];
forward Fpstenso(playerid);
OnGameModeInit

pawn Код:
SetTimer("Fpstenso", 80, 1);
//********************************
            for(new i = 0; i < MAX_PLAYERS; i++)
    {
        fpsfps[i] = TextDrawCreate(570.0, 340.0, " ");
        TextDrawBackgroundColor(fpsfps[i], 16711935);
        TextDrawFont(fpsfps[i], 1);
        TextDrawLetterSize(fpsfps[i], 0.389999, 0.899999);
        TextDrawColor(fpsfps[i], 255);
        TextDrawSetOutline(fpsfps[i], 1);
        TextDrawSetProportional(fpsfps[i], 1);
        }
Final do gm
pawn Код:
public Fpstenso()
{
            for(new i=0; i<MAX_PLAYERS; i++)
            {
            new string[64];
            TextDrawShowForPlayer(i, fpsfps[i]);
            format(string,sizeof(string),"Fps: %i" ,GetPlayerFps(i));
            TextDrawSetString(fpsfps[i], string);
            }
}
Erro nesta linha:
pawn Код:
format(string,sizeof(string),"Fps: %i" ,GetPlayerFps(i));
Reply
#2

Eu acho que nгo vai fazer muita diferenзa, mas experimente utilizar ' %d ' ao invйs de ' %i '.
Reply
#3

Ele da erro no GetPlayerFPS
Reply
#4

Devia ser:
pawn Код:
format(string,sizeof(string),"Fps: %i" ,GetPlayerFPS(i));
FPS Maнusculo nгo?
Reply
#5

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]
By BlackDonelly
Reply
#6

Amigo ::::
pawn Код:
D:\****\0.3e\gamemodes\BMMC.pwn(8253) : error 017: undefined symbol "GetPlayerFPS"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Da erro do mesmo geito
Reply
#7

da uma olhada neste topico, pode te ajudar

https://sampforum.blast.hk/showthread.php?tid=172085
Reply
#8

Quote:
Originally Posted by LeLeTe
Посмотреть сообщение
Eu acho que nгo vai fazer muita diferenзa, mas experimente utilizar ' %d ' ao invйs de ' %i '.
Nгo vai fazer diferenзa nenhuma...

Poste a funзгo que Pega o FPS.
Reply
#9

Quote:
Originally Posted by Tony_Rodrigues
Посмотреть сообщение
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]
By BlackDonelly
Use isto e coloque isto no final do gm

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;
}
Reply
#10

Cara, eu conseguir, porйm o lag que da no servidor й insuportavel.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)