SA-MP Forums Archive
Super Jump - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Super Jump (/showthread.php?tid=169002)



Super Jump - ScottCFR - 17.08.2010

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?


Re: Super Jump - Toni - 17.08.2010

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

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


Re: Super Jump - Kitten - 17.08.2010

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;
}



Re: Super Jump - [XST]O_x - 17.08.2010

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


Re: Super Jump - ScottCFR - 17.08.2010

Thanks, O_x

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


Re: Super Jump - Toni - 17.08.2010

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