Destroy last car made?
#2

You need a create an array of Player Vehicles.

pawn Код:
new g_PlayerCars[MAX_PLAYERS]; // Create an array to store the current vehicle of all the players.
OnPlayerConnect
pawn Код:
g_PlayerCars[playerid] = -1; // As it defaults to 0, someone else's car might be destroyed.
Then when you're creating the vehicle
pawn Код:
g_PlayerCars[playerid] = CreateVehicle(... // CreateVehicle returns the ID of the vehicle which will be stored in g_PlayerCars
Before you create the vehicle and OnPlayerDisconnect
pawn Код:
DestroyVehicle(g_PlayerCars[playerid]); // Destroy current vehicle before creating another.
Reply


Messages In This Thread
Destroy last car made? - by SnG.Scot_MisCuDI - 06.12.2011, 22:02
Re: Destroy last car made? - by JamesC - 06.12.2011, 22:27
Re: Destroy last car made? - by SnG.Scot_MisCuDI - 06.12.2011, 22:41
Re: Destroy last car made? - by THE_KNOWN - 07.12.2011, 01:33

Forum Jump:


Users browsing this thread: 1 Guest(s)