19.01.2014, 21:29
Isto deve resolver o seu problema
:
Espero ter ajudado
.

pawn Код:
stock ResetarVeiculos()
{
static bool:TrailerEmUso[MAX_VEHICLES];
new Ciclo = 1;
for(new x = 1; x <= MAX_VEHICLES; x++)
{
switch(Ciclo)
{
case 1:
{
if(IsTrailerAttachedToVehicle(x))
{
TrailerEmUso[GetVehicleTrailer(x) - 1] = true;
}
}
case 2:
{
new bool:Ocupado;
for(new y = 0, z = GetMaxPlayers(); y != z; y++)
{
if(IsPlayerInVehicle(y, x))
{
Ocupado = true;
}
}
if(!Ocupado && !TrailerEmUso[x - 1])
{
SetVehicleToRespawn(x);
}
}
case 3:
{
TrailerEmUso[x - 1] = false;
}
}
if(x == MAX_VEHICLES && Ciclo < 3)
{
x = 0;
Ciclo++;
}
}
return true;
}
Espero ter ajudado
