02.09.2013, 17:14
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;
}