Removing vehicles soon as Disconnect?
#1

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.
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)