Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions reapi/extra/amxmodx/scripting/include/reapi_engine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,24 @@ native bool:rh_is_entity_fullpacked(const host, const entity, const frame = -1);
*/
native Float:rh_get_realtime();

/*
* Checks if server paused
*
* @return Returns true if paused, otherwise false.
*
*/
native bool:rh_is_server_paused();

/*
* Set server pause state
*
* @param status pause state
*
* @noreturn
*
*/
native rh_set_server_pause(const bool:status);

enum MessageHook
{
INVALID_MESSAGEHOOK = 0
Expand Down
5 changes: 4 additions & 1 deletion reapi/include/cssdk/engine/rehlds_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "pr_dlls.h"

#define REHLDS_API_VERSION_MAJOR 3
#define REHLDS_API_VERSION_MINOR 14
#define REHLDS_API_VERSION_MINOR 15

//Steam_NotifyClientConnect hook
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
Expand Down Expand Up @@ -434,6 +434,9 @@ struct RehldsFuncs_t {
void(*MSG_BeginReading)();
double(*GetHostFrameTime)();
struct cmd_function_s *(*GetFirstCmdFunctionHandle)();

// Pause
void(*SetServerPause)(bool status);
};

class IRehldsApi {
Expand Down
10 changes: 10 additions & 0 deletions reapi/include/cssdk/engine/rehlds_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,14 @@ class IRehldsServerData {
virtual void SetName(const char* name) = 0;
virtual class ISteamGameServer *GetSteamGameServer() = 0;
virtual struct netadr_s *GetNetFrom() = 0;
virtual double GetOldTime() = 0;

virtual void SetNetFrom(struct netadr_s *from) = 0;
virtual void SetWorldmapCrc(uint32 crcValue) = 0;
virtual void SetDecalNameNum(int num) = 0;

virtual bool IsActive() = 0;
virtual void SetActive(bool state) = 0;
virtual bool IsPaused() = 0;
virtual void SetPaused(bool state) = 0;
};
30 changes: 30 additions & 0 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,34 @@ cell AMX_NATIVE_CALL rh_is_entity_fullpacked(AMX *amx, cell *params)
return FALSE;
}

/*
* Checks if server paused
*
* @return Returns true if paused, otherwise false.
*
* native bool:rh_is_server_paused();
*/
cell AMX_NATIVE_CALL rh_is_server_paused(AMX *amx, cell *params)
{
return g_RehldsData->IsPaused() ? TRUE : FALSE;
}

/*
* Set server pause state
*
* @param st pause state
*
* @noreturn
*
* native rh_set_server_pause(const bool:status);
*/
cell AMX_NATIVE_CALL rh_set_server_pause(AMX *amx, cell *params)
{
enum { arg_count, arg_status };
g_RehldsFuncs->SetServerPause(params[arg_status] != 0);
return TRUE;
}

AMX_NATIVE_INFO Misc_Natives_RH[] =
{
{ "rh_set_mapname", rh_set_mapname },
Expand All @@ -3773,6 +3801,8 @@ AMX_NATIVE_INFO Misc_Natives_RH[] =
{ "rh_get_realtime", rh_get_realtime },
{ "rh_is_entity_fullpacked", rh_is_entity_fullpacked },
{ "rh_get_client_connect_time", rh_get_client_connect_time },
{ "rh_is_server_paused", rh_is_server_paused },
{ "rh_set_server_pause", rh_set_server_pause },

{ nullptr, nullptr }
};
Expand Down
2 changes: 1 addition & 1 deletion reapi/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
#pragma once

#define VERSION_MAJOR 5
#define VERSION_MINOR 27
#define VERSION_MINOR 28
#define VERSION_MAINTENANCE 0