Preskoči na vsebino

NPC_IsReloadEnabled

opozorilo

This function was added in omp v1.5.8.3079 and will not work in earlier versions!

Description

Checks if automatic reloading is enabled for an NPC.

NameDescription
npcidThe ID of the NPC

Returns

Returns true if auto-reload is enabled, false otherwise.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkreloadenabled", true))
{
new npcid = PlayerNPC[playerid];
if (npcid == INVALID_NPC_ID)
return SendClientMessage(playerid, 0xFF0000FF, "You are not debugging a NPC.");

if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "Invalid NPC.");

new bool:isReloadEnabled = NPC_IsReloadEnabled(npcid);

SendClientMessage(playerid, 0x00FF00FF, "NPC %d reload enabled: %s", npcid, isReloadEnabled ? "Yes" : "No");
return 1;
}
return 0;
}

Notes

  • Auto-reload makes NPCs automatically reload when their clip is empty
  • NPCs without auto-reload will stop shooting when their clip runs out
  • This only affects clip ammunition, not total ammunition
  • Use NPC_EnableReloading to change the reload setting