SA-MP Forums Archive
Activate 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)
+--- Thread: Activate Super Jump (/showthread.php?tid=370615)



Activate Super Jump - kbalor - 20.08.2012

So if I type /sj then Super jump will activate

then let's say /sjoff then jump will go back to normal.


I've got this script but you must type /jump everytime.
pawn Код:
if (strcmp("/jump", cmdtext, true, 10) == 0)
    {
    new Float:SuperJump[3];
    GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
    SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
    return 1;
    }



Re: Activate Super Jump - detter - 20.08.2012

you need to put that under OnPlayerKeyStateChange
.. you check if player pressed jump , and super jump is true ,then you increase velocity...


Re: Activate Super Jump - kbalor - 20.08.2012

Quote:
Originally Posted by detter
Посмотреть сообщение
you need to put that under OnPlayerKeyStateChange
.. you check if player pressed jump , and super jump is true ,then you increase velocity...
If you know, can you make a simple demo? thanks!


Re: Activate Super Jump - detter - 20.08.2012

Код:
if(newkys == KEY_JUMP )
{
   if( super_jump[playerid] == 1)
  {
      if(!IsPlayerInAnyVehicle(playerid) )
      {
          new Float:SuperJump[3];
          GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
          SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
      }
      else return SendClientMessage(playerid ,COLOR_ORANGE ,"You can't super jump while you are in vehicle!");
  }
}



Re: Activate Super Jump - [MWR]Blood - 20.08.2012

nvm >_>


Re: Activate Super Jump - kbalor - 20.08.2012

Quote:
Originally Posted by detter
Посмотреть сообщение
Код:
if(newkys == KEY_JUMP )
{
   if( super_jump[playerid] == 1)
  {
      if(!IsPlayerInAnyVehicle(playerid) )
      {
          new Float:SuperJump[3];
          GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
          SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
      }
      else return SendClientMessage(playerid ,COLOR_ORANGE ,"You can't super jump while you are in vehicle!");
  }
}
OMG! thanks +rep but how do I enable/disable it?


Re: Activate Super Jump - [MWR]Blood - 20.08.2012

Well, just make a command that sets the variable either to true or false.


Re: Activate Super Jump - detter - 20.08.2012

With your /sj cmd


Re: Activate Super Jump - Lordzy - 20.08.2012

Super Jump deativate command.
pawn Код:
CMD:sjoff(playerid,params[])
{
      super_jump[playerid]=0;
      SendClientMessage(playerid,0xFF0000,"Super Jump Deactivated");
      return 1;
}



Re: Activate Super Jump - kbalor - 20.08.2012

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
Super Jump deativate command.
pawn Код:
CMD:sjoff(playerid,params[])
{
      super_jump[playerid]=0;
      SendClientMessage(playerid,0xFF0000,"Super Jump Deactivated");
      return 1;
}
Thanks for your reply and you guys!


To make it clear. I will type /firedup the command will only activate for the one who use the command. If /firedoff then deactivate like a normal jump.

pawn Код:
dcmd_firedup(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 1 || AccInfo[playerid][pVip] >= 1)
    {
        SetPlayerAttachedObject( playerid, 0, 18693, 5, 0.053428, -1.382621, -1.953219, 325.843124, 1.167475, 0.000000, -22.718177, 1.000000, 1.458621 );
        SetPlayerAttachedObject( playerid, 1, 18693, 6, -0.377174, 0.12345, 1.616164, 173.564910, 14.640313, 0.000000, 1.000000, 1.000000, 1.000000 );
        return 1;
    }
    else return ErrorMessages(playerid, 1);
}