csgo-plugins/includes/connecthook.inc
2020-03-25 20:09:12 +02:00

51 lines
1.3 KiB
SourcePawn

#if defined _connecthook_included
#endinput
#endif
#define _connecthook_included
enum EConnect
{
k_OnClientPreConnectEx_Reject = 0,
k_OnClientPreConnectEx_Async = 1,
k_OnClientPreConnectEx_Accept = 2,
};
typedef PreConnectHook = function EConnect (int id, const char[] sName, const char[] sPassword, const char[] sIP, const char[] sSteam32ID, char sRejectReason[512]);
// The lower priority value takes more precedence.
native void ClientPreConnect_Hook(int prio, PreConnectHook func);
native void ClientPreConnect_Unhook(int prio, PreConnectHook func);
native bool ClientPreConnect_Reject(int id, const char[] reason);
native bool ClientPreConnect_Accept(int id);
native int ClientPreConnect_GetConnectClientCount();
public Extension __ext_connecthook =
{
name = "connecthook",
file = "connecthook.ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_EXTENSIONS
public void __ext_connecthook_SetNTVOptional()
{
MarkNativeAsOptional("ClientPreConnect_Hook");
MarkNativeAsOptional("ClientPreConnect_Unhook");
MarkNativeAsOptional("ClientPreConnect_Reject");
MarkNativeAsOptional("ClientPreConnect_Accept");
MarkNativeAsOptional("ClientPreConnect_GetConnectClientCount");
}
#endif