[FilterScript] FPS Textdraw by De4dpOol.
#21

Good Job Dude, REP++ For You
Reply
#22

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.
Reply
#23

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.
Reply
#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
#25

it seems good
Reply
#26

wow .. Sleek and Elegant
Reply
#27

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

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

wow, nice one for freeroam server
Reply
#29

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

Good job
Reply
#31

Nice Filter script +1 rep
Reply
#32

very nice
Reply
#33

Good job.
Reply
#34

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)