30.03.2009, 05:52
Someone can give me the script who fix automaticly car when is broken?
srry for my english
srry for my english
SetTimer("CheckBrokenCars",1000,true);
forward CheckBrokenCars(); public CheckBrokenCars() { for(new i;i<MAX_PLAYERS;i++) // i am not absolutely sure about this cycle for controlling all players, i donґt have pawno here, so I canґt control it, so i want someone else to do it ;) { if(IsPlayerConnected && IsPlayerInAnyVehicle) { new car = GetPlayerVehicleID(i); if(GetVehicleHealth(car) < 1000) SetVehicleHealth(car,1000.0); } } }
SetTimer("CheckBrokenCars",1000,true);
forward CheckBrokenCars(); public CheckBrokenCars() { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) { new car = GetPlayerVehicleID(i), Float:carhp; GetVehicleHealth(car, carhp); if(carhp < 1000) SetVehicleHealth(car,1000); } } }
// Top of script
forward CheckBrokenCars();
// OnGameModeInit
SetTimer("CheckBrokenCars",1000,true);
// Somewhere in your script
public CheckBrokenCars()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new car = GetPlayerVehicleID(i), Float:carhp;
GetVehicleHealth(car, carhp);
if(carhp < 1000)
{
SetVehicleHealth(car,1000);
}
}
}
}