Unlimited nitro in all cars
#1

how to make that all cars when are spawned has nitro which is unlimited, and when i pres KEY_FIRE then nitro start, when i stop click KEY_FIRE then nitro stop....

then nitro only working while i holding KEY_FIRE!
Reply
#2

pawn Code:
#include < a_samp >

#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))

#define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
    if ( HOLDING( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
    {
          AddVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
    }

    if (  RELEASED( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
    {
          RemoveVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
    }

    return 1;
}
Add as a new filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)