PHP код:
CMD:resetarveiculos(playerid, params[])
{
SendAdminText(playerid, "/resetarveiculos", params);
if(APlayerData[playerid][PlayerLevel] < 2) return SendClientMessage(playerid, -1, "{ff0000}Vocк precisa ser admin nivel 2 para usar este comando!");
for(new i; i < MAX_VEHICLES; i++)
if(!IsVehicleInUse(i))
SetVehicleToRespawn(i);
return 1;
}
stock IsVehicleInUse(vehicleid)
{
new Veiculo;
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid)
Veiculo = vehicleid;
if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid)
Veiculo = vehicleid;
}
return Veiculo;
}