please help meee!!!!!!
#7

At the top:
pawn Код:
new hfroze[MAX_PLAYERS];
forward HealthCheck();
At OnGameModeInit
pawn Код:
SetTimer("HealthCheck", 2000, true);
anywhere:
pawn Код:
public HealthCheck()
{
    new Float:health;
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(hfroze[i] == 1)
            {
                GetPlayerHealth(i, health);
                SetPlayerHealth(i, health+2);
                if(health >= 15)
                {
                    TogglePlayerControllable(i, 1);
                    hfroze = 0;
                }
            }else{
                GetPlayerHealth(i, health);
                if(health < 15)
                {
                    hfroze = 1;
                    TogglePlayerControllable(i, 0);
                    SendClientMessage(i, 0x999999AA, "Wait until your health increased to over 15hp");
                }
            }
        }
    }
    return 1;
}
at OnPlayerConnect
pawn Код:
hfroze[playerid] = 0;
I hope that helped you and it works how you wanted it..
I just wrote it up so I don't know whether there is any error in it.. if there is, please tell me...

(you can also use SetTimerEx, but I wouldn't advice to do so..)
Reply


Messages In This Thread
please help meee!!!!!! - by tujituji1 - 25.01.2011, 12:28
Re: please help meee!!!!!! - by wups - 25.01.2011, 13:03
Re: please help meee!!!!!! - by jordy.kiesebrink - 27.01.2011, 18:56
Re: please help meee!!!!!! - by tujituji1 - 17.02.2011, 07:15
Re: please help meee!!!!!! - by AK47317 - 17.02.2011, 07:34
Re: please help meee!!!!!! - by jordy.kiesebrink - 17.02.2011, 09:13
Re: please help meee!!!!!! - by Sascha - 17.02.2011, 11:08

Forum Jump:


Users browsing this thread: 1 Guest(s)