YOU ARE HURT,GO TO COVER!
#6

I did it :

pawn Код:
//Put in the top of your gamemode:

new checking[MAX_PLAYERS];
new TimerHP;
forward HealthLose();
forward HealthCheck();



//In the OnGameModeInit:

SetTimer("HealthCheck",2000,1);



//In the End of your gamemode:


public HealthCheck()
{
    new Float:hp;
    for(new x=0; x<MAX_PLAYERS; x++)
    {
        if(IsPlayerConnected(x))
        {
            GetPlayerHealth(x,hp);
            if(hp < 20.0)
            {
                GameTextForPlayer(x, "~g~You are ~r~hurt,go to ~y~cover~n~~h~", 6000, 6);
                TimerHP = SetTimerEx("HealthLose", 300000, 0, "i", x);
                checking[x] = 1;
        }   }
    }
}


public HealthLose()
{
    for(new x=0; x<MAX_PLAYERS; x++)
    {
        new Float:Health;
        if(IsPlayerConnected(x))
        {
            if(checking[x] == 1)
            {
                GetPlayerHealth(x,Health);
                SetPlayerHealth(x, Health - 5.0);
                KillTimer(TimerHP);
                checking[x] = 0;
        }   }
    }
}

I hope that i have helped
Reply


Messages In This Thread
YOU ARE HURT,GO TO COVER! - by Face9000 - 20.12.2010, 10:33
Re: YOU ARE HURT,GO TO COVER! - by Basicz - 20.12.2010, 10:52
Re: YOU ARE HURT,GO TO COVER! - by Face9000 - 20.12.2010, 10:57
Re: YOU ARE HURT,GO TO COVER! - by Basicz - 20.12.2010, 11:13
Re: YOU ARE HURT,GO TO COVER! - by CrucixTM - 20.12.2010, 11:13
Re: YOU ARE HURT,GO TO COVER! - by rjjj - 20.12.2010, 11:16
Re: YOU ARE HURT,GO TO COVER! - by CrucixTM - 20.12.2010, 11:19
Re: YOU ARE HURT,GO TO COVER! - by Face9000 - 20.12.2010, 11:21

Forum Jump:


Users browsing this thread: 1 Guest(s)