SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 09/03/2015, 11:27 AM   #21
Finnick
Banned
 
Join Date: Feb 2015
Location: Yeah
Posts: 40
Reputation: 12
Default Re: FPS Textdraw by De4dpOol.

Good Job Dude, REP++ For You
Finnick is offline   Reply With Quote
Old 09/03/2015, 11:35 AM   #22
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,830
Reputation: 114
Default Re: FPS Textdraw by De4dpOol.

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.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 09/03/2015, 01:06 PM   #23
De4dpOol
Huge Clucker
 
De4dpOol's Avatar
 
Join Date: Oct 2014
Posts: 214
Reputation: 39
Default Re: FPS Textdraw by De4dpOol.

Quote:
Originally Posted by Finnick View Post
Good Job Dude, REP++ For You
Thank you

Quote:
Originally Posted by CalvinC View Post
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.
De4dpOol is offline   Reply With Quote
Old 10/03/2015, 12:31 AM   #24
SickAttack
High-roller
 
Join Date: Dec 2013
Posts: 4,768
Reputation: 754
Default Re: FPS Textdraw by De4dpOol.

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

pawn Code:
#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;
}
SickAttack is offline   Reply With Quote
Old 11/03/2015, 05:10 PM   #25
Salsa
Huge Clucker
 
Salsa's Avatar
 
Join Date: Apr 2011
Location: Tokoyo, Japan
Posts: 438
Reputation: 13
Default Re: FPS Textdraw by De4dpOol.

it seems good
__________________
Hosted Tab For 13$ Per Month : DISABLE NOW
Mapping For $ Pm Me If You Want Maps
Need Registered IRC Channel Pm Me I Can Make Irc Channel's On Request
Salsa is offline   Reply With Quote
Old 13/03/2015, 04:15 AM   #26
Zalance
Huge Clucker
 
Zalance's Avatar
 
Join Date: May 2013
Location: The Mighty IND .................................. Graphic Designer.
Posts: 218
Reputation: 63
Default Re: FPS Textdraw by De4dpOol.

wow .. Sleek and Elegant
__________________

Zalance is offline   Reply With Quote
Old 17/03/2015, 02:49 PM   #27
De4dpOol
Huge Clucker
 
De4dpOol's Avatar
 
Join Date: Oct 2014
Posts: 214
Reputation: 39
Default Re: FPS Textdraw by De4dpOol.

Quote:
Originally Posted by Salsa View Post
it seems good
Thank you

Quote:
Originally Posted by Zalance View Post
wow .. Sleek and Elegant
Thanks man.
De4dpOol is offline   Reply With Quote
Old 17/03/2015, 02:56 PM   #28
Mya
Banned
 
Join Date: Mar 2015
Location: In Here
Posts: 72
Reputation: 11
Default Re: FPS Textdraw by De4dpOol.

wow, nice one for freeroam server
Mya is offline   Reply With Quote
Old 21/03/2015, 02:16 PM   #29
De4dpOol
Huge Clucker
 
De4dpOol's Avatar
 
Join Date: Oct 2014
Posts: 214
Reputation: 39
Default Re: FPS Textdraw by De4dpOol.

Quote:
Originally Posted by Mya View Post
wow, nice one for freeroam server
Thank you. It can be used for TDM servers too.
De4dpOol is offline   Reply With Quote
Old 21/03/2015, 02:21 PM   #30
Karan007
Gangsta
 
Karan007's Avatar
 
Join Date: Feb 2015
Posts: 539
Reputation: 67
Default Re: FPS Textdraw by De4dpOol.

Good job
Karan007 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Automatic random weather with weather news by De4dpOol. De4dpOol Filterscripts 8 19/04/2015 11:35 AM


All times are GMT. The time now is 02:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.