OnVehicleRespray
#1

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;
}
Reply
#2

Anyone?
Reply
#3

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.
Reply
#4

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
Reply
#5

^^^ 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.
Reply
#6

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

Anyone?
Reply
#8

Anyone? Rep+
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)