disable parachute
#1

Hi everyone!

I have a question... How can i disable the parachute? Because i want to be rare...Is very easy if you enter in heli (or other plane) and you exit...


T H X
Reply
#2

Use the forbidden weapons and add exceptions for deathmatches
Reply
#3

what
Reply
#4

pawn Код:
//OnPlayerStateChange
if (newstate == PLAYER_STATE_DRIVER)
{
    if (GetVehicleModel(GetPlayerVehicleID(playerid)) == ID) // id = vehicule id
    {
            // remove players parachute by giving him the parachute with -1
     }
}

I don't know if it's will work - correct me if I'm wrong?
Reply
#5

PHP код:
public OnPlayerExitVehicle(playeridvehicleid)
{
    if(
GetVehicleModel(vehicleid) == 487 || GetVehicleModel(vehicleid) == 488 || GetVehicleModel(vehicleid) == 497// These are the IDs of all the Maverick (helicopter) types.
    
{
        
// Make a command to check what weapons the player is holding based on your script.
        
ResetPlayerWeapons(playerid);
        
// Give the player his weapons back.
    
}
    return 
1;

Reply
#6

DELETED
Reply
#7

DELETED
Reply
#8

This is the final code xD
Reply
#9

When a player presses f/enter key to exit the vehicle, it checks if the vehicle is an aircraft. If it is, it stores the weapons and the ammo to an array, it resets the weapons and it gives them back except weaponid 46 which is parachute.
pawn Код:
public OnPlayerExitVehicle( playerid, vehicleid )
{
    if( IsVehicleAircraft( vehicleid ) )
    {
        new
            weapons[ 13 ][ 2 ]
        ;
        for( new i = 0; i < 13; i++ ) GetPlayerWeaponData( playerid, i, weapons[ i ][ 0 ], weapons[ i ][ 1 ] );
        ResetPlayerWeapons( playerid );
        for( new i = 0; i < 13; i++ ) if( weapons[ i ][ 0 ] != 46 ) GivePlayerWeapon( playerid, weapons[ i ][ 0 ], weapons[ i ][ 1 ] );
    }
}

stock IsVehicleAircraft( vehicleid )
{
    new
        model = GetVehicleModel( vehicleid )
    ;
    switch( model )
    {
        case 417, 428, 447, 460, 469, 476, 487, 488, 497, 511 .. 513, 519, 520, 548, 553, 563, 577, 592, 593: return 1;
    }
    return 0;
}
Reply
#10

thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)