跳到主要内容

GetVehicleModelCount

注意

这个函数是在omp v1.1.0.2612中添加的,在以前的版本中不起作用!

描述

获取指定车辆模型在服务器上的实例数量。

参数

参数名说明
modelid目标车辆模型的 ID

示例代码

public OnGameModeInit()
{
CreateVehicle(560, 2112.7607, -1308.3751, 23.6797, 90.0000, -1, -1, 100);
CreateVehicle(560, 2104.5730, -1308.3313, 23.6797, 90.0000, -1, -1, 100);
CreateVehicle(560, 2120.3616, -1308.4973, 23.6797, 90.0000, -1, -1, 100);

new modelid = 560;
printf("车辆模型:%d - 数量:%d", modelid, GetVehicleModelCount(modelid)); // 车辆模型:560 - 数量:3
}

相关函数