OnPlayerTakeDamage
#1

Hello, I've recently checked the wiki for a damage callback, I've found the OnPlayerTakeDamage, I wanted to make a function in it When the player jumps a little bit high than the normal, He gets more HP low, Is it possible?
Reply
#2

What do you mean by jumping more than normal?

Anyways, you can use these

pawn Код:
new Float:x, Float:y, Float:z;
 
    // Use GetPlayerPos, passing the 3 float variables we just created
    GetPlayerPos(playerid, x, y, z);
and https://sampwiki.blast.hk/wiki/GetPlayerKeys (KEY_JUMP)
Reply
#3

Isn't it kind of incoded into GTA:SA? The higher you fall from, more is the health you lose? Isn't that what you mean?
Reply
#4

Nope, I mean i wanna make a more custom function like the GTA:SA.
Reply
#5

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerVelocity(playerid, x, y, z);
        if(y > changethistoheightvalue)
        {
            new Float:health;
            GetPlayerHealth(playerid, health);
            SetPlayerHealth(playerid, health-80);
        }
    }
    return 1;
}
I tried something, not sure if in right direction, something is wrong, probably someone else can continue or fix.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)