描述

改装车辆时会调用此回调。
姓名 描述
playerid 车辆驾驶员的 ID。
vehicleid 改装车辆的 ID。
componentid 添加到车辆的组件的 ID。

返回

它总是在游戏模式中首先被调用,因此返回 0 也会阻止其他过滤器脚本看到它。

例子

  1. public OnVehicleMod(playerid,vehicleid,componentid)
  2. {
  3. printf("Vehicle %d was modded by ID %d with the componentid %d",vehicleid, playerid,componentid);
  4. if (GetPlayerInterior(playerid) == 0)
  5. {
  6. BanEx(playerid, "Tuning Hacks"); // Anti-tuning hacks script
  7. return 0; // Prevents the bad modification from being synced to other players
  8. //(Tested and it works even on servers wich allow you to mod your vehicle using commands, menus, dialogs, etc..
  9. }
  10. return 1;
  11. }

笔记

提示
此回调不是由 AddVehicleComponent 调用的。