Textdraw
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
Hook the function:

pawn Код:
stock h_SetPlayerScore(playerid, score)
{
    SetPlayerScore(playerid, score);

    // Textdraw code here
    new tdstring[24];
    format(tdstring, sizeof(tdstring), "Score: ~Y~%i", score);
    PlayerTextDrawSetString(playerid, TD_pScore[playerid], tdstring);
    return 1;
}

#if defined _ALS_SetPlayerScore
    #undef SetPlayerScore
#else
    #define _ALS_SetPlayerScore
#endif
#define SetPlayerScore h_SetPlayerScore
Put that code UNDER the includes, but BEFORE any callbacks or functions.

You need to CREATE THE PLAYER-TEXTDRAW.

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
I tried that and it gives no errors, but if i check on the server i dont see the score textdraw

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xF30000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_LIGHTBLUE 0x00D0F6AA
#define COLOR_WHITE 0xF6F6F6AA
#define COLOR_PURPLE 0xA600F6AA
#define COLOR_TUT 0xF6C861AA
#define COLOR_ROYAL 0x00C1F6AA
#define COLOR_CWHITE 0xE0FFFFAA

#define PRIVATE 0
#define CORPORAL 1
#define SERGENTEANT 2
#define CAPTAIN 3
#define BRIGADIER 4
#define GENERAL 5

new Text:Private;
new Text:Corporal;
new Text:Sergenteant;
new Text:Captain;
new Text:Brigadier;
new Text:General;
new Text:Score;

new PlayerLogged[MAX_PLAYERS];
new Rank[MAX_PLAYERS];

stock h_SetPlayerScore(playerid, score)
{
    SetPlayerScore(playerid, score);

    Score = TextDrawCreate(496.000000, 128.000000, "Score: ");
    TextDrawBackgroundColor(Score, 255);
    TextDrawFont(Score, 1);
    TextDrawLetterSize(Score, 0.440000, 1.500000);
    TextDrawColor(Score, 16711935);
    TextDrawSetOutline(Score, 1);
    TextDrawSetProportional(Score, 1);
    new tdstring[24];
    format(tdstring, sizeof(tdstring), "Score: ~Y~%i", score);
    PlayerTextDrawSetString(playerid, TD_pScore[playerid], tdstring);
    return 1;
}

#if defined _ALS_SetPlayerScore
    #undef SetPlayerScore
#else
    #define _ALS_SetPlayerScore
#endif
#define SetPlayerScore h_SetPlayerScore
Reply


Messages In This Thread
Textdraw - by MechaTech - 18.05.2012, 08:54
Re: Textdraw - by Flake. - 18.05.2012, 09:04
Re: Textdraw - by MP2 - 18.05.2012, 09:29
Re: Textdraw - by Flake. - 18.05.2012, 09:30
Re: Textdraw - by MechaTech - 18.05.2012, 09:33
Re: Textdraw - by Flake. - 18.05.2012, 09:42
Re: Textdraw - by MP2 - 18.05.2012, 09:45
Re: Textdraw - by MechaTech - 18.05.2012, 09:59
Re: Textdraw - by MP2 - 18.05.2012, 10:35
Re: Textdraw - by MechaTech - 18.05.2012, 11:28

Forum Jump:


Users browsing this thread: 3 Guest(s)