SA-MP Forums Archive
Where do I put this code for it to work? - 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: Where do I put this code for it to work? (/showthread.php?tid=463394)



Where do I put this code for it to work? - Grooty - 11.09.2013

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
    new Float:health;
    new vehicle = GetPlayerVehicleID(playerid)
    GetVehicleHealth(vehicle, health);
    if(health < 250)
    {
        SetVehicleHealth(vehicle, 251)
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    }
    if(health = 251)
    {
            GameTextForPlayer(playerid, "~r~Totalled", 10000, 3);
    }



Re: Where do I put this code for it to work? - Beckett - 11.09.2013

- NVM


Re: Where do I put this code for it to work? - DanishHaq - 11.09.2013

Put it under OnPlayerUpdate, or set a reoccurring timer.. however you want.


Re: Where do I put this code for it to work? - BigGroter - 11.09.2013

OnPlayerUpdate() perhaps?


Re: Where do I put this code for it to work? - Grooty - 11.09.2013

Thanks