From bc49154c2871cae9ee3ac2042dda19add4fc8390 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 7 Mar 2004 17:40:32 +0000 Subject: [PATCH] added pm's make fix added get_user_deaths --- amxmodx/Makefile | 6 +++--- amxmodx/amxmod.cpp | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/amxmodx/Makefile b/amxmodx/Makefile index 5ca48128..254c1fb0 100755 --- a/amxmodx/Makefile +++ b/amxmodx/Makefile @@ -15,7 +15,7 @@ EXTRA_INCLUDEDIRS = -Iextra/include EXTRA_FLAGS = -Dstrcmpi=strcasecmp SDKTOP=../hlsdk -METADIR=../metamod +METADIR=../metamodx SDKSRC=$(SDKTOP)/SourceCode @@ -29,7 +29,7 @@ else OS=LINUX endif -CC_LINUX=gcc-2.95 +CC_LINUX=gcc ifeq "$(OS)" "WIN32" CC_WIN32=gcc LD_WINDLL=dllwrap @@ -72,7 +72,7 @@ CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS) DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $< -LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ +LINK_LINUX=$(CC_LINUX) $(CFLAGS) -lstdc++ -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c diff --git a/amxmodx/amxmod.cpp b/amxmodx/amxmod.cpp index 3c0fbf38..81ecc44e 100755 --- a/amxmodx/amxmod.cpp +++ b/amxmodx/amxmod.cpp @@ -364,6 +364,16 @@ static cell AMX_NATIVE_CALL get_user_frags(AMX *amx, cell *params) /* 1 param */ return (cell)(pPlayer->ingame ? pPlayer->pEdict->v.frags : 0); } +static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params) /* 1 param */ +{ + int index = params[1]; + if (index<1||index>gpGlobals->maxClients) + return 0; + CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); + return (cell)(pPlayer->ingame ? pPlayer->deaths : 0); +} + + static cell AMX_NATIVE_CALL get_user_armor(AMX *amx, cell *params) /* 1 param */ { int index = params[1]; @@ -2336,6 +2346,7 @@ AMX_NATIVE_INFO amxmod_Natives[] = { { "get_user_authid", get_user_authid }, { "get_user_flags", get_user_flags }, { "get_user_frags", get_user_frags }, + { "get_user_deaths", get_user_deaths }, { "get_user_health", get_user_health }, { "get_user_index", get_user_index }, { "get_user_info", get_user_info }, @@ -2431,4 +2442,4 @@ AMX_NATIVE_INFO amxmod_Natives[] = { { "callfunc_push_intrf", callfunc_push_byref }, { "callfunc_push_floatrf", callfunc_push_byref }, { NULL, NULL } -}; \ No newline at end of file +};