Textdraw Help please help me [+REP]
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use TextDrawSetString to change the string of a textdraw.
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    TextDrawSetString(GiveDamage[issuerid], amount);
    TextDrawSetString(TakeDamage[playerid], amount);
}
You must read it yourself carefuly, the 2nd parameter of TextDrawSetString is a string and not a Float!

pawn Код:
new s[10];
format(s, sizeof s, "%f", amount);
TextDrawSetString(GiveDamage[issuerid], s);
EDIT:
For adding on damage simply use a player var.
pawn Код:
new Float:damage[MAX_PLAYERS];

public OnPlayerTakeDamage(...)
{
       damage[issuerid] += amount;

       new s[20];
       format(s, sizeof s, "+ Damage %f", damage[issuerid]);
       TextDrawSetString(TakeDamage[playerid], s);
}
Dont forget to reset the var damage on player's spawn.
Reply


Messages In This Thread
Textdraw Help please help me [+REP] - by HydraHumza - 20.02.2015, 16:23
Re: Textdraw Help please help me [+REP] - by CalvinC - 20.02.2015, 16:58
Re: Textdraw Help please help me [+REP] - by HydraHumza - 21.02.2015, 04:47
Re: Textdraw Help please help me [+REP] - by Gammix - 21.02.2015, 04:55
Re: Textdraw Help please help me [+REP] - by HydraHumza - 21.02.2015, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)