SA-MP Forums Archive
Removing vehicles soon as Disconnect? - 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: Removing vehicles soon as Disconnect? (/showthread.php?tid=407180)



Removing vehicles soon as Disconnect? - Limbo - 12.01.2013

Well since my other help thread was confusing, I decided to make a more clear one

How Do I remove a vehicle from the server (stop from respawning or showing up)as soon as someone disconnects?

I'm writing a vehicle ownership system and I just wanted to know how I could go about doing that. Cause I can destroy the vehicle, but it will respawn t.t.

Its something i've seen in HBG, and I really liked that feature. You login, your car spawns, you logout, no one can see or use it.


Respuesta: Removing vehicles soon as Disconnect? - Fabio11 - 12.01.2013

hmmm something like this?
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
   
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(!strcmp(Name, VehicleInfo[i][vOwner], true))
        {
            DestroyVehicle(i);
        }
    }
}
Replace VehicleInfo[i][vOwner] with your own variables, ofcourse.