SA-MP Forums Archive
disable parachute - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: disable parachute (/showthread.php?tid=461603)



disable parachute - SampzzonE - 02.09.2013

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


Re : disable parachute - 1Geek - 02.09.2013

Use the forbidden weapons and add exceptions for deathmatches


Re: disable parachute - SampzzonE - 02.09.2013

what


Re : disable parachute - Matnix - 02.09.2013

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?


Re: disable parachute - Tomer!.$ - 02.09.2013

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;




Re : disable parachute - 1Geek - 02.09.2013

DELETED


Re : disable parachute - 1Geek - 02.09.2013

DELETED


Re : disable parachute - 1Geek - 02.09.2013

This is the final code xD


Re: disable parachute - Konstantinos - 02.09.2013

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;
}



Re: disable parachute - SampzzonE - 03.09.2013

thanks