I need help with Text Draws.
#3

You would need a health timer for the health but I'm sure you already have a timer that you can just add to. Here is how you would do kills and deaths.
pawn Код:
new Text:Textdraw5[MAX_PLAYERS];
new Text:Textdraw6[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
new kills[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    Textdraw5[playerid] = TextDrawCreate(472.000000, 172.000000, "Kills:");
    TextDrawBackgroundColor(Textdraw5[playerid], 65535);
    TextDrawFont(Textdraw5[playerid], 1);
    TextDrawLetterSize(Textdraw5[playerid], 0.629998, 2.200000);
    TextDrawColor(Textdraw5[playerid], 16777215);
    TextDrawSetOutline(Textdraw5[playerid], 1);
    TextDrawSetProportional(Textdraw5[playerid], 1);
    Textdraw6[playerid] = TextDrawCreate(472.000000, 197.000000, "Deaths:");
    TextDrawBackgroundColor(Textdraw6[playerid], 65535);
    TextDrawFont(Textdraw6[playerid], 1);
    TextDrawLetterSize(Textdraw6[playerid], 0.479999, 2.299998);
    TextDrawColor(Textdraw6[playerid], 16777215);
    TextDrawSetOutline(Textdraw6[playerid], 1);
    TextDrawSetProportional(Textdraw6[playerid], 1);
    TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) kills[killerid]++;
    deaths[playerid] ++;
    new str[40];
    format(str, sizeof(str), "Kills: %d", kills[killerid]);
    TextDrawSetString(Textdraw5[killerid], str);
    format(str, sizeof(str), "Deaths: %d", deaths[playerid]);
    TextDrawSetString(Textdraw6[playerid], str);
    return 1;
}
EDIT:


Quote:
Originally Posted by Drebin
Посмотреть сообщение
Example for health:

Код:
new string[64];
format(string,sizeof(string),"Health: %i",GetPlayerHealth(playerid));
TextDrawSetString(Textdraw7,string);
Do the same for kills and death. All you have to do is to change it so it inputs the amount of kills or death into the %i (means the script has to read it from the userfile where you save the player's deaths and kills).
There is a few errors in your code there
1. GetPlayerHealth is a float %f not a integer.
2. GetPlayerHealth has mutliple params
pawn Код:
new Float:Health;
GetPlayerHealth(playerid, Health);
3. You need a textdraw for each player.
Reply


Messages In This Thread
I need help with Text Draws. - by Shockey HD - 29.07.2011, 23:14
AW: I need help with Text Draws. - by Drebin - 29.07.2011, 23:57
Re: I need help with Text Draws. - by [HiC]TheKiller - 30.07.2011, 00:04
Re: I need help with Text Draws. - by Famalamalam - 30.07.2011, 00:08
Re: I need help with Text Draws. - by Shockey HD - 30.07.2011, 00:26

Forum Jump:


Users browsing this thread: 1 Guest(s)