SA-MP Forums Archive
unspawned vehicle in game after offline. - 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: unspawned vehicle in game after offline. (/showthread.php?tid=614532)



unspawned vehicle in game after offline. - jimdo - 09.08.2016

I wonder, how can I make unspawned vehicle for offline-player? Because when they're offline, the vehicle is still available in game.


Re: unspawned vehicle in game after offline. - Freaksken - 09.08.2016

When they leave the server: DestroyVehicle.
When they join the server: CreateVehicle.
To destroy the vehicle, you will need to store the vehicleID somewhere.


Re: unspawned vehicle in game after offline. - jimdo - 10.08.2016

I mean, I don't want to use any command to destroy the vehicle
Since it's RP server, I want the server automatically unspawn the vehicle..


Re: unspawned vehicle in game after offline. - Tass007 - 10.08.2016

Yeah exactly. So it'll be for example

PHP код:
public OnPlayerConnect(playerid)
{
    if(
PlayerInfo[playerid][VehicleOwned] == 1)
    {
          
CreateVehicle.....etc
    
}
    return 
1;
}

OnPlayerDisconnect(playeridreason)
{
    if(
PlayerInfo[playerid][VehicleOwned] == 1)
    {
          
DestoryVehicle.....etc
    
}
    return 
1;