Skip to content

Commit

Permalink
host_pause
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-up committed Jul 18, 2024
1 parent 27b8e66 commit 719f2f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion reapi/extra/amxmodx/scripting/include/reapi_engine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ native bool:rh_is_paused();
*
* @noreturn
*/
native rh_set_paused(const bool:st);
native rh_set_paused(const bool:st, const bool:host);

/*
* Checks if a specific entity is fully packed in a given frame for a host client.
Expand Down
1 change: 1 addition & 0 deletions reapi/include/cssdk/engine/rehlds_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ struct RehldsFuncs_t {
void(*RemoveExtDll)(void *hModule);
void(*RemoveCvarListener)(const char *var_name, cvar_callback_t func);
ENTITYINIT(*GetEntityInit)(char *pszClassName);
void(*Host_Pause)(bool setPause);

// Read functions
int(*MSG_ReadChar)();
Expand Down
13 changes: 9 additions & 4 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3743,11 +3743,16 @@ cell AMX_NATIVE_CALL rh_is_paused(AMX *amx, cell *params)
*
* native rh_set_paused(const bool:st);
*/
cell AMX_NATIVE_CALL rh_set_paused(AMX *amx, cell *params)
cell AMX_NATIVE_CALL rh_set_pause(AMX *amx, cell *params)
{
enum { arg_count, arg_st };
g_RehldsData->SetPaused(params[arg_st] != 0);
enum { arg_count, arg_st, arg_host };
bool isPause = params[arg_st] != 0;

g_RehldsData->SetPaused(isPause);
if (params[arg_host] != 0)
{
g_RehldsFuncs->Host_Pause(isPause);
}
return TRUE;
}

Expand All @@ -3764,7 +3769,7 @@ AMX_NATIVE_INFO Misc_Natives_RH[] =
{ "rh_is_entity_fullpacked", rh_is_entity_fullpacked },
{ "rh_get_client_connect_time", rh_get_client_connect_time },
{ "rh_is_paused", rh_is_paused },
{ "rh_set_paused", rh_set_paused },
{ "rh_set_paused", rh_set_pause },

{ nullptr, nullptr }
};
Expand Down

0 comments on commit 719f2f8

Please sign in to comment.