Super jump and fall damage, help please :)
#1

Making zombie server, and i want zombies can make single super jump by pressing their jump-key.i want that they wont take fall damage.any ideas how to do that?


this is code for jump, but if i press jump whole time, i can fly.


Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP) {
        new
            Float: vX,
            Float: vY,
            Float: vZ;
        GetPlayerVelocity(playerid, vX, vY, vZ);
        SetPlayerVelocity(playerid, vX, vY,  1);
    }
    return 1;
}
and need help with fall damage
Reply
#2

Before jump: GetPlayerHealth
5 seconds or so after jump: SetPlayerHealth
Reply
#3

i get the idea, but how to do it?
Reply
#4

When they jump, get their health and set a boolean indicating they have just jumped. In OnPlayerUpdate, check if the boolean is true and if it is AND their health is lower than what it used to be, set their health to what it used to be and set the justjumped boolean to false.
Reply
#5

so hard .Is there any command like:


Код:
{
if(PlayerTeam[playerid] == 1)
SetPlayerFallDamage(playerid, 0)
}

anohter question, how to make zombie run faster?this is my code for jump, so how to make it for sprint?
Код:
{
    if(PlayerTeam[playerid] == 1)
	if(newkeys & KEY_JUMP) {
        new
            Float: vX,
            Float: vY,
            Float: vZ;
        GetPlayerVelocity(playerid, vX, vY, vZ);
        SetPlayerVelocity(playerid,0.0,0.0,0.2);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)