Quote:
Originally Posted by MouseBreaker
The script is really messy.
But you can save the vehicle ID in a variable and remove it after spawn another one.
pawn Код:
new SpawnedVehicle[MAX_PLAYERS];
if(IsValidVehicle(SpawnedVehicle[playerid])) DestroyVehicle(SpawnedVehicle[playerid]); SpawnedVehicle[playerid] = CreateVehicle(...);
Important! Don't forgot to reset the variable and remove the vehicle after the player leaves the server.
pawn Код:
public OnPlayerDisconnect(playerid, reason) { if(IsValidVehicle(SpawnedVehicle[playerid])) DestroyVehicle(SpawnedVehicle[playerid]); SpawnedVehicle[playerid] = INVALID_VEHICLE_ID; return 1; }
The function IsValidVehicle is not defined in a_samp include, because of that don't forgot to add.
pawn Код:
native IsValidVehicle(vehicleid);
Top of your script.
|
umm i don't understand the part
pawn Код:
SpawnedVehicle[playerid] = CreateVehicle(...);
what should i put in the (...) ?