09.05.2012, 19:52
You're going to have to create a parameter-less callback then run a loop every run.
pawn Код:
public OnGameModeInit()
{
SetTimer("MyCallBack",500,1);
}
forward MyCallBack();
public MyCallBack()
{
new Float:vhp;
for(new vehicleid; vehicleid<MAX_VEHICLES;vehicleid++)
{
if(GetVehicleModel(vehicleid)==0)continue; //only returns 0 when vehicle is invalid (not spawned)
GetVehicleHealth(vehicleid,vhp);
if(vhp<300.0)SetVehicleHealth(vehicleid,300);
}
}