How to increase players health by 5
#1

Hello,

Im wanting to increase a players health by 5,
How would i do that?
Reply
#2

Don't know, maybe(not sure lol):
pawn Код:
SetPlayerHealth(playerid, +5);
Reply
#3

Quote:
Originally Posted by RoamPT
Don't know, maybe(not sure lol):
pawn Код:
SetPlayerHealth(playerid, +5);
Ive tried that it didnt work
Reply
#4

Hm i guess it isn't possible then.
Reply
#5

it is and this will

new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+5);

EDIT: sorry it's late

big auch if it won't xD
Reply
#6

Quote:
Originally Posted by RoamPT
Hm i guess it isn't possible then.
Lol it is, You mix setplayerhealth with getplayerhealth but i cant remember how exactly

EDIT: Thanks
Reply
#7

pawn Код:
new
    Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatround(health) + 5);
Reply
#8

Quote:
Originally Posted by Don Correlli
pawn Код:
new
    Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatround(health) + 5);
auch anyway, cause, that's kinda what I posted , wait I notice something (shit it's late) is the floatround realy needed?
Reply
#9

Quote:
Originally Posted by Rizard
auch anyway, cause, that's kinda what I posted
Your example was wrong, you've edited it while i was posting mine.

Quote:
Originally Posted by Rizard
wait I notice something (shit it's late) is the floatround realy needed?
Amount of health with SetPlayerHealth is an integer type in 0.3, not float anymore, so i'm using floatround to round the health variable to an integer.
Reply
#10

alrighty then but I posted wrong the first time and editedcorrected later cause it's fucking late xD

and thnx, I have learned

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)