PutServerInRecordingMode: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{v1_8_beta}} | {{v1_8_beta}} | ||
{{Welcome| | {{Welcome| | ||
desc=Starts playback recording on all players and an hrec file is produced in <source inline>recordings/a_server</source>| | desc=Starts playback recording on all players and an hrec file is produced in <source inline>recordings/a_server/</source>| | ||
params=<source | params=<source>( hrecfilename, rectype=3, flags=REC_ALLNAME)</source> | ||
<poem> | <poem> | ||
::hrecfilename : The name of the hrec file without ".hrec" extension. This file will be created in recordings/a_server folder | ::hrecfilename : The name of the [[.hrec_file|hrec]] file without ".hrec" extension. This file will be created in recordings/a_server folder | ||
::rectype : The [[RecordingTypes|type]] for playback recording which will be started on individual players, which in this case is 3 (PLAYER_RECORDING_TYPE_ALL) | ::rectype : The [[RecordingTypes|type]] for playback recording which will be started on individual players, which in this case is 3 (PLAYER_RECORDING_TYPE_ALL) | ||
::flags : The [[Recording_Flags|flags]] for the playback recording on individual players. Note that it is suitable to have REC_SPAWN so that npc will automatically choose classes. The default value if not provided is REC_ALLNAME (which contains REC_SPAWN, REC_DEATH, etc )</poem> | ::flags : The [[Recording_Flags|flags]] for the playback recording on individual players. Note that it is suitable to have REC_SPAWN so that npc will automatically choose classes. The default value if not provided is REC_ALLNAME (which contains REC_SPAWN, REC_DEATH, etc )</poem>| | ||
note=Calling this function will stop any playback recordings started with [[StartRecordingPlayerData]] or [[StartRecordingAllPlayerData]]| | |||
retvals=Returns true on success and false on failure (server already in recording mode)| | |||
example=<source lang="lua"> | |||
function onScriptLoad() | |||
{ | |||
PutServerInRecordingMode("race", PLAYER_RECORDING_TYPE_ALL, REC_ALLNAME); | |||
} | |||
function onServerStop() | |||
{ | |||
StopServerInRecordingMode(); | |||
} | |||
</source>| | |||
relfuncs=*[[StopServerInRecordingMode]] | |||
*[[IsServerInRecordingMode]] | |||
*[[StartRecordingAllPlayerData]] | |||
*[[IsPlayerRecording]] | |||
}} | }} |
Latest revision as of 17:11, 17 February 2024
This function was added in v1.8 beta and will not work on previous versions.
Description:
Starts playback recording on all players and an hrec file is produced in recordings/a_server/
Parameters:
( hrecfilename, rectype=3, flags=REC_ALLNAME)
hrecfilename : The name of the hrec file without ".hrec" extension. This file will be created in recordings/a_server folder
rectype : The type for playback recording which will be started on individual players, which in this case is 3 (PLAYER_RECORDING_TYPE_ALL)
flags : The flags for the playback recording on individual players. Note that it is suitable to have REC_SPAWN so that npc will automatically choose classes. The default value if not provided is REC_ALLNAME (which contains REC_SPAWN, REC_DEATH, etc )
Return Values:
Returns true on success and false on failure (server already in recording mode)
Important Note:
Calling this function will stop any playback recordings started with StartRecordingPlayerData or StartRecordingAllPlayerData
Example
function onScriptLoad() { PutServerInRecordingMode("race", PLAYER_RECORDING_TYPE_ALL, REC_ALLNAME); } function onServerStop() { StopServerInRecordingMode(); }
Related Functions
The following functions may be helpful as they relate to this function in one way or another.