From 02cb4b94f5be106993b6ca61c28676230918c922 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 1 Sep 2004 21:13:30 +0000 Subject: [PATCH] Commited new SDK --- amxmodx/modules.cpp | 9 +++++++++ amxmodx/sdk/amxxmodule.cpp | 2 ++ amxmodx/sdk/amxxmodule.h | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index 20103ae5..4a778cfe 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -703,6 +703,14 @@ char *MNF_FormatAmxString(AMX *amx, cell *params, int startParam, int *pLen) return retVal; } +int MNF_GetPlayerFlags(int id) +{ + if (id < 1 || id > gpGlobals->maxClients) + return 0; + CPlayer *pPlayer = GET_PLAYER_POINTER_I(id); + return (pPlayer->flags[0]); +} + void MNF_CopyAmxMemory(cell * dest, const cell * src, int len) { memcpy((void*)dest, (const void *)src, (size_t)len*sizeof(cell)); @@ -910,6 +918,7 @@ void *Module_ReqFnptr(const char *funcName) REGISTER_FUNC("PrepareCharArray", prepareCharArray) // Player + REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags) REGISTER_FUNC("IsPlayerValid", MNF_IsPlayerValid) REGISTER_FUNC("GetPlayerName", MNF_GetPlayerName) REGISTER_FUNC("GetPlayerIP", MNF_GetPlayerIP) diff --git a/amxmodx/sdk/amxxmodule.cpp b/amxmodx/sdk/amxxmodule.cpp index f18e0c17..3350186e 100755 --- a/amxmodx/sdk/amxxmodule.cpp +++ b/amxmodx/sdk/amxxmodule.cpp @@ -2479,6 +2479,7 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; PFN_AMX_FINDNATIVE g_fn_AmxFindNative; +PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; // *** Exports *** C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) @@ -2577,6 +2578,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV); REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR); REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH); + REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS); // Memory REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR); diff --git a/amxmodx/sdk/amxxmodule.h b/amxmodx/sdk/amxxmodule.h index 35534730..2294e4a7 100755 --- a/amxmodx/sdk/amxxmodule.h +++ b/amxmodx/sdk/amxxmodule.h @@ -1934,6 +1934,7 @@ typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/); typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/); typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/); typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/); +typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/); typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/); typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/); typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/); @@ -2017,6 +2018,7 @@ extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName; extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward; extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File; extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative; +extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2065,6 +2067,7 @@ cell amx_ftoc (float x) { } int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { } int MF_RegisterSPForward (AMX * amx, int func, ...) { } void MF_UnregisterSPForward (int id) { } +int MF_GetPlayerFlags (int id) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2119,6 +2122,7 @@ void MF_Log(const char *fmt, ...); #define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName #define MF_RegisterSPForward g_fn_RegisterSPForward #define MF_UnregisterSPForward g_fn_UnregisterSPForward +#define MF_GetPlayerFlags g_fn_GetPlayerFlags /*** Memory ***/ void *operator new(size_t reportedSize);