07.03.2014, 11:34
Do you want an Auto Repair script?
pawn Код:
//on top of your script
forward FixAllCars();
new FixTimer;
// OnGameModeInit
FixTimer = SetTimer("FixAllCars", 1000, true);
//OnGameModeExit
KillTimer(FixTimer);
//------------------
public FixAllCars()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
// loop all possible player
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
//if the player is connected AND in a car
{
new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
SetVehicleHealth(vehicleid,1000.0);// set the vehicle health
}
}
}