SA-MP Forums Archive
Remove Vehicle? - 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: Remove Vehicle? (/showthread.php?tid=581468)



Remove Vehicle? - Mouiz - 13.07.2015

I want to remove the old player spawn vehicle even if the player is not in his/her old spawned vehicle when the player spawn a new one,please help

PHP код:
CreatePlayerVehicleplayeridmodelid )
{
    new
        
vehicle,
        
Float:x,
        
Float:y,
        
Float:z,
        
Float:angle;
    new 
vehicleid;
    if ( 
GetPlayerStateplayerid ) == PLAYER_STATE_DRIVER )
    {
        
vehicle GetPlayerVehicleIDplayerid );
        
GetVehiclePosvehiclexy);
        
GetVehicleZAnglevehicleangle );
        
DestroyVehiclevehicle );
    }
    else
    {
        
GetPlayerPosplayeridxy);
        
GetPlayerFacingAngleplayeridangle );
    }
    
DestroyVehicle(vehicleid);
    
DestroyVehicle(vehids);
    
vehicle CreateVehiclemodelidxy, ( ), angle, -1, -1DEFAULT_RESPAWN_TIME );
    
LinkVehicleToInteriorvehicleGetPlayerInteriorplayerid ) );
    
#if !defined IGNORE_VIRTUAL_WORLDS
        
SetVehicleVirtualWorldvehicleGetPlayerVirtualWorldplayerid ) );
    
#endif
    #if !defined IGNORE_WARP_INTO_VEHICLE
        
PutPlayerInVehicleplayeridvehicle);
    
#endif
    #if !defined IGNORE_VEHICLE_DELETION
        
gDialogCreatedvehicle ] = true;
    
#endif
    
return 1;