Problem with auto repair ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with auto repair ! (
/showthread.php?tid=401904)
Problem with auto repair ! -
Unirom Shaw - 24.12.2012
Script :
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;
}
That script its work, but it doesn't repair the vehicle body, how to make vehicle body repaired too ?
Re: Problem with auto repair ! -
Unirom Shaw - 24.12.2012
Edited !
Re: Problem with auto repair ! -
InfiniTy. - 24.12.2012
After setvehiclehealth use this :
https://sampwiki.blast.hk/wiki/RepairVehicle
Re: Problem with auto repair ! -
Unirom Shaw - 24.12.2012
Thanks man it work
Of course +Rep