23.08.2013, 12:45
(
Последний раз редактировалось RajatPawar; 24.08.2013 в 07:34.
)
1) Create a public function to increase the player health by 1/3/w/e you want
2) Set a timer in the command
eg
2) Set a timer in the command
eg
pawn Код:
#define INVALID_TIMER -24
healer_timer[ MAX_PLAYERS ] = INVALID_TIMER;
forward public HealSlowly( playerid );
CMD:heal_me_over_time(playerid)
{
healer_timer[ playerid ] = SetTimerEx("HealSlowly", 1000, 1, "d", playerid);
return 1;
}
public HealSlowly( playerid )
{
new Float: health_;
GetPlayerHealth( playerid, health_ );
if( health_ > 100) { KillTimer( healer_timer[ playerid ] ); healer_timer[ playerid ] = INVALID_TIMER; }
Else SetPlayerHealth( playerid, health_ + 1 );
return 1;
}
public OnPlayerDisconnect( playerid ..)
{
healer_timer[ playerid ] = INVALID_TIMER;
return 1;
}