SA-MP Forums Archive
[FilterScript] FPS Textdraw by De4dpOol. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] FPS Textdraw by De4dpOol. (/showthread.php?tid=564098)

Pages: 1 2


Re: FPS Textdraw by De4dpOol. - Finnick - 09.03.2015

Good Job Dude, REP++ For You


Re: FPS Textdraw by De4dpOol. - CalvinC - 09.03.2015

I haven't looked too much into this code, so it might not be an issue, but otherwise the problem with this method is that it can ruin actual drunk levels.
And also it wont work when you're ethically spectating, it'll just show -1.


Re: FPS Textdraw by De4dpOol. - De4dpOol - 09.03.2015

Quote:
Originally Posted by Finnick
Посмотреть сообщение
Good Job Dude, REP++ For You
Thank you

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
I haven't looked too much into this code, so it might not be an issue, but otherwise the problem with this method is that it can ruin actual drunk levels.
And also it wont work when you're ethically spectating, it'll just show -1.
Yes but I don't know any other method or probably there is no other methods till now. But if there is any method I would be glad to know it.


Re: FPS Textdraw by De4dpOol. - SickAttack - 10.03.2015

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;
}



Re: FPS Textdraw by De4dpOol. - Salsa - 11.03.2015

it seems good


Re: FPS Textdraw by De4dpOol. - Zalance - 13.03.2015

wow .. Sleek and Elegant


Re: FPS Textdraw by De4dpOol. - De4dpOol - 17.03.2015

Quote:
Originally Posted by Salsa
Посмотреть сообщение
it seems good
Thank you

Quote:
Originally Posted by Zalance
Посмотреть сообщение
wow .. Sleek and Elegant
Thanks man.


Re: FPS Textdraw by De4dpOol. - Mya - 17.03.2015

wow, nice one for freeroam server


Re: FPS Textdraw by De4dpOol. - De4dpOol - 21.03.2015

Quote:
Originally Posted by Mya
Посмотреть сообщение
wow, nice one for freeroam server
Thank you. It can be used for TDM servers too.


Re: FPS Textdraw by De4dpOol. - Karan007 - 21.03.2015

Good job


Re : FPS Textdraw by De4dpOol. - Wassimo - 22.03.2015

Nice Filter script +1 rep


Re: FPS Textdraw by De4dpOol. - SupaVZ - 23.03.2015

very nice


Re: FPS Textdraw by De4dpOol. - Support - 23.03.2015

Good job.


Re: FPS Textdraw by De4dpOol. - De4dpOol - 23.03.2015

Quote:
Originally Posted by karan007
Посмотреть сообщение
Good job
Thanks.

Quote:
Originally Posted by Wassimo
Посмотреть сообщение
Nice Filter script +1 rep
Thank you +1.

Quote:
Originally Posted by SupaVZ
Посмотреть сообщение
very nice
Thanks mate.

Quote:
Originally Posted by Support
Посмотреть сообщение
Good job.
Thank you