Chuyển tới nội dung chính

NPC_LoadRecord

cảnh báo

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

Description

Loads an NPC recording file for playback use.

NameDescription
const filePathThe path to the recording file

Returns

Returns the ID of the loaded recording, or INVALID_RECORD_ID on failure.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/npcloadrecord ", true, 15))
{
new filepath[128];
new len = strlen(cmdtext);
if (len <= 15)
return SendClientMessage(playerid, 0xFF0000FF, "Usage: /npcloadrecord [filepath]");

strmid(filepath, cmdtext, 15, len);

new recordid = NPC_LoadRecord(filepath);

if (recordid == -1)
SendClientMessage(playerid, 0xFF0000FF, "Failed to load record from: %s", filepath);
else
SendClientMessage(playerid, 0x00FF00FF, "Record loaded from %s with ID: %d", filepath, recordid);
return 1;
}
return 0;
}

Notes

  • Files should have .rec extension but don't include it in filename
  • Load recordings before using them with NPC_StartPlayback