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).
This commit is contained in:
Johnny Bergström 2004-03-11 09:29:08 +00:00
parent 3598791060
commit 655c5a5db3
3 changed files with 14 additions and 6 deletions

View File

@ -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;
}

View File

@ -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"

View File

@ -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