Problem with auto repair !
#1

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 ?
Reply
#2

Edited !
Reply
#3

After setvehiclehealth use this :
https://sampwiki.blast.hk/wiki/RepairVehicle
Reply
#4

Thanks man it work
Of course +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)