PLayer health
#12

here, my fault:
pawn Код:
public OnFilterScriptInit()
{
    //your OnGameModeInitCode
    SetTimer("HealthCheck", 1000, 1);
    return 1;
}

forward HealthCheck();
public HealthCheck()
{
    for(new i=0; i<MAX_PLAYERS; i++){
        if(IsPlayerConnected(i)){
            new Float:Health;
            GetPlayerHealth(i, Health);
            if(Health < 50){
                ApplyAnimation(i,"SWAT","gnstwall_injurd" , 4.0, 1, 0, 0, 0, 0);//Anim
                TogglePlayerControllable(i, 0);// Freeze the player
                SetPlayerHealth(i, Health + 1);//Optional for increace player's life, and unfreeze it
            }
            else{
                ClearAnimations(i);
                TogglePlayerControllable(i, 1);
            }
        }
    }
}
Reply


Messages In This Thread
PLayer health - by darkmagic2 - 07.08.2010, 12:59
Re: PLayer health - by Cameltoe - 07.08.2010, 13:03
Re: PLayer health - by ViruZZzZ_ChiLLL - 07.08.2010, 13:05
Re: PLayer health - by Scarface~ - 07.08.2010, 13:09
Re: PLayer health - by Cameltoe - 07.08.2010, 13:16
Re: PLayer health - by vital2k - 07.08.2010, 13:16
Re: PLayer health - by Scarface~ - 07.08.2010, 13:25
Re: PLayer health - by darkmagic2 - 07.08.2010, 13:31
Re: PLayer health - by TheChaoz - 07.08.2010, 13:48
Re: PLayer health - by darkmagic2 - 07.08.2010, 13:56
Re: PLayer health - by RichyB - 07.08.2010, 14:00
Re: PLayer health - by TheChaoz - 07.08.2010, 14:00

Forum Jump:


Users browsing this thread: 2 Guest(s)