for(new i; i<200; i++) { if(!IsPlayerConnected(i)) continue; if(!IsPlayerInAnyVehicle(i)) continue; new Float:fVehicleHealth; GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth); if(fVehicleHealth < 400) SetVehicleHealth(GetPlayerVehicleID(i),1000.0); }
Originally Posted by Jay_
On a timer:
Код:
for(new i; i<200; i++) { if(!IsPlayerConnected(i)) continue; if(!IsPlayerInAnyVehicle(i)) continue; new Float:fVehicleHealth; GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth); if(fVehicleHealth < 400) SetVehicleHealth(GetPlayerVehicleID(i),1000.0); } |
for(new i; i<200; i++) { if(!IsPlayerConnected(i)) continue; if(!IsPlayerInAnyVehicle(i) || !IsPlayerAdmin(i)) continue; new Float:fVehicleHealth; GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth); if(fVehicleHealth < 400) SetVehicleHealth(GetPlayerVehicleID(i),1000.0); }
for(new i; i<200; i++) { if(!IsPlayerConnected(i)) continue; if(!IsPlayerInAnyVehicle(i) || !IsPlayerAdmin(i)) continue; new Float:fVehicleHealth; GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth); if(fVehicleHealth < 400) SetVehicleHealth(GetPlayerVehicleID(i),1000.0); }
//OnGameModeInit SetTimer("AutoRepair",500,1);
forward AutoRepair(); public AutoRepair(){ for(new i=0; i<GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) if(IsPlayerInAnyVehicle(i) && IsPlayerAdmin(i)){ new Float:fVehicleHealth; GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth); if(fVehicleHealth < 400) SetVehicleHealth(GetPlayerVehicleID(i),1000.0); } } }