24.12.2012, 13:34
Script :
That script its work, but it doesn't repair the vehicle body, how to make vehicle body repaired too ?
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
forward AutoRepair();
public OnFilterScriptInit()
{
SetTimer("AutoRepair", 1000, 1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public AutoRepair() {
for(new playerid=0; playerid<MAX_PLAYERS; playerid++) {
if(IsPlayerConnected(playerid)) {
new Float:health, cid;
if (IsPlayerInAnyVehicle(playerid)) {
cid = GetPlayerVehicleID(playerid);
GetVehicleHealth(cid, health);
if (health < 999) {
SetVehicleHealth(cid,1000);
}
}
}
}
return 1;
}