OnVehicleMod
From SA-MP Wiki
(Difference between revisions)
Revision as of 13:47, 26 July 2013 Mikkel (Talk | contribs) (Added 'OnEnterExitModShop' as a related callback to 'OnVehicleMod'. Also added a note about 'AddVehicleComponent' not calling this callback.) ← Previous diff |
Revision as of 04:07, 5 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|This callback is called when a vehicle is modded.}} | {{Description|This callback is called when a vehicle is modded.}} | ||
Line 35: | Line 34: | ||
[[Category:Scripting Callbacks]] | [[Category:Scripting Callbacks]] | ||
+ | |||
+ | [[fr:OnVehicleMod]] |
Revision as of 04:07, 5 February 2014
Description:
This callback is called when a vehicle is modded.
(playerid, vehicleid, componentid)
playerid | The ID of the driver of the vehicle. |
vehicleid | The ID of the vehicle which is modded. |
componentid | The ID of the component which was added to the vehicle. |
Return Values:
Return 0 to desync the mod (or an invalid mod) from propagating and / or crashing players.
Note | This callback is NOT called by AddVehicleComponent. |
public OnVehicleMod(playerid,vehicleid,componentid) { printf("Vehicle %d was modded by ID %d with the componentid %d",vehicleid,playerid,componentid); if(GetPlayerInterior(playerid) == 0) { BanEx(playerid, "Tuning Hacks"); // Anti-tuning hacks script //(Tested and it works even on servers wich allow you to mod your vehicle using commands, menus, dialogs, etc.. } return 1; }
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- AddVehicleComponent: Add a component to a vehicle.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnEnterExitModShop: Called when a vehicle enters or exits a mod shop.
- OnVehiclePaintjob: Called when a vehicle's paintjob is changed.
- OnVehicleRespray: Called when a vehicle is resprayed.