Bleeding system
#1

Hello, i wanted to make the players loses health automatically after his hp goes under 20 who can help me with it?
Reply
#2

any ideas?
Reply
#3

OnPlayerUpdate check player's health. If his health is under 20 set a timer, every 1 second set his health down
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#4

PHP код:
public OnGameModeInit()
{
    
SetTimer("LifeCheck"30000true);
    return 
1;
}

public 
LifeCheck()
{
    for(new 
iGetMaxPlayers(); i++)
    {
        if(
IsPlayerConnected(i))
        {
            new 
Float:health;
            
GetPlayerHealth(ihealth);
            
SetPlayerHealth(ihealth-1);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)