Health and Armour Percentage
#1

Hello SA-MP!,

Can u just give me a few more details on how to make a Health And Armour Percentage? +1 Rep
Reply
#2

You may use GetPlayerHealth, GetPlayerArmour !
Reply
#3

And how to make it to textdraws



EDIT: Like a percentage
Reply
#4

Just an Example :

Code:
//on gamemode load

new Text:PlayerHealth[MAX_PLAYERS];

//on player spawn or when his status changes or on a command

new Float:Health, TextFormat[32];
GetPlayerHealth(playerid, Health[playerid]);

format(TextFormat, sizeof(TextFormat), "Health: %i %", floatround(Health));
TextDrawSetString(PlayerHealth[playerid], TextFormat);
TextDrawShowForPlayer(playerid, PlayerHealth[playerid]);
Don't forget to build your text draw this is just an exemple wrote in this moment
Reply
#5

Where i will put the Textdraw ID there ?
Reply
#6

If you are using different text per player you have to use a player textdraw, not a global one.
Reply
#7

Just put it as a global pointer !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)