04.12.2014, 12:13
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(...);
}