Problem
#1

Hi guys,i've created a textdraw to show my FPS but i've got a problem.

The Textdraw shows only: Your FPS: 0.

Here is the code:

new Text:FPSTD;

OnGameModeInit

pawn Код:
FPSTD = TextDrawCreate(500.000000, 101.000000, "Your FPS:");
    TextDrawBackgroundColor(FPSTD, 255);
    TextDrawFont(FPSTD, 1);
    TextDrawLetterSize(FPSTD, 0.449999, 1.799999);
    TextDrawColor(FPSTD, -16776961);
    TextDrawSetOutline(FPSTD, 1);
    TextDrawSetProportional(FPSTD, 1);
OnPlayerConnect

pawn Код:
new newtext[128];
    format(newtext, sizeof(newtext), "Your FPS: %d", GetPlayerFPS(playerid));
    TextDrawSetString(FPSTD, newtext);
    TextDrawShowForPlayer(playerid, FPSTD);
The stock:

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;
}
Thanks.
Reply


Messages In This Thread
Problem - by Face9000 - 09.06.2011, 09:26
Re: Problem - by *IsBack - 09.06.2011, 11:50

Forum Jump:


Users browsing this thread: 1 Guest(s)