OnVehiclePaintjob

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:11, 19 October 2017
RIDE2DAY (Talk | contribs)

← Previous diff
Revision as of 03:03, 7 December 2017
Romz (Talk | contribs)

Next diff →
Line 10: Line 10:
{{NoReturnCallback|extra=Returning '''0''' won't deny the paintjob change. {{NoReturnCallback|extra=Returning '''0''' won't deny the paintjob change.
* It is always called first in gamemode so returning 0 there blocks other filterscripts from seeing it.}} * It is always called first in gamemode so returning 0 there blocks other filterscripts from seeing it.}}
 +
 +{{Bug|This function calls [[OnVehicleRespray]].}}
{{notes| {{notes|

Revision as of 03:03, 7 December 2017



Description:

Called when a player previews a vehicle paintjob inside a mod shop. Watch out, this callback is not called when the player buys the paintjob.


Parameters:
(playerid, vehicleid, paintjobid)
playeridThe ID of the player that changed the paintjob of their vehicle.
vehicleidThe ID of the vehicle that had its paintjob changed.
paintjobidThe ID of the new paintjob.


Return Values:

This callback does not handle returns. Returning 0 won't deny the paintjob change.
  • It is always called first in gamemode so returning 0 there blocks other filterscripts from seeing it.


Image:32px-Circle-style-warning.png

Warning

Known Bug: This function calls OnVehicleRespray.


Image:32px-Ambox_warning_orange.png

Notes

  • This callback is not called by ChangeVehiclePaintjob.
  • You might use OnVehicleChangePaintjob from vSync in order to know when the player buys the paintjob.


Example Usage:

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    new string[128];
    format(string, sizeof(string), "You have changed your vehicle's paintjob to %d!", paintjobid);
    SendClientMessage(playerid, 0x33AA33AA, 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