SA-MP Forums Archive
[FilterScript] Player Info FS - 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] Player Info FS (/showthread.php?tid=178636)



Player Info FS - Kitten - 23.09.2010

Players Info By Kitten v1 Flliterscript





Download

http://pastebin.com/n0L38gyQ

or

pawn Код:
////////////////////////////////////////////////////////////////////////////////////
////////////////////////FS BY KITTEN PLAYER INFO///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

#include <a_samp>

#define COLOR_GREEN 0x20B2AAAA
new Text:Cash[MAX_PLAYERS];
new Text:Score[MAX_PLAYERS];
new Text:XP[MAX_PLAYERS];
new Text:Textdraw3;
new Text:Textdraw4;

public OnFilterScriptInit()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        Cash[playerid] = TextDrawCreate(519.000000, 341.000000, " ");
        TextDrawBackgroundColor(Cash[playerid], 255);
        TextDrawFont(Cash[playerid], 1);
        TextDrawLetterSize(Cash[playerid], 0.540000, 1.699999);
        TextDrawColor(Cash[playerid], -1);
        TextDrawSetOutline(Cash[playerid], 0);
        TextDrawSetProportional(Cash[playerid], 1);
        TextDrawSetShadow(Cash[playerid], 1);

        Score[playerid] = TextDrawCreate(520.000000, 355.000000, " ");
        TextDrawBackgroundColor(Score[playerid], 255);
        TextDrawFont(Score[playerid], 1);
        TextDrawLetterSize(Score[playerid], 0.509999, 1.700000);
        TextDrawColor(Score[playerid], -1);
        TextDrawSetOutline(Score[playerid], 0);
        TextDrawSetProportional(Score[playerid], 1);
        TextDrawSetShadow(Score[playerid], 1);

        XP[playerid] = TextDrawCreate(520.000000, 370.000000, "XP~r~: 0/50");
        TextDrawBackgroundColor(XP[playerid], 255);
        TextDrawFont(XP[playerid], 1);
        TextDrawLetterSize(XP[playerid], 0.519999, 1.400000);
        TextDrawColor(XP[playerid], -1);
        TextDrawSetOutline(XP[playerid], 0);
        TextDrawSetProportional(XP[playerid], 1);
        TextDrawSetShadow(XP[playerid], 1);
    }
   
    SetTimer("CashM",5000,true);
    SetTimer("ScoreM",5000,true);

    Textdraw3 = TextDrawCreate(515.000000, 336.000000, "~n~");
    TextDrawBackgroundColor(Textdraw3, 255);
    TextDrawFont(Textdraw3, 1);
    TextDrawLetterSize(Textdraw3, 0.490000, 5.700000);
    TextDrawColor(Textdraw3, -1);
    TextDrawSetOutline(Textdraw3, 0);
    TextDrawSetProportional(Textdraw3, 1);
    TextDrawSetShadow(Textdraw3, 1);
    TextDrawUseBox(Textdraw3, 1);
    TextDrawBoxColor(Textdraw3, 1009274970);
    TextDrawTextSize(Textdraw3, 619.000000, 0.000000);

    Textdraw4 = TextDrawCreate(520.000000, 324.000000, "~r~Player ~w~Info");
    TextDrawBackgroundColor(Textdraw4, 255);
    TextDrawFont(Textdraw4, 1);
    TextDrawLetterSize(Textdraw4, 0.500000, 1.000000);
    TextDrawColor(Textdraw4, -1);
    TextDrawSetOutline(Textdraw4, 0);
    TextDrawSetProportional(Textdraw4, 1);
    TextDrawSetShadow(Textdraw4, 1);

    for(new i; i < MAX_PLAYERS; i ++)
    {
        for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
        {
            if(IsPlayerConnected(i))
            {
                TextDrawShowForPlayer(i, Cash[playerid]);
                TextDrawShowForPlayer(i, XP[playerid]);
                TextDrawShowForPlayer(i, Score[playerid]);
                TextDrawShowForPlayer(i, Textdraw3);
            }   TextDrawShowForPlayer(i, Textdraw4);
        }
    }
    return 1;
}

