PDA

View Full Version : string doesn't get called


Bondz
02/10/2016, 11:45 AM
new str2[228];
new Float:armour;
new Float:health;
GetPlayerArmour(damagedid, armour);
GetPlayerHealth(damagedid, health);
format(str2,sizeof(str2),"~n~~n~~n~~n~~n~~n~~b~~h~~h~%s~n~~w~ARMOUR:%0.2f ~r~Health:%0.2f ", pName[damagedid], armour, health);
GameTextForPlayer(playerid, str2, 1000, 3);

if i shoot someone it should show the playername,health and also the armour of the damaged id
but in this case,it's only showing player's name

Gotham
02/10/2016, 11:50 AM
because u have only created pName[damagedid] which shows the player's name itself

Bondz
02/10/2016, 12:47 PM
you don't understand at all.
damagedid is the player who get damaged
https://wiki.sa-mp.com/wiki/OnPlayerGiveDamage

Gotham
02/10/2016, 01:39 PM
Sorry.Didn't read the code properly , try:

new str2[128];
new Float:armour;
new Float:health;
GetPlayerArmour(damagedid, armour);
GetPlayerHealth(damagedid, health);
format(str2,sizeof(str2),"~n~~n~~n~~n~~n~~n~~b~~h~~h~%s~n~~w~ARMOUR:%f~r~Hea lth:%f", pName[damagedid], armour, health);
GameTextForPlayer(playerid, str2, 1000, 3);

oMa37
02/10/2016, 02:59 PM
Have you noticed how many lines you made? (~n~).
Try removing some of them.
Also set health/armour as %.0f in the string.

Bondz
02/10/2016, 03:03 PM
I want to make it like this
http://i.imgur.com/y7YyNrZ.png
is there any other way?

Rdx
02/10/2016, 09:14 PM
I think it's textdraw, not gametext.