Help with the jump ability
#1

Hello, I am currently trying to change the jump feature of one class.

Basically, I have a timer of 6 seconds, like when you press a key for a high jump and to use it again, must wait 6 seconds. But I want to be able to use jump like three times and then there would be a timer of 6 seconds to do a high jump.

Here is the code:

PHP код:
if(PRESSED(KEY_JUMP))
     {
         if(
team[playerid] == TEAM_TEST)
         {
              if(
pInfo[playerid][pTESTClass] == TEST)
              {
                  if(
gettime() - Abilitys[playerid][HighJump]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
                  {
                    new 
Float:x,Float:y,Float:z;
                    
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
                    
SetPlayerVelocity(playerid,Float:x*3.0,Float:y*3.0,Float:z+1.01.0);
                    
Abilitys[playerid][HighJump] = gettime();
                }
            }
        }
    } 
Reply
#2

PHP код:
if(PRESSED(KEY_JUMP))
{
    if(
team[playerid] == TEAM_TEST)
    {
        if(
pInfo[playerid][pTestClass] == TEST)
        {
            if((
gettime() - Abilitys[playerid][HighJump]) > 6)
            {
                new 
Float:xFloat:yFloat:z;
                
GetPlayerVelocity(playeridxyz);
                
SetPlayerVelocity(playerid, (3.0), (3.0), (1.0));
                
Abilitys[playerid][HighJump] = gettime();
            }
        }
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)