forward CashM(playerid);
public CashM(playerid)
{
    new string[48];
    new CashMM = GetPlayerMoney(playerid);
    format(string, sizeof(string), "Cash~r~: $%d", CashMM);
    TextDrawSetString(Cash[playerid],string);
    return 1;
}
forward ScoreM(playerid);
public ScoreM(playerid)
{
     new string[128];
     new ScoreMM = GetPlayerScore(playerid);
     format(string, sizeof(string), "Score~r~: %d",ScoreMM);
     TextDrawSetString(Score[playerid],string);
     return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{

    new msg[64];
    new score = GetPlayerScore(killerid);
    SetPlayerScore(killerid, score+1);
    format(msg, sizeof(msg),"XP: %d/50",score+1);
    TextDrawSetString(XP[killerid],msg);
    GivePlayerMoney(killerid, 12000);
    GameTextForPlayer(killerid, "~p~1+ ~w~XP Experience! ~n~~g~+$12000!!",6000,4);

    if(GetPlayerScore(killerid) == 10)
    {
        GivePlayerWeapon(killerid,31,1000);
        GameTextForPlayer(killerid,"~r~ XP AWARDS ~n~ ~w~ M4 Unlocked",6000,3);
        new name[MAX_PLAYER_NAME], string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Player * %s Has Been XP Awared 10 Kills ** m4 unlocked for him", name);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    if(GetPlayerScore(killerid) == 20)
    {
        GivePlayerWeapon(killerid,30,1000);
        GameTextForPlayer(killerid,"~r~ XP AWARDS ~n~ ~w~ AK47 Unlocked",6000,3);
        new name[MAX_PLAYER_NAME], string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Player * %s Has Been XP Awared 20 Kills ** ak47 unlocked for him", name);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    if(GetPlayerScore(killerid) == 30)
    {
        GivePlayerWeapon(killerid,27,1000);
        GameTextForPlayer(killerid,"~r~ XP AWARDS ~n~ ~w~ Combat Shotgun Unlocked",6000,3);
        new name[MAX_PLAYER_NAME], string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Player * %s Has Been XP Awared 30 Kills ** Combat Shotgun unlocked for him", name);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    if(GetPlayerScore(killerid) == 40)
    {
        GivePlayerWeapon(killerid,24,1000);
        GameTextForPlayer(killerid,"~r~ XP AWARDS ~n~ ~w~ Desert Eagle Unlocked",6000,3);
        new name[MAX_PLAYER_NAME], string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Player * %s Has Been XP Awared 40 Kills ** Desert Eagle unlocked for him", name);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    if(GetPlayerScore(killerid) == 50)
    {
        GivePlayerWeapon(killerid,32,1000);
        GameTextForPlayer(killerid,"~r~ XP AWARDS ~n~ ~w~ Tec 9 Unlocked",6000,3);
        new name[MAX_PLAYER_NAME], string[100];
        new name2[MAX_PLAYER_NAME], string2[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Player * %s Has Been XP Awared 50 Kills ** Tec 9 unlocked for him", name);
        format(string2, sizeof(string2), "~y~ Player %s Has Finshed XP Experience 50 kills",name2);
        GameTextForAll(string2,6000,3);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    return 1;
}
public OnFilterScriptExit()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        TextDrawHideForAll(Cash[playerid]);
        TextDrawDestroy(Cash[playerid]);
        TextDrawHideForAll(Score[playerid]);
        TextDrawDestroy(Score[playerid]);
        TextDrawHideForAll(XP[playerid]);
        TextDrawDestroy(XP[playerid]);
    }
    TextDrawHideForAll(Textdraw3);
    TextDrawDestroy(Textdraw3);
    TextDrawHideForAll(Textdraw4);
    TextDrawDestroy(Textdraw4);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Cash[playerid]);
    TextDrawShowForPlayer(playerid, XP[playerid]);
    TextDrawShowForPlayer(playerid, Score[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    return 1;
}



Re: Player Info FS - willsuckformoney - 23.09.2010

Looks great actually. Good work, and when will you use something other than a textdraw?


Re: Player Info FS - Tannz0rz - 23.09.2010

You know, it'd probably be a better option to just crop the image rather than mask the hidden GUI with white rectangles. It makes it even more obvious as to what it is that you're trying to hide, wink wink.

Other than that, nice job. Lol


Re: Player Info FS - Basicz - 23.09.2010

Nice job!


Re: Player Info FS - Kitten - 23.09.2010

Quote:

Looks great actually. Good work, and when will you use something other than a text

idk i love textdraws


Re: Player Info FS - royal_king - 23.09.2010

Quote:
Originally Posted by Kitten
Посмотреть сообщение
idk i love textdraws
Lol
anyway great job :P keep it up