SA-MP Forums Archive
OnvehicleDamageStatusUpdate - 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: OnvehicleDamageStatusUpdate (/showthread.php?tid=601233)



OnvehicleDamageStatusUpdate - Mister0 - 18.02.2016

Hello, I try to creat an anty vehicle repair hack, but I have some problem what is wrong?, what is wrong in code?

PHP код:
new panelss[MAX_VEHICLES], doo..... all created
public OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
    
GetVehicleDamageStatus(vehicleidpanelss[vehicleid], doorss[vehicleid], lightss[vehicleid], tiress[vehicleid]);
    if(!
IsVehicleOccupied(vehicleid))
    {
        
UpdateVehicleDamageStatus(vehicleidpanelss[vehicleid], doorss[vehicleid], lightss[vehicleid], tiress[vehicleid]);
        if(
panelss[vehicleid]==0)
         {
            
SendClientMessage(GetVehicleDriver(vehicleid),-1,"You Have RepairHack");
            
UpdateVehicleDamageStatus(vehicleidpanelss[vehicleid], doorss[vehicleid], lightss[vehicleid], tiress[vehicleid]);
        }
    }
    return 
1;

I saw, when panelss are 0, the car is complet repaired, so I put if = 0 the car is repaired hacker, but don't work, after I destroyed the car and I saw the panelss are 55717137, so I put if panel <55717137 and don't work,
The message, are not displayed in any variante,
Some help please?


Re: OnvehicleDamageStatusUpdate - Vince - 18.02.2016

I trust you know what the ! operator does. You're saying: if the vehicle is NOT occupied (i.e. empty), get its driver. Which is utterly pointless and illogical.


Re: OnvehicleDamageStatusUpdate - Mister0 - 19.02.2016

I write wrong the code, but when I damage my car, if I going in a pole it say the message, he need to say when I repair not when I scrach it