OnVehicleRespray

From SA-MP Wiki

Jump to: navigation, search


Description:

The callback name is deceptive, this callback is called when a player exits a mod shop, regardless of whether the vehicle's colors were changed, and is NEVER called for pay 'n' spray garages.


Parameters:
(playerid, vehicleid, color1, color2)
playeridThe ID of the player that is driving the vehicle.
vehicleidThe ID of the vehicle that was resprayed.
color1The color that the vehicle's primary color was changed to.
color2The color that the vehicle's secondary color was changed to.


Return Values:

Returning 0 in this callback will deny the colour change. Returning 1 will allow it. This can be used to prevent hackers from changing vehicle colours using cheats.


Image:32px-Ambox_warning_orange.png

Note

Misleadingly, this callback is not called for pay 'n' spray (only modshops).

Fix here: http://pastebin.com/G81da7N1


Example Usage:

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    new string[48];
    format(string, sizeof(string), "You resprayed vehicle %d to colors %d and %d!", vehicleid, color1, color2);
    SendClientMessage(playerid, COLOR_GREEN, string);
    return 1;
}

Related Functions

The following functions might be useful, as they're related to this callback in one way or another.


Related Callbacks

The following callbacks might be useful as well, as they are related to this callback in one way or another.

Personal tools
In other languages