Enable/Disable megajump
#2

use a global variable

something like

pawn Код:
new MegaJump[MAX_PLAYERS];
pawn Код:
CMD:megajump(playerid, params[])
{
    if(MegaJump[playerid] == 0)
    {
         new Float:P[3];
         GetPlayerPos(playerid,P[0],P[1],P[2]);
         GetPlayerVelocity(playerid,P[0],P[1],P[2]);
         SetPlayerVelocity(playerid,P[0],P[1],P[2]+5.0);
         MegaJump[playerid] = 1;
    } else if(MegaJump[playerid] == 1) {
         MegaJump[playerid] = 0;
    }
    return 1;
}

    if(PRESSED(KEY_JUMP))
    {
         if(MegaJump[playerid] == 0) return 0;
         new Float:P[3];
         GetPlayerPos(playerid,P[0],P[1],P[2]);
         GetPlayerVelocity(playerid,P[0],P[1],P[2]);
         SetPlayerVelocity(playerid,P[0],P[1],P[2]+5.0);
    }
Not sure if it works
Reply


Messages In This Thread
Enable/Disable megajump - by newbienoob - 21.04.2012, 05:57
Re: Enable/Disable megajump - by RollTi - 21.04.2012, 06:07

Forum Jump:


Users browsing this thread: 1 Guest(s)