Help with Removing Spawned Vehicle
#2

pawn Код:
new PlayerSpawnedVehicles[MAX_PLAYERS];

public OnPlayerConnect(playerid) {
    PlayerSpawnedVehicles[playerid] = -1;
}

public OnPlayerDisconnect(playerid, reason) {
    if (PlayerSpawnedVehicles[playerid] != -1) {
        DestroyVehicle(PlayerSpawnedVehicles[playerid]);
    }
}

CMD:spawncar(playerid, params[]) {
    if (PlayerSpawnedVehicles[playerid] != -1) {
        DestroyVehicle(PlayerSpawnedVehicles[playerid]);
    }

    // your code

    PlayerSpawnedVehicles[playerid] = CreateVehicle(...);
}
Reply


Messages In This Thread
Help with Removing Spawned Vehicle - by Zenonz - 04.12.2014, 12:10
Re: Help with Removing Spawned Vehicle - by CoaPsyFactor - 04.12.2014, 12:13
Re: Help with Removing Spawned Vehicle - by Zenonz - 04.12.2014, 12:40
Re: Help with Removing Spawned Vehicle - by CoaPsyFactor - 04.12.2014, 12:42

Forum Jump:


Users browsing this thread: 1 Guest(s)