Super Jump
#1

I am working on a Super Jump commands. It gives you 10 seconds of jump boost then has to reload. How would I create the jump, I know I can't individually set players gravity, which would be kick ass. But how do I do something like this?
Reply
#2

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

Scroll down, it shows you how to do a super jump.
Reply
#3

why not just give it to him from there

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_JUMP))
    {
        new
            Float:x,
            Float:y,
            Float:z;
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z + 10.0);
    }
    return 1;
}
Reply
#4

Yes but that example is old and SetPlayerVelocity wasn't exist back there.
Therefore it uses SetPlayerPos which will just get the player's old positions,and set the Z position(height) to +10 from it's current value,you can use GetPlayerVelocity and SetPlayerVeloity for smoother results :P
Reply
#5

Thanks, O_x

I've never really messed around with OnPlayerKeyStateChange. But it says 'PRESSED' is an unidentified symbol.
Reply
#6

You need this.
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)