OnVehicleMod
Description:
Callback OnVehicleMod is called when a vehicle is modded.
Callback OnVehicleMod is NOT called by AddVehicleComponent. |
Parameters:
(playerid, vehicleid, componentid)
int | playerid | The ID of the driver of the vehicle. |
int | vehicleid | The ID of the vehicle which is modded. |
int | 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.
- It is always called first in gamemode so returning 0 there also blocks other filterscripts from seeing it.
Examples:
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 return 0; // Prevents the bad modification from being synced to other players //(Tested and it works even on servers wich allow you to mod your vehicle using commands, menus, dialogs, etc.. } return 1; }
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.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- AddVehicleComponent: Add a component to a vehicle.