跳到主要内容

NPC_GetWeaponActualReloadTime

注意

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

描述

从游戏数据中获取 NPC 武器的实际(默认)换弹时间。

参数说明
npcidNPC 的 ID
weaponid要检查的武器 ID

返回值

返回默认换弹时间(毫秒),出错时返回-1。

示例

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkweaponactualreloadtime", true))
{
new npcid = PlayerNPC[playerid];
if (npcid == INVALID_NPC_ID)
return SendClientMessage(playerid, 0xFF0000FF, "你没有在调试NPC。");

if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "无效的NPC。");

new weapon = NPC_GetWeapon(npcid);
new reloadtime = NPC_GetWeaponActualReloadTime(npcid, WEAPON:weapon);

SendClientMessage(playerid, 0x00FF00FF, "NPC %d 武器实际装弹时间: %d 毫秒", npcid, reloadtime);
return 1;
}
return 0;
}

注意事项

  • 返回武器的原始游戏换弹时间
  • 这与使用NPC_SetWeaponReloadTime设置的自定义换弹时间不同

相关函数

相关回调