[FilterScript] FPS Textdraw by De4dpOol.
#24

I made a few changes to your script, do whatever you want with it:

pawn Код:
#include <a_samp>

#define function%0(%1) forward%0(%1); public%0(%1)

new Text:tFPS,
PlayerText:ptFPS[2],
pLastDrunkLevel[MAX_PLAYERS],
pFPS[MAX_PLAYERS];

public OnFilterScriptInit()
{
    tFPS = TextDrawCreate(15.000000, 300.000000, "FPS:");
    TextDrawBackgroundColor(tFPS, 255);
    TextDrawFont(tFPS, 2);
    TextDrawLetterSize(tFPS, 0.400000, 1.000000);
    TextDrawColor(tFPS, -1);
    TextDrawSetOutline(tFPS, 1);
    TextDrawSetProportional(tFPS, 1);
    TextDrawUseBox(tFPS, 1);
    TextDrawBoxColor(tFPS, 255);
    TextDrawTextSize(tFPS, 165.000000, 0.000000);
    return 1;
}

public OnFilterScriptExit()
{
    TextDrawHideForAll(tFPS);
    TextDrawDestroy(tFPS);
    return 1;
}

public OnPlayerConnect(playerid)
{
    ptFPS[0] = CreatePlayerTextDraw(playerid, 66.000000, 300.000000, "100");
    PlayerTextDrawBackgroundColor(playerid, ptFPS[0], 255);
    PlayerTextDrawFont(playerid, ptFPS[0], 2);
    PlayerTextDrawLetterSize(playerid, ptFPS[0], 0.420000, 1.000000);
    PlayerTextDrawColor(playerid, ptFPS[0], -1);
    PlayerTextDrawSetOutline(playerid, ptFPS[0], 1);
    PlayerTextDrawSetProportional(playerid, ptFPS[0], 1);
    PlayerTextDrawShow(playerid, ptFPS[0]);

    ptFPS[1] = CreatePlayerTextDraw(playerid, 109.000000, 300.000000, "(GOOD)");
    PlayerTextDrawBackgroundColor(playerid, ptFPS[1], 255);
    PlayerTextDrawFont(playerid, ptFPS[1], 2);
    PlayerTextDrawLetterSize(playerid, ptFPS[1], 0.360000, 1.000000);
    PlayerTextDrawColor(playerid, ptFPS[1], -65281);
    PlayerTextDrawSetOutline(playerid, ptFPS[1], 1);
    PlayerTextDrawSetProportional(playerid, ptFPS[1], 1);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    TextDrawHideForPlayer(playerid, tFPS);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, tFPS);
    for(new i = 0; i < 2; i ++) PlayerTextDrawShow(playerid, ptFPS[i]);

    SetTimerEx("UpdateFPS", 500, true, "i", playerid);
    return 1;
}

function UpdateFPS(playerid)
{
    new string[10], olddrunklevel = pLastDrunkLevel[playerid], newdrunklevel = GetPlayerDrunkLevel(playerid);
    if(newdrunklevel < 100) SetPlayerDrunkLevel(playerid, 2000);
    else
    {
        if(olddrunklevel != newdrunklevel)
        {
            new temp = olddrunklevel - newdrunklevel;
            if(temp > 0 && temp < 100) pFPS[playerid] = temp;
            pLastDrunkLevel[playerid] = newdrunklevel;
        }
    }

    format(string, sizeof(string), "%d", pFPS[playerid]);
    PlayerTextDrawSetString(playerid, ptFPS[0], string);

    if(pFPS[playerid] > 20)
    {
        PlayerTextDrawSetString(playerid, ptFPS[1] , "(GOOD)");
        PlayerTextDrawColor(playerid, ptFPS[1] , 0x33AA33AA);
    }
    else if(pFPS[playerid] < 20)
    {
        PlayerTextDrawSetString(playerid, ptFPS[1] , "(BAD)");
        PlayerTextDrawColor(playerid, ptFPS[1] , 0xFF0000AA);
    }

    for(new i = 0; i < 2; i ++) PlayerTextDrawShow(playerid, ptFPS[i]);
    return 1;
}
Reply


Messages In This Thread
FPS Textdraw by De4dpOol. - by De4dpOol - 19.02.2015, 14:54
Re: FPS Textdraw by De4dpOol. - by DjoleJohnson - 19.02.2015, 21:13
Re: FPS Textdraw by De4dpOol. - by fonia5 - 19.02.2015, 21:29
Re: FPS Textdraw by De4dpOol. - by M0HAMMAD - 20.02.2015, 10:00
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 20.02.2015, 13:18
Re: FPS Textdraw by De4dpOol. - by Ritzy2K - 21.02.2015, 08:29
Re: FPS Textdraw by De4dpOol. - by Ritzy2K - 21.02.2015, 08:31
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 21.02.2015, 10:33
Re: FPS Textdraw by De4dpOol. - by arlindi - 21.02.2015, 21:11
Re: FPS Textdraw by De4dpOol. - by Ritzy2K - 23.02.2015, 04:43
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 23.02.2015, 09:55
Re: FPS Textdraw by De4dpOol. - by KayJ - 23.02.2015, 10:53
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 24.02.2015, 09:41
Re: FPS Textdraw by De4dpOol. - by Dry - 24.02.2015, 13:22
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 24.02.2015, 15:06
AW: FPS Textdraw by De4dpOol. - by Flori - 26.02.2015, 18:24
Re: AW: FPS Textdraw by De4dpOol. - by De4dpOol - 27.02.2015, 15:13
Re: FPS Textdraw by De4dpOol. - by mustajab97 - 02.03.2015, 08:51
Re: FPS Textdraw by De4dpOol. - by LOCS - 08.03.2015, 19:14
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 09.03.2015, 11:06
Re: FPS Textdraw by De4dpOol. - by Finnick - 09.03.2015, 11:27
Re: FPS Textdraw by De4dpOol. - by CalvinC - 09.03.2015, 11:35
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 09.03.2015, 13:06
Re: FPS Textdraw by De4dpOol. - by SickAttack - 10.03.2015, 00:31
Re: FPS Textdraw by De4dpOol. - by Salsa - 11.03.2015, 17:10
Re: FPS Textdraw by De4dpOol. - by Zalance - 13.03.2015, 04:15
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 17.03.2015, 14:49
Re: FPS Textdraw by De4dpOol. - by Mya - 17.03.2015, 14:56
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 21.03.2015, 14:16
Re: FPS Textdraw by De4dpOol. - by Karan007 - 21.03.2015, 14:21
Re : FPS Textdraw by De4dpOol. - by Wassimo - 22.03.2015, 22:55
Re: FPS Textdraw by De4dpOol. - by SupaVZ - 23.03.2015, 01:05
Re: FPS Textdraw by De4dpOol. - by Support - 23.03.2015, 06:48
Re: FPS Textdraw by De4dpOol. - by De4dpOol - 23.03.2015, 08:35

Forum Jump:


Users browsing this thread: 2 Guest(s)