17.09.2013, 13:17
i search for function using SetTimer To send 2 health on 4 Seconds
Please give me function
Please give me function
You mean add 2 hp to player's health?
new hp = GetPlayerHealth(playerid); hp += 2; SetPlayerHealth(playerid, hp); |
new
Float: hp
;
GetPlayerHealth( playerid, hp );
SetPlayerHealth( playerid, hp + 2 );
new
Float: hp
;
GetPlayerHealth( playerid, hp );
SetPlayerHealth( playerid, hp + 2 );
public OnPlayerUpdate(playerid)
{
if(GetPlayerHealth(playerid, hp) >= 100) return SetPlayerHealth(playerid, 100);
return 1;
}
new
heal_Timer
;
// Where you start the timer
heal_Timer = SetTimer( ... );
// OR
heal_Timer = SetTimerEx( ... );
// Depending on what you want
// In the public of the Timer (either looping through connected players or passing parameter in SetTimerEx)
new
Float: hp
;
GetPlayerHealth( playerid, hp );
SetPlayerHealth( playerid, hp + 2 );
if( hp + 2 >= 100 ) KillTimer( heal_Timer );