From 655c5a5db3d6e5836939a78a3061ff3d79034e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bergstr=C3=B6m?= Date: Thu, 11 Mar 2004 09:29:08 +0000 Subject: [PATCH] Updated cs_set_user_vip/cs_get_user_vip (bug in cs_get_user_vip fixed) cs_set_user_deaths now updates ingame scoreboard (sending ScoreInfo message). --- dlls/cstrike/cstrike.cpp | 15 ++++++++++++--- dlls/cstrike/cstrike.dsp | 2 +- dlls/cstrike/cstrike.h | 3 +-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/cstrike/cstrike.cpp b/dlls/cstrike/cstrike.cpp index 15107703..337cc1b6 100755 --- a/dlls/cstrike/cstrike.cpp +++ b/dlls/cstrike/cstrike.cpp @@ -175,6 +175,15 @@ static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set // Set deaths *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2]; + // Update scoreboard here..? + MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL)); + WRITE_BYTE(params[1]); + WRITE_SHORT(pPlayer->v.frags); + WRITE_SHORT(params[2]); + WRITE_SHORT(0); // dunno what this parameter is (doesn't seem to be vip) + WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); + MESSAGE_END(); + return 1; } @@ -419,7 +428,7 @@ static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_us return 0; } - if ((int)((int *)pPlayer->pvPrivateData + OFFSET_VIP) == PLAYER_IS_VIP) + if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP ) return 1; return 0; @@ -448,9 +457,9 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_us } if (params[2]) - *((int *)pPlayer->pvPrivateData + OFFSET_VIP) = PLAYER_IS_VIP; + *((int *)pPlayer->pvPrivateData + OFFSET_VIP) |= PLAYER_IS_VIP; else - *((int *)pPlayer->pvPrivateData + OFFSET_VIP) = PLAYER_IS_NOT_VIP; + *((int *)pPlayer->pvPrivateData + OFFSET_VIP) &= ~PLAYER_IS_VIP; return 1; } diff --git a/dlls/cstrike/cstrike.dsp b/dlls/cstrike/cstrike.dsp index 169296c9..885585fd 100755 --- a/dlls/cstrike/cstrike.dsp +++ b/dlls/cstrike/cstrike.dsp @@ -56,7 +56,7 @@ LINK32=link.exe # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # Begin Special Build Tool SOURCE="$(InputPath)" -PostBuild_Cmds=echo Copying dll... copy Release\cstrike.dll K:\S\cstrike\addons\amx\dlls echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amx\examples\include +PostBuild_Cmds=echo Copying dll... copy Release\cstrike.dll K:\S\cstrike\addons\amxx\modules\cstrike_amx.dll echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amxx\scripting\include\ # End Special Build Tool !ELSEIF "$(CFG)" == "cstrike - Win32 Debug" diff --git a/dlls/cstrike/cstrike.h b/dlls/cstrike/cstrike.h index af29e46b..52927593 100755 --- a/dlls/cstrike/cstrike.h +++ b/dlls/cstrike/cstrike.h @@ -209,8 +209,7 @@ pfnmodule_engine_g* g_engModuleFunc; #define FAMAS_AUTOMATIC 0 #define FAMAS_BURSTMODE 16 -#define PLAYER_IS_NOT_VIP 0 -#define PLAYER_IS_VIP 256 +#define PLAYER_IS_VIP (1<<8) #define TEAM_T 1 #define TEAM_CT 2