Need this.
#3

PHP Code:
// Simple Jump / Speed / Fix using keys.
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define JUMP_MULTIPLIER 0.5
#define SPEED_MULTIPLIER 1.5
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    
// Speed Boost (Press ALT / LCTRL)
    
if( HOLDINGKEY_ACTION ) )
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER// Only the driver of the vehicle is able to do this!
        
{
            new
                
Float:f_xFloat:f_yFloat:f_z;
                   
            
GetVehicleVelocity(GetPlayerVehicleID(playerid), f_xf_yf_z);
            
SetVehicleVelocity(GetPlayerVehicleID(playerid), f_x SPEED_MULTIPLIERf_y SPEED_MULTIPLIERf_z SPEED_MULTIPLIER);
        }
    }
    
    
// Flip & Fly (Press 2)
    
if( HOLDINGKEY_SUBMISSION ) )
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER// Only the driver of the vehicle will be able to do this!
        
{
            new
                
Float:f_xFloat:f_yFloat:f_zvID GetPlayerVehicleID(playerid);
            
            
// Fly
            
GetVehicleVelocity(vIDf_xf_yf_z);
            
SetVehicleVelocity(vIDf_xf_yf_z JUMP_MULTIPLIER);
            
            
// Repair
            
RepairVehicle(vID);
            
SetVehicleHealth(vID1000.0);
        }
    }
    return 
1;

Reply


Messages In This Thread
Need this. - by VZMatt - 15.06.2016, 21:18
Re: Need this. - by GangstaSunny - 15.06.2016, 23:45
Re: Need this. - by Jf - 16.06.2016, 00:37

Forum Jump:


Users browsing this thread: 1 Guest(s)