跳到主要内容

GetVehicleComponentType

描述

根据组件 ID 获取其对应的改装槽位类型

参数名说明
component要检查的组件 ID

返回值

返回指定组件的槽位 ID,若组件无效则返回 -1

示例

public OnVehicleMod(playerid, vehicleid, componentid)
{
new
CARMODTYPE:componentType = GetVehicleComponentType(componentid);

if (componentType != CARMODTYPE_NONE)
{
new
string[64];

format(string, sizeof(string), "你在 %i 号槽位改装了车辆", componentType);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "无效的改装组件");
}
return 1;
}

相关函数

相关回调