Updated cs_set_user_team to include model
This commit is contained in:
@ -507,11 +507,12 @@ static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) // cs_get_u
|
||||
return (int)*((int *)pPlayer->pvPrivateData + OFFSET_TEAM);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_user_team(index, team); = 2 params
|
||||
static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_user_team(index, team, model = 0); = 3 params
|
||||
{
|
||||
// Set user team
|
||||
// params[1] = user index
|
||||
// params[2] = team
|
||||
// params[3] = model = 0
|
||||
|
||||
// Valid entity should be within range
|
||||
if (params[1] < 1 || params[1] > gpGlobals->maxClients || !g_players[params[1]].GetOnline())
|
||||
@ -529,8 +530,12 @@ static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_u
|
||||
return 0;
|
||||
}
|
||||
|
||||
int model = params[3];
|
||||
|
||||
// Just set team. Removed check of 1-2-3, because maybe scripters want to create new teams, 4, 5 etc?
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_TEAM) = params[2];
|
||||
if (model != 0)
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = model;
|
||||
|
||||
/*switch (params[2]) {
|
||||
case TEAM_T:
|
||||
|
@ -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\amxx\modules\cstrike_amx.dll echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amxx\scripting\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"
|
||||
@ -86,7 +86,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 /debug /machine:I386 /out:"Debug/cstrike_amx.dll" /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=copy Debug\cstrike_amx.dll k:\s\cstrike\addons\amxx\modules\ copy ..\plugins\include\cstrike.inc k:\s\cstrike\addons\amxx\scripting\include\
|
||||
PostBuild_Cmds=copy Debug\cstrike_amx.dll k:\s\cstrike\addons\amxx\modules\ copy ..\plugins\include\cstrike.inc k:\s\cstrike\addons\amxx\scripting\include\
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
@ -89,6 +89,7 @@ pfnmodule_engine_g* g_engModuleFunc;
|
||||
// "player" entities
|
||||
#define OFFSET_TEAM 114 + EXTRAOFFSET // same as STEAM
|
||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET // same as STEAM
|
||||
//#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET // unconfirmed with WON!
|
||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET // same as STEAM
|
||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET // same as STEAM
|
||||
#define OFFSET_VIP 215 + EXTRAOFFSET // same as STEAM
|
||||
@ -121,6 +122,7 @@ pfnmodule_engine_g* g_engModuleFunc;
|
||||
// "player" entities
|
||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||
#define OFFSET_VIP 215 + EXTRAOFFSET
|
||||
@ -209,7 +211,6 @@ pfnmodule_engine_g* g_engModuleFunc;
|
||||
#define DEFUSER_COLOUR_B 0
|
||||
|
||||
#define HAS_NVGOGGLES (1<<0)
|
||||
#define MODELRESETTIME 1.0
|
||||
// cstrike-specific defines above
|
||||
|
||||
// Globals below
|
||||
|
Reference in New Issue
Block a user