20.03.2012, 22:15
This code is a part of a filterscript that suppose to set the player frozen and in an anim for some time like in a death way But in someway the player wont use the animation nor gets frozen
Another question
I have made that auto bleeding code that makes the player loses hp every 1 minute if his hp is 20 or lower but it wont lose after any time !!!
Код:
public OnPlayerSpawn(playerid)
{
IsAfterLifing[playerid] = 0;
if (IsDead[playerid] == 1)
{
TogglePlayerControllable(playerid,false);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath",AUTODEATH_SECONDS * 1000,false,"i",playerid);
SCM(playerid,CYAN,"------------------ Health Advise -----------------");
SCM(playerid,WHITE,"You are bleeding to death.");
SCM(playerid,WHITE,"If you are lucky, the medics will help you.");
SCM(playerid,WHITE,"You can type /acceptdeath to give up and die.");
SCM(playerid,CYAN,"--------------------------------------------------------");
return 1;
}
return 1;
}
I have made that auto bleeding code that makes the player loses hp every 1 minute if his hp is 20 or lower but it wont lose after any time !!!
Код:
public CheckHealth(playerid)
{
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health < 20)
{
new hptimer;
hptimer = SetTimer("losehp",1000,true);
}
return 1;
}
forward hptimer(playerid);
public hptimer(playerid)
{
new Float:Health;
GetPlayerHealth(playerid, Health);
SetPlayerHealth(playerid, Health -5);
return 1;
}

