---
title: "NPC_UnloadAllRecords | open.mp"
description: "Unloads all NPC recording files from memory."
canonical: https://omp.itsneufox.com/docs/scripting/functions/NPC_UnloadAllRecords
language: en
---

# NPC\_UnloadAllRecords

warning

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

## Description

Unloads all NPC recording files from memory to free up resources.

## Returns

Returns `true` if all records were unloaded successfully, `false` otherwise.

## Examples

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/npcunloadallrecords", true))
    {
        new bool:success = NPC_UnloadAllRecords();

        if (success)
            SendClientMessage(playerid, 0x00FF00FF, "All records unloaded successfully");
        else
            SendClientMessage(playerid, 0xFF0000FF, "Failed to unload all records");
        return 1;
    }
    return 0;
}
```

## Notes

-   This frees up memory used by loaded recordings
-   All record IDs become invalid after this function
-   Any NPCs using these recordings will stop playback

## Related Functions

-   [NPC\_LoadRecord](https://omp.itsneufox.com/docs/scripting/functions/NPC_LoadRecord): Load a recording file
-   [NPC\_UnloadRecord](https://omp.itsneufox.com/docs/scripting/functions/NPC_UnloadRecord): Unload specific recording
-   [NPC\_GetRecordCount](https://omp.itsneufox.com/docs/scripting/functions/NPC_GetRecordCount): Get number of loaded records
-   [NPC\_IsValidRecord](https://omp.itsneufox.com/docs/scripting/functions/NPC_IsValidRecord): Check if record is valid

## Related Callbacks

-   [OnNPCPlaybackEnd](https://omp.itsneufox.com/docs/scripting/callbacks/OnNPCPlaybackEnd): Called when playback ends
