SA-MP Forums Archive
Injured when you either fall of roofs, or just get hit. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Injured when you either fall of roofs, or just get hit. (/showthread.php?tid=364936)



Injured when you either fall of roofs, or just get hit. - davelord - 01.08.2012

Hey. Could you guys help me with this? The title pretty much explains what I want. For example, when you fall off a roof, you shouldn't be able to walk properly anymore, or just be dazed. So, if that happens, I'd like to get the old man walking command enabled, and the player would go in the 'injured' animation for about fifteen seconds.

The injured animation would be this.
Код:
ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
I'm already pretty around it, but I have no idea where to put things, could anyone help me out?


Re: Injured when you either fall of roofs, or just get hit. - Misiur - 01.08.2012

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage

I can't think about method of checking if someone fell from the roof though. Timer checking on what height player is might be helpful, but I don't know if it will be precise enough.


Re: Injured when you either fall of roofs, or just get hit. - davelord - 01.08.2012

Thanks, I'll try something.


Re: Injured when you either fall of roofs, or just get hit. - Rudy_ - 01.08.2012

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
    SetTimerEx("Injured", 15000, 0, "i", playerid);
    return 1;
}
Anywhere, Not in callbacks

pawn Код:
forward Injured(playerid);
public Injured(playerid)
{
    ClearAnimations(playerid);
    return 1;
}



Re: Injured when you either fall of roofs, or just get hit. - linuxthefish - 01.08.2012

I think there is a animation for when the player is lying on the ground from a fall. Check for that when a player takes damage.