From c249a1d0acb18ede0ededb0340d204a2923d6d43 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:33:31 +0800 Subject: [PATCH] [server] Implement and match `n_GameModeExit(...)` --- server/scrcustom.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index 111c2b6..6e76c2e 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -5,6 +5,8 @@ int set_amxstring(AMX *amx,cell amx_addr,const char *source,int max); +extern BOOL bGameModeFinished; + //---------------------------------------------------------------------------------- // native gpci(playerid, const clientid[], len) @@ -272,9 +274,16 @@ static cell AMX_NATIVE_CALL n_GetSVarsUpperIndex(AMX *amx, cell *params) return 0; } +// native GameModeExit() static cell AMX_NATIVE_CALL n_GameModeExit(AMX *amx, cell *params) { - // TODO: GameModeExit + if(pNetGame->SetNextScriptFile(NULL)) { + bGameModeFinished = TRUE; + } else { + logprintf("The gamemode finished and I couldn't start another script."); + fcloseall(); + exit(1); + } return 0; }