15.08.2016, 19:18
pawn Код:
CMD:respawnallvehicles(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
new string[128];
for(new v = 1; v < GetVehiclePoolSize()+1; v++)
{
if(GetVehicleModel(v) != 510 && !IsVehicleInUse(v) && VehicleSQLID[v] > 0)
{
DestroyVehicle(v);
CreateVehicle(VehModel[v], VehSpawnX[v], VehSpawnY[v], VehSpawnZ[v], VehSpawnAngle[v], VehColour1[v], VehColour2[v],0,VehSiren[v]);
SetVehicleNumberPlate(v, VehPlate[v]);
}
}
format(string, sizeof(string), ""COL_GREEN"All Vehicles Respawned.");
SendClientMessage(playerid, COLOUR_WHITE, string);
SendClientMessageToAll(COLOUR_WHITE, "All vehicles have been respawned.");
return 1;
}
The vehicles tend to have different jobs etc. How do I combat this, if I have deleted a vehicle as well? I'm entirely confused.