முதன்மை உள்ளடக்கத்துக்குச் செல்லவும்

NPC_LoadRecord

எச்சரிக்கை

செயல்பாடு என்பது omp v1.5.8.3079 பதிப்பில் சேர்க்கப்பட்டது. இது முந்தைய பதிப்புகளில் இயங்காது!

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​

  • Load recordings before using them with NPC_StartPlayback
எச்சரிக்கை

Unlike NPC_StartPlayback, filePath requires the full path from the server root, and the .rec extension.
Example: npcmodes/recordings/myrecording.rec