StartRecordingPlayback: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
params=<syntaxhighlight lang="lua">(playbacktype, recordname)</syntaxhighlight>
params=<syntaxhighlight lang="lua">(playbacktype, recordname)</syntaxhighlight>
<poem>::playbacktype : The [[RecordingTypes|type]] of the recording to be loaded
<poem>::playbacktype : The [[RecordingTypes|type]] of the recording to be loaded
::recordname : The name of the [[.rec_file|.rec]] file to run.</poem>|
::recordname : The name of the [[.rec_file|.rec]] file (without extension) to run.</poem>|
retvals=True on success and null on failure ( file not found or header different version )|
retvals=True on success and null on failure ( file not found or header different version )|
example=<source lang="Lua">
example=<source lang="Lua">

Revision as of 05:42, 3 October 2023


Description:
This will run a .rec file which has to be saved in the npcscripts/recordings folder. The NPC will follow the actions recorded in the file.


Parameters:

(playbacktype, recordname)

playbacktype : The type of the recording to be loaded
recordname : The name of the .rec file (without extension) to run.


Return Values:
True on success and null on failure ( file not found or header different version )


Example

function OnNPCEnterVehicle(vehicleid, seatid)
{
	print("I entered vehicle "+vehicleid+" and my seat is "+seatid+"\n");
	StartRecordingPlayback(2,"stretch");
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.