02.07.2012, 22:55
Tente assim:
pawn Код:
stock GetEmptyCarEvent()
{
static Percorrer;
for(; Percorrer != MaxNCarro; ++Percorrer){
if(!isVehicleOcuppied(CarroEvento[Percorrer])){
return CarroEvento[Percorrer];
}
}
return -1;
}
stock isVehicleOcuppied(vehicleid)
{
static MaxPlayers, Percorrer;
for(Percorrer = 0,MaxPlayers = GetMaxPlayers(); Percorrer != MaxPlayers; ++Percorrer){
if(IsPlayerInVehicle(Percorrer,vehicleid)){
return true;
}
}
return false;
}
pawn Код:
if(GetEmpytCarEvent() != -1)
{
PutPlayerInVehicle(...);
}
else
{
SendClientMessage(playerid, -1, "Nгo hб carros disponнveis");
}