Skip to content

Add Shavit_StopReplay & Shavit_GetClientReplayBot natives - #1292

Merged
rtldg merged 3 commits into
shavitush:masterfrom
mariokeks:add-stopreplay
Aug 23, 2026
Merged

Add Shavit_StopReplay & Shavit_GetClientReplayBot natives#1292
rtldg merged 3 commits into
shavitush:masterfrom
mariokeks:add-stopreplay

Conversation

@mariokeks

Copy link
Copy Markdown
Contributor

There was previously no clean way to stop a replay bot:

  • For Replay_Central bots, there was no way to stop one at all. Forcibly kicking it would leave it missing for up to several seconds until the cron timer respawns it.
  • For Replay_Dynamic bots, the only option was KickClientEx to kick the bot in the same frame.
  • For Replay_Prop bots, the only option was RemoveEdict, which destroys the prop and bypasses Shavit_OnReplayEnd. OnEntityDestroyed, which handles Replay_Props that mysteriously die, only kicks them (KickReplay) rather than finishing them (FinishReplay)
/**
 * Stops the playback of a replay bot.
 *
 * @param bot                       The replay bot entity.
 * @param client                    Client requesting the stop, or 0 to bypass the permission check.
 * @return                          True if the replay bot has been stopped, false otherwise.
 */
native bool Shavit_StopReplay(int bot, int client = 0);
  • Either a simple check if a client has a active replay bot or a way to get further information of the active replay via the replay bot entity.
/**
 * Retrieves the replay bot (or prop) entity currently tied to a client.
 *
 * @param client                    Client index.
 * @return                          Replay bot entity, 0 if no replay bot is active.
 */
native int Shavit_GetClientReplayBot(int client);

@rtldg

rtldg commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Looks rightish but I didn't test

@rtldg
rtldg merged commit b04bdfe into shavitush:master Aug 23, 2026
2 checks passed
@mariokeks
mariokeks deleted the add-stopreplay branch August 23, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants