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=177070)



Super jump? - MWF2 - 16.09.2010

Is there a super jump FS out there? if so, can someone link me?


What it does:

When you jump, it goes a higher then usual but obviously not to high.


If there's no fs, how can i make it?


Re: Super jump? - ScottCFR - 16.09.2010

Well, you could detect if they press jump. Then, SetPlayerVelocity z+5 or so.


Re: Super jump? - MWF2 - 16.09.2010

Can you show me how.


Re: Super jump? - Toni - 16.09.2010

From the wiki:
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;
}
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



Re: Super jump? - MWF2 - 16.09.2010

What that does is, it puts that player in the air...What i need is..


When the player jumps into a certain direction, it goes into that direction but gives a tiny boost.


Re: Super jump? - MWF2 - 17.09.2010

any1 please help me out


Re: Super jump? - Vince - 17.09.2010

What The Toni said. Just replace Get/SetPlayerPos with Get/SetPlayerVelocity.


Re: Super jump? - Hiddos - 17.09.2010

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP))
  {
    new Float:v[3]; GetPlayerVelocity(playerid, v[0], v[1], v[2]);
    SetPlayerVelocity(playerid, v[0], v[1], v[2]+3);
  }
  return 1;