Questions..
#1

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

Код:
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;
}
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 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;
}
Reply
#2

Debug it to check what IsDead is set to. Make sure you set it under OnPlayerDeath correctly, including making sure killerid != INVALID_PLAYER_ID.
Reply
#3

Not Sure... But Try Something like This.

Quote:

public OnPlayerSpawn(playerid)
{
IsAfterLifing[playerid] = 0;
if (IsDead[playerid] == 1)
{
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_ DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath",AUTODEATH_SECONDS * 1000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
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;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)