21.02.2014, 13:32
(
Last edited by NovaGaming; 21/02/2014 at 01:51 PM.
Reason: Alot of people complaining
)
Hello people of samp its me NovaGaming today i bring you a tutorial of how to make a heal system
You need to have pawno else download from the website
Once you have openeded pawno
Press the white icon this creates a new filterscript or gamemode
depends on what you want do do
Go to onplayerstatechange(playerid,newstate,oldstate)
under onplayerstatechange type
End now we are done you now have your own health system
If you have any questions ask me below in the commands
You need to have pawno else download from the website
Once you have openeded pawno
Press the white icon this creates a new filterscript or gamemode
depends on what you want do do
Go to onplayerstatechange(playerid,newstate,oldstate)
pawn Code:
type new float:Health; //this creates a float to store the health in
GetPlayerHealth(playerid,Health); //this gets the health of the player
type if(Health< 100){ //this checks if the health is less then 100
SetTimer("HealthTimer",6000,true); //this creates a timer when the player is getting healed 6000 = 6 seconds
}
also type if(Health>100){ //checks if the health is higher then 100
SetTimer("HealthTimer",6000,false); //this stops the timer from giving health to players
}
pawn Code:
forward HealthTimer(playerid); //this makes us use the function healthtimer
public HealthTimer(playerid){
new Float:Health;
GetPlayerHealth(playerid,Health);
if(health < 100){ //If the health is less then 100
SetPlayerHealth(playerid, health + 5.0); //Gives the player his currenthealth + 5
}
if(health > 100){ //if the health is higher then 100 do nothing
}
return 1;
}
If you have any questions ask me below in the commands