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



OnVehicleRespray - MayaEU - 20.11.2015

Hi, i want to make that when i repair a car in Pay'n spray, it will cost $100 per destroy the vehicle has, but i have made this code, but it doesnt Work?

pawn Код:
public OnVehicleRespray( playerid, vehicleid, color1, color2)
{
    new veh;
    veh = VehicleOwned[vehicleid];
    if(CarInfo[veh][cDestroys] != 0)
    {
        new string[128];
        new amount = CarInfo[veh][cDestroys];
        new price = amount * 100;
        GiveMoney(playerid, -price);
        format(string, sizeof(string), "This %s has %d Destroys, and therefore cost $%d to repair. ",vehName[GetVehicleModel(vehicleid)-400],amount,price);
        SendClientMessage(playerid, COLOR_GREY,string);
    }
    return 1;
}



Re: OnVehicleRespray - MayaEU - 21.11.2015

Anyone?


Re: OnVehicleRespray - PrO.GameR - 21.11.2015

Pay n Sprays can't be detected with native function, you need this for that to be called https://sampforum.blast.hk/showthread.php?tid=360865
The rest of your code seems fine.


Re: OnVehicleRespray - MayaEU - 21.11.2015

Also, i dont want to delete pay n sprays, i just want to make that it cost Money, because my anticheat gives the Money back


Re: OnVehicleRespray - PrO.GameR - 21.11.2015

^^^ Already told ya, it doesn't remove them, it checks when the vehicle HP gets 1000, then checks if they are in pay n sprays, if yes it calls the callback you mentioned.


Re: OnVehicleRespray - MayaEU - 21.11.2015

I dont really get it.. How do i get my code to Work?


Re: OnVehicleRespray - MayaEU - 21.11.2015

Anyone?


Re: OnVehicleRespray - MayaEU - 22.11.2015

Anyone? Rep+


Re: OnVehicleRespray - JaKe Elite - 22.11.2015

I am replying because i wanted to help not for the rep.

The include Pro.Gamer is suggesting to detects the Pay N Spray, IT DOESN'T REMOVE ANYTHING at all. It just detects if they are on Pay N Spray, What is so hard to understand with that??


Re: OnVehicleRespray - MayaEU - 22.11.2015

So i will just have to get the include, and then my code should Work?