23.08.2014, 14:02
їLo haces con un timer?. Podrнas detectar, en un timer de 1 segundo y que se repita, esa funciуn. Pero que sea global, para todos los coches, es decir, no hace falta que definas parбmetros en la funciуn, porque se ejecutarнa para todos los coches. Creando un contador, podes verificar el estado de todos los coches
El mensaje creo que es innecesario, ya que tambiйn chequearнa los vehнculos sin conductor.
pawn Код:
SetTimer("ComprobarCoches",1000,true);
pawn Код:
forward ComprobarCoches();
public ComprobarCoches()
{
new Float:health;
for(new i=1; i<MAX_VEHICLES; i++)
{
GetVehicleHealth(i,health);
if(health <= 500)
{
SetVehicleHealth(i, 500.0);
new car,engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(car,false,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,red,"ЎMotor demasiado daсado!");
}
}
}