SA-MP Forums Archive
Delete vehicle on Disconnect [+REP] - 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: Delete vehicle on Disconnect [+REP] (/showthread.php?tid=396046)



Delete vehicle on Disconnect [+REP] - Threshold - 29.11.2012

Hello,
Guys i have this car spawner, Thats in the /v [CarName] [Color1] [Color2] format. Now. Spawns and everything alright. But, I want the vehicle they created to delete when they disconnect. If seombody can help me here i will Rep.

Heres the script.
http://pastebin.com/uLsK3whJ


Re: Delete vehicle on Disconnect [+REP] - maramizo - 29.11.2012

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(PlayerInfo[playerid][pSpawnVehicle]) //If the player spawned a vehicle.
    {
        DestroyVehicle(PlayerInfo[playerid][pSpawnVehicle]); //destroy it.
    }
    return 1;
}



Re: Delete vehicle on Disconnect [+REP] - Threshold - 29.11.2012

That works. Now like. I just noticed. When my friend or somebody spawns lets say a elegy. Then another spawns a car after him. My friends car disappears. Is there a way to fix this? ..