SA-MP Forums Archive
[FilterScript] lScore'n'Ping [In TextDraws!] - 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] lScore'n'Ping [In TextDraws!] (/showthread.php?tid=321753)



lScore'n'Ping'n'FPS Version 2.0 Released! - Littlehelper - 28.02.2012



Hello,
I'm Back Again With Another Release Which Is Very Basic "Score'n'Ping" System in Text-Draws.

Introduction:
It Is A Very Basic System Which Shows Player Ping And Score In Text-Draw Under The Radar.
Source:
pawn Код:
new Text:scoreandping[MAX_PLAYERS];
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
new Updater;
// OnGameModeInIt And/Or OnFilterscriptInIt();
Updater = SetTimer("ScorenPing", 1000, 1);
// OnGameModeExit And/Or OnFilterScriptExit();
KillTimer(Updater);
// OnPlayerConnect Stuff.
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,-1," This Server Uses lScore'n'Ping System By Littlehelper AKA iKing");
    scoreandping[playerid] = TextDrawCreate(10.000000,430.000000,"Loading Statistics!");
    TextDrawAlignment(scoreandping[playerid],0);
    TextDrawBackgroundColor(scoreandping[playerid],0x000000ff);
    TextDrawFont(scoreandping[playerid],1);
    TextDrawLetterSize(scoreandping[playerid],0.500000,1.5);
    TextDrawColor(scoreandping[playerid],0xffffffff);
    TextDrawSetOutline(scoreandping[playerid],1);
    TextDrawSetProportional(scoreandping[playerid],1);
    TextDrawSetShadow(scoreandping[playerid],1);
    TextDrawShowForPlayer(playerid, scoreandping[playerid]);
     return 1;
}
// OnPlayerDisconnect Stuff.
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(scoreandping[playerid]);
    return 1;
}
// Publics.
public OnPlayerUpdate(playerid) {

    // handle fps counters.
    new drunknew;
    drunknew = GetPlayerDrunkLevel(playerid);

    if (drunknew < 100) { // go back up, keep cycling.
        SetPlayerDrunkLevel(playerid, 2000);
    } else {

        if (pDrunkLevelLast[playerid] != drunknew) {

            new wfps = pDrunkLevelLast[playerid] - drunknew;

            if ((wfps > 0) && (wfps < 200))
                pFPS[playerid] = wfps;

            pDrunkLevelLast[playerid] = drunknew;
        }

    }

}
public ScorenPing(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[256];
            format(string,sizeof(string),"Score:~b~%d ~w~Ping:~b~%d ~w~FPS:~b~%d",GetPlayerScore(playerid),GetPlayerPing(playerid),GetPlayerFPS(playerid));
            TextDrawSetString(scoreandping[i], string);
        }
    }
}
// Added FPS On Request.
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;
}
|| The End ||



Re: lScore'n'Ping [In TextDraws!] - System64 - 28.02.2012

nice release, also nice textdraw

rep+


Re: lScore'n'Ping [In TextDraws!] - Shadow_ - 28.02.2012

Its nice You should add FPS aswell.


Re: lScore'n'Ping [In TextDraws!] - Littlehelper - 28.02.2012

Thanks.


Re: lScore'n'Ping [In TextDraws!] - XenXack - 28.02.2012

Awesome i Agree With Him You should Add FPS Aswell


Re: lScore'n'Ping [In TextDraws!] - Rockstαr - 28.02.2012

Cool textdraws but can you tell where the TD is placed i mean the position? i'm Lazy..


Re: lScore'n'Ping [In TextDraws!] - Littlehelper - 28.02.2012

To The Guy Above Me ^
Quote:

Under The Radar.




Re: lScore'n'Ping [In TextDraws!] - aco_SRBIJA - 28.02.2012

Cool Script:

Littlehelper[MDZ], Do I have your permission to release here a pastebin filterscript with new featurs:

Kill in a row
FPS?

Cool Script, you own! +1 rep.


Re: lScore'n'Ping [In TextDraws!] - Littlehelper - 28.02.2012

Quote:
Originally Posted by aco_SRBIJA
Посмотреть сообщение
Cool Script:

Littlehelper[MDZ], Do I have your permission to release here a pastebin filterscript with new featurs:

Kill in a row
FPS?

Cool Script, you own! +1 rep.
Yes Go Ahead,
It'll be a pleasure, but leave the credits.
Thank You.


Re: lScore'n'Ping [In TextDraws!] - willzyyy - 28.02.2012

Hi,Please make 'FPS' after ping. Would be awesome!!
@ aco,please make fps too. And post here.