Ga naar hoofdinhoud

NPC_UnloadRecord

waarschuwing

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

Description

Unloads a specific NPC recording from memory to free up resources.

NameDescription
recordIdThe ID of the record to unload

Returns

Returns true if the record was unloaded successfully, false otherwise.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/npcunloadrecord ", true, 17))
{
new recordid = strval(cmdtext[17]);

new bool:success = NPC_UnloadRecord(recordid);

if (success)
SendClientMessage(playerid, 0x00FF00FF, "Record %d unloaded successfully", recordid);
else
SendClientMessage(playerid, 0xFF0000FF, "Failed to unload record %d", recordid);
return 1;
}
return 0;
}

Notes

  • Frees memory used by the specific recording
  • The record ID becomes invalid after unloading
  • Any NPCs using this recording will stop playback
  • Use NPC_UnloadAllRecords to unload all recordings at once