Massive reorganization attempt - part 1.77
This commit is contained in:
153
dlls/dod/dodfun/CMisc.cpp
Executable file
153
dlls/dod/dodfun/CMisc.cpp
Executable file
@ -0,0 +1,153 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CMisc.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
ingame = staminaSet = fuseSet = bot = false;
|
||||
}
|
||||
|
||||
void CPlayer::PutInServer(){
|
||||
ingame = true;
|
||||
}
|
||||
|
||||
void CPlayer::Connect(){
|
||||
bot = IsBot();
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::Init( int pi, edict_t* pe )
|
||||
{
|
||||
pEdict = pe;
|
||||
index = pi;
|
||||
current = 0;
|
||||
ingame = staminaSet = fuseSet = bot = false;
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::killPlayer(){
|
||||
pEdict->v.dmg_inflictor = NULL;
|
||||
pEdict->v.health = 0;
|
||||
pEdict->v.deadflag = DEAD_RESPAWNABLE;
|
||||
pEdict->v.weaponmodel = 0;
|
||||
pEdict->v.weapons = 0;
|
||||
}
|
||||
|
||||
void CPlayer::setTeamName( char *szName ){
|
||||
|
||||
for (int i=0;i<16;i++){
|
||||
*( (char*)pEdict->pvPrivateData + STEAM_PDOFFSET_TEAMNAME + i ) = szName[i];
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayer::getTeamName(char * szName ){
|
||||
for (int i=0;i<16;i++){
|
||||
szName[i] = *( (char*)pEdict->pvPrivateData + STEAM_PDOFFSET_TEAMNAME + i );
|
||||
}
|
||||
}
|
||||
|
||||
void CObjective::SetKeyValue( int index, char *keyname, char *value ){
|
||||
|
||||
KeyValueData pkvd;
|
||||
|
||||
pkvd.szClassName = (char *)STRING(obj[index].pEdict->v.classname);
|
||||
pkvd.szKeyName = keyname; // type
|
||||
pkvd.szValue = value;
|
||||
pkvd.fHandled = false;
|
||||
|
||||
MDLL_KeyValue(obj[index].pEdict, &pkvd);
|
||||
|
||||
}
|
||||
|
||||
void CObjective::InitObj(int dest , edict_t* ed ){
|
||||
MESSAGE_BEGIN( dest, gmsgInitObj,0,ed );
|
||||
WRITE_BYTE( count );
|
||||
for ( int i=0; i<count; i++ ){
|
||||
WRITE_SHORT(ENTINDEX(obj[i].pEdict));
|
||||
WRITE_BYTE( obj[i].index );
|
||||
WRITE_BYTE( obj[i].owner );
|
||||
WRITE_BYTE( obj[i].visible );
|
||||
WRITE_BYTE( obj[i].icon_neutral );
|
||||
WRITE_BYTE( obj[i].icon_allies );
|
||||
WRITE_BYTE( obj[i].icon_axis );
|
||||
WRITE_COORD( obj[i].origin_x );
|
||||
WRITE_COORD( obj[i].origin_y );
|
||||
}
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
void CObjective::SetObj(int index){
|
||||
MESSAGE_BEGIN(MSG_ALL,gmsgSetObj);
|
||||
WRITE_BYTE(obj[index].index);
|
||||
WRITE_BYTE(obj[index].owner);
|
||||
WRITE_BYTE(0);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
void CObjective::UpdateOwner(int index, int team){
|
||||
obj[index].owner = team;
|
||||
GET_CP_PD(obj[index].pEdict).owner = team;
|
||||
|
||||
switch ( team ){
|
||||
case 0:
|
||||
obj[index].pEdict->v.model = MAKE_STRING( GET_CP_PD(obj[index].pEdict).model_neutral );
|
||||
obj[index].pEdict->v.body = GET_CP_PD(obj[index].pEdict).model_body_neutral;
|
||||
break;
|
||||
case 1:
|
||||
obj[index].pEdict->v.model = MAKE_STRING( GET_CP_PD(obj[index].pEdict).model_allies );
|
||||
obj[index].pEdict->v.body = GET_CP_PD(obj[index].pEdict).model_body_allies;
|
||||
break;
|
||||
case 2:
|
||||
obj[index].pEdict->v.model = MAKE_STRING( GET_CP_PD(obj[index].pEdict).model_axis );
|
||||
obj[index].pEdict->v.body = GET_CP_PD(obj[index].pEdict).model_body_axis;
|
||||
break;
|
||||
}
|
||||
mObjects.SetObj(index);
|
||||
}
|
||||
|
||||
void CObjective::Sort(){
|
||||
objinfo_t temp;
|
||||
for (int j=0;j<count-1;j++ ){
|
||||
for (int i=0;i<count-1;i++ ){
|
||||
if ( obj[i].index > obj[i+1].index ){
|
||||
temp = obj[i+1];
|
||||
obj[i+1] = obj[i];
|
||||
obj[i] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
349
dlls/dod/dodfun/CMisc.h
Executable file
349
dlls/dod/dodfun/CMisc.h
Executable file
@ -0,0 +1,349 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CMISC_H
|
||||
#define CMISC_H
|
||||
|
||||
#ifndef __linux__
|
||||
#define LINUXOFFSET 0
|
||||
#else
|
||||
#define LINUXOFFSET 5
|
||||
#endif
|
||||
|
||||
#define DODFUN_VERSION "1.0.2"
|
||||
|
||||
// DoD Player
|
||||
#define STEAM_PDOFFSET_WDEPLOY 229 + LINUXOFFSET // weapon deploy
|
||||
|
||||
#define STEAM_PDOFFSET_TEAMNAME 1396 + (LINUXOFFSET * sizeof(char)) // team name 349 char[16]
|
||||
#define STEAM_PDOFFSET_CLASS 366 + LINUXOFFSET // player class
|
||||
#define STEAM_PDOFFSET_RCLASS 367 + LINUXOFFSET // random class
|
||||
|
||||
#define STEAM_PDOFFSET_SCORE 475 + LINUXOFFSET // score
|
||||
#define STEAM_PDOFFSET_DEATHS 476 + LINUXOFFSET // deaths
|
||||
|
||||
// DoD Control Point
|
||||
struct pd_dcp {
|
||||
int iunk_0;
|
||||
#ifndef __linux__
|
||||
int iunk_1; // windows only
|
||||
#endif
|
||||
int iunk_2; // pointer edict_t*
|
||||
int iunk_3;
|
||||
|
||||
float origin_x;
|
||||
float origin_y;
|
||||
float origin_z; // 6
|
||||
|
||||
float mins_x;
|
||||
float mins_y;
|
||||
float mins_z;
|
||||
|
||||
float maxs_x;
|
||||
float maxs_y;
|
||||
float maxs_z;
|
||||
|
||||
float angles_x;
|
||||
float angles_y;
|
||||
float angles_z; // 15
|
||||
|
||||
// 19 - spawnflags ?
|
||||
// 20-int , always 1
|
||||
int unknown_block1[19];
|
||||
int iunk_35; // pointer entvars_t*
|
||||
int iunk_36; // pointer entvars_t*
|
||||
int unknown_block2[52];
|
||||
int iunk_89; // pointer entvars_t*
|
||||
#ifdef __linux__
|
||||
int iunk_extra1;
|
||||
int iunk_extra2;
|
||||
int iunk_extra3;
|
||||
int iunk_extra4;
|
||||
#endif
|
||||
int owner; // 90
|
||||
int iunk_91;
|
||||
int iunk_92;
|
||||
int default_owner; // 93
|
||||
int flag_id;
|
||||
int pointvalue;
|
||||
int points_for_player;
|
||||
int points_for_team;
|
||||
float funk_98; // always 1.0
|
||||
float cap_time;
|
||||
char cap_message[256]; // 100 MAP_PLAYER_CAP , %p player , %n pointname , %t teamname
|
||||
int iunk_164;
|
||||
int iunk_165;
|
||||
char target_allies[256]; // 166
|
||||
char target_axis[256]; // 230
|
||||
char target_reset[256];
|
||||
char model_allies[256]; // 358
|
||||
char model_axis[256]; // 422
|
||||
char model_neutral[256]; // 486
|
||||
int model_body_allies; // 550
|
||||
int model_body_axis;
|
||||
int model_body_neutral;
|
||||
int icon_allies;
|
||||
int icon_axis;
|
||||
int icon_neutral;
|
||||
int can_touch; // flags : 1-allies can't, 256-axis can't , default 0 (all can)
|
||||
int iunk_557;
|
||||
int iunk_558; // ? -2 , 4
|
||||
char pointgroup[256];
|
||||
int iunk_623;
|
||||
int iunk_624;
|
||||
int iunk_625;
|
||||
};
|
||||
|
||||
#define GET_CP_PD( x ) (*(pd_dcp*)x->pvPrivateData)
|
||||
|
||||
// DoD Capture Area
|
||||
struct pd_dca {
|
||||
int iunk_0;
|
||||
int iunk_1;
|
||||
int iunk_2;
|
||||
#ifndef __linux__
|
||||
int iunk_3; // if def windows
|
||||
#endif
|
||||
|
||||
float origin_x;
|
||||
float origin_y;
|
||||
float origin_z; // 6
|
||||
|
||||
float mins_x;
|
||||
float mins_y;
|
||||
float mins_z;
|
||||
|
||||
float maxs_x;
|
||||
float maxs_y;
|
||||
float maxs_z;
|
||||
|
||||
float angles_x;
|
||||
float angles_y;
|
||||
float angles_z; // 15
|
||||
|
||||
// 16-135
|
||||
#ifndef __linux__
|
||||
int unknown_block_16[111];
|
||||
#else
|
||||
int unknown_block_16[116]; // linux +5 more
|
||||
#endif
|
||||
|
||||
int time_to_cap; // 127
|
||||
int iunk_128;
|
||||
int allies_numcap; // 129
|
||||
int axis_numcap; // 130
|
||||
|
||||
int iunk_131;
|
||||
int iunk_132;
|
||||
|
||||
int can_cap; // 133 flags : 1-allies can , 256-axis can, default 257 (all can)
|
||||
|
||||
int iunk_134;
|
||||
int iunk_135;
|
||||
|
||||
char allies_endcap[256]; // 136
|
||||
char axis_endcap[256]; // 200
|
||||
char allies_startcap[256]; // 264
|
||||
char axis_startcap[256]; // 328
|
||||
char allies_breakcap[256]; // 392
|
||||
char axis_breakcap[256]; // 456
|
||||
int iunk_520; // -1 allies area, blowable (charlie) ??
|
||||
char hud_sprite[256]; // 521
|
||||
|
||||
// 585 - 649
|
||||
int unknown_block_585[65];
|
||||
|
||||
char object_group[256]; // 650
|
||||
int iunk_714;
|
||||
int iunk_715;
|
||||
int iunk_716;
|
||||
// 717 size
|
||||
};
|
||||
|
||||
#define GET_CA_PD( x ) (*(pd_dca*)x->pvPrivateData)
|
||||
|
||||
/* DoD weapons */
|
||||
enum {
|
||||
DODW_AMERKNIFE = 1,
|
||||
DODW_GERKNIFE,
|
||||
DODW_COLT,
|
||||
DODW_LUGER,
|
||||
DODW_GARAND,
|
||||
DODW_SCOPED_KAR,
|
||||
DODW_THOMPSON,
|
||||
DODW_STG44,
|
||||
DODW_SPRINGFIELD,
|
||||
DODW_KAR,
|
||||
DODW_BAR,
|
||||
DODW_MP40,
|
||||
DODW_HANDGRENADE,
|
||||
DODW_STICKGRENADE,
|
||||
DODW_STICKGRENADE_EX,
|
||||
DODW_HANDGRENADE_EX,
|
||||
DODW_MG42,
|
||||
DODW_30_CAL,
|
||||
DODW_SPADE,
|
||||
DODW_M1_CARBINE,
|
||||
DODW_MG34,
|
||||
DODW_GREASEGUN,
|
||||
DODW_FG42,
|
||||
DODW_K43,
|
||||
DODW_ENFIELD,
|
||||
DODW_STEN,
|
||||
DODW_BREN,
|
||||
DODW_WEBLEY,
|
||||
DODW_BAZOOKA,
|
||||
DODW_PANZERSCHRECK,
|
||||
DODW_PIAT,
|
||||
};
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
class CPlayer {
|
||||
|
||||
public:
|
||||
edict_t* pEdict;
|
||||
int index;
|
||||
int current;
|
||||
|
||||
int staminaMin;
|
||||
int staminaMax;
|
||||
bool staminaSet;
|
||||
|
||||
bool fuseSet;
|
||||
int fuseType; // 1<<0 - for new , 1<<1 - for cought
|
||||
float nadeFuse;
|
||||
|
||||
bool ingame;
|
||||
bool bot;
|
||||
|
||||
void Init( int pi, edict_t* pe );
|
||||
void Connect();
|
||||
void PutInServer();
|
||||
void Disconnect();
|
||||
void killPlayer();
|
||||
void setTeamName( char *szName );
|
||||
void getTeamName( char *szName );
|
||||
|
||||
inline bool IsBot(){
|
||||
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||
return ( auth && !strcmp( auth , "BOT" ) );
|
||||
}
|
||||
inline bool IsAlive(){
|
||||
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
||||
}
|
||||
};
|
||||
|
||||
typedef struct objinfo_s {
|
||||
// initobj
|
||||
edict_t* pEdict;
|
||||
int index;
|
||||
int default_owner;
|
||||
int visible;
|
||||
int icon_neutral;
|
||||
int icon_allies;
|
||||
int icon_axis;
|
||||
float origin_x;
|
||||
float origin_y;
|
||||
// setobj
|
||||
int owner;
|
||||
// control area
|
||||
int areaflags; // 0-need check , 1-no area , 2-found area
|
||||
edict_t* pAreaEdict;
|
||||
} objinfo_t;
|
||||
|
||||
class CObjective {
|
||||
public:
|
||||
int count;
|
||||
objinfo_t obj[12];
|
||||
inline void Clear() { count = 0; memset(obj,0,sizeof(objinfo_s)); }
|
||||
void SetKeyValue( int index, char *keyname, char *value );
|
||||
|
||||
void InitObj(int dest = MSG_ALL , edict_t* ed = NULL);
|
||||
void SetObj(int index);
|
||||
|
||||
void UpdateOwner( int index, int team );
|
||||
void Sort();
|
||||
};
|
||||
|
||||
enum CP_VALUE {
|
||||
CP_edict = 1,
|
||||
CP_area,
|
||||
CP_index,
|
||||
CP_owner,
|
||||
CP_default_owner,
|
||||
CP_visible,
|
||||
CP_icon_neutral,
|
||||
CP_icon_allies,
|
||||
CP_icon_axis,
|
||||
CP_origin_x,
|
||||
CP_origin_y,
|
||||
|
||||
CP_can_touch,
|
||||
CP_pointvalue,
|
||||
|
||||
CP_points_for_cap,
|
||||
CP_team_points,
|
||||
|
||||
CP_model_body_neutral,
|
||||
CP_model_body_allies,
|
||||
CP_model_body_axis,
|
||||
|
||||
// strings
|
||||
CP_name,
|
||||
CP_cap_message,
|
||||
CP_reset_capsound,
|
||||
CP_allies_capsound,
|
||||
CP_axis_capsound,
|
||||
CP_targetname,
|
||||
|
||||
CP_model_neutral,
|
||||
CP_model_allies,
|
||||
CP_model_axis,
|
||||
};
|
||||
|
||||
enum CA_VALUE {
|
||||
CA_edict = 1,
|
||||
CA_allies_numcap,
|
||||
CA_axis_numcap,
|
||||
CA_timetocap,
|
||||
CA_can_cap,
|
||||
|
||||
// strings
|
||||
CA_target,
|
||||
CA_sprite,
|
||||
};
|
||||
|
||||
#endif // CMISC_H
|
||||
|
67
dlls/dod/dodfun/Makefile
Executable file
67
dlls/dod/dodfun/Makefile
Executable file
@ -0,0 +1,67 @@
|
||||
#(C)2004-2005 AMX Mod X Development Team
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
HLSDK = ../../../../hlsdk
|
||||
MM_ROOT = ../../../metamod/metamod
|
||||
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
|
||||
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc-4.1
|
||||
NAME = dodfun
|
||||
|
||||
BIN_SUFFIX = amxx_i386.so
|
||||
|
||||
OBJECTS = sdk/amxxmodule.cpp NBase.cpp CMisc.cpp NPD.cpp Utils.cpp usermsg.cpp moduleconfig.cpp
|
||||
|
||||
LINK =
|
||||
|
||||
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
||||
-I$(MM_ROOT) -I$(HLSDK)/common -Isdk
|
||||
|
||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||
|
||||
ifeq "$(GCC_VERSION)" "4"
|
||||
OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
endif
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS = $(DEBUG_FLAGS)
|
||||
else
|
||||
BIN_DIR = Release
|
||||
CFLAGS = $(OPT_FLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -DNDEBUG -fPIC -Wall -Wno-non-virtual-dtor -Werror -fno-exceptions -DHAVE_STDINT_H -static-libgcc -fno-rtti
|
||||
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX)
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
mkdir -p $(BIN_DIR)/sdk
|
||||
$(MAKE) dodfun
|
||||
|
||||
dodfun: $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) all DEBUG=true
|
||||
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/sdk/*.o
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX)
|
||||
rm -rf Debug/sdk/*.o
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX)
|
100
dlls/dod/dodfun/NBase.cpp
Executable file
100
dlls/dod/dodfun/NBase.cpp
Executable file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL set_player_stamina(AMX *amx, cell *params){ // id,(re)set,min,max
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index)
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( params[2] ){ // 0 set , 1 reset
|
||||
pPlayer->staminaMin = 0;
|
||||
pPlayer->staminaMax = 100;
|
||||
pPlayer->staminaSet = false;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int min = params[3];
|
||||
if ( min<0 || min>100 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid minimum stamina %d", min);
|
||||
return 0;
|
||||
}
|
||||
int max = params[4];
|
||||
if ( max<min || max>100 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid maximum stamina %d", max);
|
||||
return 0;
|
||||
}
|
||||
if ( pPlayer->ingame ){
|
||||
pPlayer->staminaMin = min;
|
||||
pPlayer->staminaMax = max;
|
||||
pPlayer->staminaSet = true;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set,time,type
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( params[2] ){ // 0 set , 1 reset
|
||||
pPlayer->fuseSet = false;
|
||||
pPlayer->nadeFuse = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
float fFuse = *(float *)((void *)¶ms[3]);
|
||||
if ( fFuse<0.1 || fFuse>20.0 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid fuse %f", fFuse);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iFType = params[4];
|
||||
|
||||
if ( pPlayer->ingame ){
|
||||
pPlayer->nadeFuse = fFuse;
|
||||
pPlayer->fuseSet = true;
|
||||
pPlayer->fuseType = iFType;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO base_Natives[] = {
|
||||
{ "dod_set_stamina", set_player_stamina },
|
||||
{ "dod_set_fuse", nade_set_fuse },
|
||||
|
||||
///*******************
|
||||
{ NULL, NULL }
|
||||
};
|
771
dlls/dod/dodfun/NPD.cpp
Executable file
771
dlls/dod/dodfun/NPD.cpp
Executable file
@ -0,0 +1,771 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_class(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index)
|
||||
int iClass = params[2];
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( !pPlayer->ingame )
|
||||
return 0;
|
||||
|
||||
if (iClass){
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS) = iClass;
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 0; // disable random class
|
||||
}
|
||||
else {
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_team(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
int iTeam = params[2];
|
||||
if ( iTeam<1 || iTeam>3 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid team id %d", iTeam);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( pPlayer->ingame ){
|
||||
|
||||
pPlayer->killPlayer();
|
||||
pPlayer->pEdict->v.team = iTeam;
|
||||
|
||||
switch( iTeam ){
|
||||
case 1: pPlayer->setTeamName("Allies");
|
||||
break;
|
||||
case 2: pPlayer->setTeamName("Axis");
|
||||
break;
|
||||
case 3: pPlayer->setTeamName("Spectators");
|
||||
break;
|
||||
}
|
||||
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
|
||||
|
||||
if ( params[3] ){
|
||||
MESSAGE_BEGIN(MSG_ALL,gmsgPTeam);
|
||||
WRITE_BYTE(pPlayer->index);
|
||||
WRITE_BYTE( iTeam );
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_nextclass(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->ingame ){
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_randomclass(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->ingame ){
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->ingame){
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS );
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->ingame){
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) = params[2];
|
||||
if ( params[3]){
|
||||
//ScoreShort message
|
||||
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||
WRITE_BYTE(pPlayer->index);
|
||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
|
||||
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
|
||||
WRITE_SHORT(params[2]);
|
||||
WRITE_BYTE(1);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if (pPlayer->ingame){
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) = params[2];
|
||||
|
||||
if ( params[3]){
|
||||
//ScoreShort message
|
||||
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||
WRITE_BYTE(pPlayer->index);
|
||||
WRITE_SHORT(params[2]);
|
||||
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
|
||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
||||
WRITE_BYTE(1);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_frags(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if (pPlayer->ingame){
|
||||
pPlayer->pEdict->v.frags = (float)params[2];
|
||||
|
||||
if ( params[3]){
|
||||
//ScoreShort message
|
||||
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||
WRITE_BYTE(pPlayer->index);
|
||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
|
||||
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
|
||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
||||
WRITE_BYTE(1);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_frags(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if (pPlayer->ingame)
|
||||
return (int)pPlayer->pEdict->v.frags;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_teamname(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( pPlayer->ingame ){
|
||||
|
||||
int iLen;
|
||||
char *szTeamName = MF_GetAmxString(amx, params[1], 0, &iLen);
|
||||
|
||||
pPlayer->setTeamName(szTeamName);
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_teamname(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( pPlayer->ingame ){
|
||||
|
||||
char szTeamName[16];
|
||||
pPlayer->getTeamName(szTeamName);
|
||||
|
||||
return MF_SetAmxString(amx, params[2],szTeamName,params[3]);
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_weapon_deployed(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->ingame){
|
||||
if ( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_WDEPLOY) == 1 )
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( !pPlayer->ingame )
|
||||
return 0;
|
||||
|
||||
switch(params[2]){
|
||||
|
||||
//53,284,316
|
||||
case DODW_COLT:
|
||||
case DODW_LUGER:
|
||||
case DODW_WEBLEY:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 53+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 284+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 316+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//54,283,315
|
||||
case DODW_GARAND:
|
||||
case DODW_KAR:
|
||||
case DODW_SCOPED_KAR:
|
||||
case DODW_ENFIELD:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 54+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 283+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 315+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//57,286,318
|
||||
case DODW_STG44:
|
||||
case DODW_BAR:
|
||||
case DODW_FG42:
|
||||
case DODW_BREN:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 57+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 286+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 318+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//56,281,313
|
||||
case DODW_THOMPSON:
|
||||
case DODW_GREASEGUN:
|
||||
case DODW_MP40:
|
||||
case DODW_STEN:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 56+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 281+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 313+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//58,282,314
|
||||
case DODW_K43:
|
||||
case DODW_M1_CARBINE:
|
||||
case DODW_MG34:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 58+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 282+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 314+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//55,285,317
|
||||
case DODW_SPRINGFIELD:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 55+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 285+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 317+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//59,289,321
|
||||
case DODW_HANDGRENADE:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 59+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 289+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 321+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//61,291,323
|
||||
case DODW_STICKGRENADE:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 61+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 291+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 323+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//287,319
|
||||
case DODW_MG42:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 287+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 319+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//288,320
|
||||
case DODW_30_CAL:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 288+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 320+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
|
||||
//49,293,325
|
||||
case DODW_BAZOOKA:
|
||||
case DODW_PANZERSCHRECK:
|
||||
case DODW_PIAT:
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 49+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 293+LINUXOFFSET ) = params[3];
|
||||
*( (int*)pPlayer->pEdict->pvPrivateData + 325+LINUXOFFSET ) = params[3];
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
|
||||
if ( !pPlayer->ingame )
|
||||
return 0;
|
||||
|
||||
switch(params[2]){
|
||||
|
||||
//53,284,316
|
||||
case DODW_COLT:
|
||||
case DODW_LUGER:
|
||||
case DODW_WEBLEY:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 53+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//49,293,325
|
||||
case DODW_BAZOOKA:
|
||||
case DODW_PANZERSCHRECK:
|
||||
case DODW_PIAT:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 49+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//54,283,315
|
||||
case DODW_GARAND:
|
||||
case DODW_KAR:
|
||||
case DODW_SCOPED_KAR:
|
||||
case DODW_ENFIELD:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 54+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//55,285,317
|
||||
case DODW_SPRINGFIELD:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 55+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//56,281,313
|
||||
case DODW_THOMPSON:
|
||||
case DODW_GREASEGUN:
|
||||
case DODW_MP40:
|
||||
case DODW_STEN:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 56+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//57,286,318
|
||||
case DODW_STG44:
|
||||
case DODW_BAR:
|
||||
case DODW_FG42:
|
||||
case DODW_BREN:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 57+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//58,282,314
|
||||
case DODW_K43:
|
||||
case DODW_M1_CARBINE:
|
||||
case DODW_MG34:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 58+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//59,289,321
|
||||
case DODW_HANDGRENADE:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 59+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//61,291,323
|
||||
case DODW_STICKGRENADE:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 61+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//287,319
|
||||
case DODW_MG42:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 287+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
//288,320
|
||||
case DODW_30_CAL:
|
||||
return *( (int*)pPlayer->pEdict->pvPrivateData + 288+LINUXOFFSET );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL objective_set_data(AMX *amx, cell *params){ // index, key, ivalue , szvalue
|
||||
int index = params[1];
|
||||
if ( index < 0 || index > mObjects.count ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Index out of range (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
edict_t *pent = mObjects.obj[index].pEdict;
|
||||
|
||||
int iLen;
|
||||
int ivalue = params[3];
|
||||
char *szValue = MF_GetAmxString(amx, params[4], 0, &iLen);
|
||||
|
||||
CP_VALUE key = (CP_VALUE)params[2];
|
||||
switch ( key ){
|
||||
case CP_owner :
|
||||
mObjects.UpdateOwner( index, ivalue );
|
||||
return 1;
|
||||
case CP_default_owner :
|
||||
mObjects.obj[index].default_owner = ivalue;
|
||||
GET_CP_PD(pent).default_owner = ivalue;
|
||||
return 1;
|
||||
case CP_visible :
|
||||
mObjects.obj[index].visible = ivalue;
|
||||
mObjects.obj[index].pEdict->v.spawnflags = 1 - ivalue;
|
||||
return 1;
|
||||
case CP_icon_neutral :
|
||||
mObjects.obj[index].icon_neutral = ivalue;
|
||||
GET_CP_PD(pent).icon_neutral = ivalue;
|
||||
return 1;
|
||||
case CP_icon_allies :
|
||||
mObjects.obj[index].icon_allies = ivalue;
|
||||
GET_CP_PD(pent).icon_allies = ivalue;
|
||||
return 1;
|
||||
case CP_icon_axis :
|
||||
mObjects.obj[index].icon_axis = ivalue;
|
||||
GET_CP_PD(pent).icon_axis = ivalue;
|
||||
return 1;
|
||||
case CP_origin_x :
|
||||
mObjects.obj[index].origin_x = (float)ivalue;
|
||||
// reinit
|
||||
return 1;
|
||||
case CP_origin_y :
|
||||
mObjects.obj[index].origin_y = (float)ivalue;
|
||||
// reinit
|
||||
return 1;
|
||||
case CP_can_touch :
|
||||
GET_CP_PD(pent).can_touch = ivalue;
|
||||
return 1;
|
||||
case CP_pointvalue :
|
||||
GET_CP_PD(pent).pointvalue = ivalue;
|
||||
return 1;
|
||||
|
||||
case CP_points_for_cap :
|
||||
GET_CP_PD(pent).points_for_player = ivalue;
|
||||
return 1;
|
||||
case CP_team_points :
|
||||
GET_CP_PD(pent).points_for_team = ivalue;
|
||||
return 1;
|
||||
|
||||
case CP_model_body_neutral :
|
||||
GET_CP_PD(pent).model_body_neutral = ivalue;
|
||||
return 1;
|
||||
case CP_model_body_allies :
|
||||
GET_CP_PD(pent).model_body_axis = ivalue;
|
||||
return 1;
|
||||
case CP_model_body_axis :
|
||||
GET_CP_PD(pent).model_body_axis = ivalue;
|
||||
return 1;
|
||||
|
||||
// Strings
|
||||
|
||||
case CP_name :
|
||||
mObjects.obj[index].pEdict->v.netname = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
case CP_cap_message :
|
||||
strcpy(GET_CP_PD(mObjects.obj[index].pEdict).cap_message,szValue);
|
||||
return 1;
|
||||
case CP_reset_capsound :
|
||||
mObjects.obj[index].pEdict->v.noise = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
case CP_allies_capsound :
|
||||
mObjects.obj[index].pEdict->v.noise1 = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
case CP_axis_capsound :
|
||||
mObjects.obj[index].pEdict->v.noise2 = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
case CP_targetname :
|
||||
mObjects.obj[index].pEdict->v.targetname = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
|
||||
case CP_model_neutral :
|
||||
strcpy(GET_CP_PD(pent).model_neutral,szValue);
|
||||
return 1;
|
||||
case CP_model_allies :
|
||||
strcpy(GET_CP_PD(pent).model_allies,szValue);
|
||||
return 1;
|
||||
case CP_model_axis :
|
||||
strcpy(GET_CP_PD(pent).model_axis,szValue);
|
||||
return 1;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL objective_get_data(AMX *amx, cell *params){ // flagid, key, ivalue szvalue[],len=0
|
||||
int index = params[1];
|
||||
if ( index < 0 || index > mObjects.count ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Index out of range (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
int len = params[4];
|
||||
CP_VALUE key = (CP_VALUE)params[2];
|
||||
|
||||
switch ( key ){
|
||||
case CP_edict :
|
||||
return ENTINDEX(mObjects.obj[index].pEdict);
|
||||
case CP_area :
|
||||
GET_CAPTURE_AREA(index)
|
||||
return mObjects.obj[index].areaflags == 2 ? ENTINDEX(mObjects.obj[index].pAreaEdict) : 0;
|
||||
case CP_owner :
|
||||
return mObjects.obj[index].owner;
|
||||
case CP_default_owner :
|
||||
return mObjects.obj[index].default_owner;
|
||||
case CP_visible :
|
||||
return mObjects.obj[index].visible;
|
||||
case CP_icon_neutral :
|
||||
return mObjects.obj[index].icon_neutral;
|
||||
case CP_icon_allies :
|
||||
return mObjects.obj[index].icon_allies;
|
||||
case CP_icon_axis :
|
||||
return mObjects.obj[index].icon_axis;
|
||||
case CP_origin_x :
|
||||
return (int)mObjects.obj[index].origin_x;
|
||||
case CP_origin_y :
|
||||
return (int)mObjects.obj[index].origin_y;
|
||||
case CP_can_touch :
|
||||
return GET_CP_PD( mObjects.obj[index].pEdict ).can_touch;
|
||||
case CP_pointvalue :
|
||||
return GET_CP_PD( mObjects.obj[index].pEdict ).pointvalue;
|
||||
|
||||
case CP_points_for_cap :
|
||||
return GET_CP_PD( mObjects.obj[index].pEdict ).points_for_player;
|
||||
case CP_team_points :
|
||||
return GET_CP_PD( mObjects.obj[index].pEdict ).points_for_team;
|
||||
|
||||
case CP_model_body_neutral :
|
||||
return GET_CP_PD(mObjects.obj[index].pEdict).model_body_neutral;
|
||||
case CP_model_body_allies :
|
||||
return GET_CP_PD(mObjects.obj[index].pEdict).model_body_allies;
|
||||
case CP_model_body_axis :
|
||||
return GET_CP_PD(mObjects.obj[index].pEdict).model_body_axis;
|
||||
|
||||
// strings
|
||||
|
||||
case CP_name :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pEdict->v.netname),len);
|
||||
}
|
||||
return 1;
|
||||
case CP_cap_message :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],GET_CP_PD(mObjects.obj[index].pEdict).cap_message,len);
|
||||
}
|
||||
return 1;
|
||||
case CP_reset_capsound :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pEdict->v.noise),len);
|
||||
}
|
||||
return 1;
|
||||
case CP_allies_capsound :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pEdict->v.noise1),len);
|
||||
}
|
||||
return 1;
|
||||
case CP_axis_capsound :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pEdict->v.noise2),len);
|
||||
}
|
||||
return 1;
|
||||
case CP_targetname :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pEdict->v.targetname),len);
|
||||
}
|
||||
return 1;
|
||||
case CP_model_neutral :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],GET_CP_PD(mObjects.obj[index].pEdict).model_neutral,len);
|
||||
}
|
||||
return 1;
|
||||
case CP_model_allies :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],GET_CP_PD(mObjects.obj[index].pEdict).model_allies,len);
|
||||
}
|
||||
return 1;
|
||||
case CP_model_axis :
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],GET_CP_PD(mObjects.obj[index].pEdict).model_axis,len);
|
||||
}
|
||||
return 1;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL objectives_get_num(AMX *amx, cell *params){
|
||||
return mObjects.count;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL objectives_reinit(AMX *amx, cell *params){ // index
|
||||
int player = params[1];
|
||||
if ( player < 0 || player > gpGlobals->maxClients ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Index out of range (%d)", player);
|
||||
return 0;
|
||||
}
|
||||
mObjects.InitObj( player == 0 ? MSG_ALL:MSG_ONE, player == 0 ? NULL:INDEXENT(player) );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL area_get_data(AMX *amx, cell *params){ // flagid, key, ivalue szvalue[],len=0
|
||||
int index = params[1];
|
||||
if ( index < 0 || index > mObjects.count ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Index out of range (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
int len = params[4];
|
||||
CA_VALUE key = (CA_VALUE)params[2];
|
||||
|
||||
GET_CAPTURE_AREA(index)
|
||||
|
||||
switch ( key ){
|
||||
case CA_edict :
|
||||
return ENTINDEX(mObjects.obj[index].pAreaEdict);
|
||||
case CA_allies_numcap :
|
||||
return GET_CA_PD( mObjects.obj[index].pAreaEdict ).allies_numcap;
|
||||
case CA_axis_numcap :
|
||||
return GET_CA_PD( mObjects.obj[index].pAreaEdict ).axis_numcap;
|
||||
case CA_timetocap :
|
||||
return GET_CA_PD( mObjects.obj[index].pAreaEdict ).time_to_cap;
|
||||
case CA_can_cap :
|
||||
return GET_CA_PD( mObjects.obj[index].pAreaEdict ).can_cap;
|
||||
|
||||
// strings
|
||||
case CA_target:
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],STRING(mObjects.obj[index].pAreaEdict->v.target),len);
|
||||
}
|
||||
return 1;
|
||||
case CA_sprite:
|
||||
if ( len ){
|
||||
MF_SetAmxString(amx,params[3],GET_CA_PD(mObjects.obj[index].pAreaEdict).hud_sprite,len);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL area_set_data(AMX *amx, cell *params){ // index, key, ivalue , szvalue
|
||||
int index = params[1];
|
||||
if ( index < 0 || index > mObjects.count ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Index out of range (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
int iLen;
|
||||
int ivalue = params[3];
|
||||
char *szValue = MF_GetAmxString(amx, params[4], 0, &iLen);
|
||||
|
||||
CA_VALUE key = (CA_VALUE)params[2];
|
||||
|
||||
GET_CAPTURE_AREA(index)
|
||||
|
||||
switch ( key ){
|
||||
case CA_allies_numcap :
|
||||
GET_CA_PD( mObjects.obj[index].pAreaEdict ).allies_numcap = ivalue;
|
||||
return 1;
|
||||
case CA_axis_numcap :
|
||||
GET_CA_PD( mObjects.obj[index].pAreaEdict ).axis_numcap = ivalue;
|
||||
return 1;
|
||||
case CA_timetocap :
|
||||
GET_CA_PD( mObjects.obj[index].pAreaEdict ).time_to_cap = ivalue;
|
||||
return 1;
|
||||
case CA_can_cap :
|
||||
GET_CA_PD( mObjects.obj[index].pAreaEdict ).can_cap = ivalue;
|
||||
return 1;
|
||||
// strings
|
||||
case CA_target:
|
||||
mObjects.obj[index].pAreaEdict->v.target = MAKE_STRING(szValue);
|
||||
return 1;
|
||||
case CA_sprite:
|
||||
strcpy(GET_CA_PD( mObjects.obj[index].pAreaEdict ).hud_sprite,szValue);
|
||||
return 1;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO pd_Natives[] = {
|
||||
{ "dod_set_user_class", set_user_class },
|
||||
{ "dod_set_user_team", set_user_team },
|
||||
{ "dod_get_next_class", get_user_nextclass },
|
||||
{ "dod_is_randomclass", is_randomclass },
|
||||
{ "dod_get_pl_deaths", get_user_deaths },
|
||||
{ "dod_set_pl_deaths", set_user_deaths },
|
||||
{ "dod_set_user_score", set_user_score },
|
||||
{ "dod_set_pl_teamname", set_user_teamname },
|
||||
{ "dod_get_pl_teamname", get_user_teamname },
|
||||
{ "dod_is_deployed", is_weapon_deployed },
|
||||
|
||||
{ "dod_get_user_ammo", get_user_ammo },
|
||||
{ "dod_set_user_ammo", set_user_ammo },
|
||||
|
||||
{ "dod_get_user_kills", get_user_frags },
|
||||
{ "dod_set_user_kills", set_user_frags },
|
||||
|
||||
{ "objective_set_data", objective_set_data },
|
||||
{ "objective_get_data", objective_get_data },
|
||||
{ "objectives_get_num", objectives_get_num },
|
||||
{ "objectives_reinit", objectives_reinit },
|
||||
{ "area_set_data", area_set_data },
|
||||
{ "area_get_data", area_get_data },
|
||||
///*******************
|
||||
{ NULL, NULL }
|
||||
};
|
48
dlls/dod/dodfun/Utils.cpp
Executable file
48
dlls/dod/dodfun/Utils.cpp
Executable file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
edict_t *FindEntityByString(edict_t *pentStart, const char *szKeyword, const char *szValue)
|
||||
{
|
||||
edict_t *pentEntity;
|
||||
pentEntity=FIND_ENTITY_BY_STRING(pentStart, szKeyword, szValue);
|
||||
if(!FNullEnt(pentEntity))
|
||||
return pentEntity;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName)
|
||||
{
|
||||
return FindEntityByString(pentStart, "classname", szName);
|
||||
}
|
||||
|
129
dlls/dod/dodfun/dodfun.h
Executable file
129
dlls/dod/dodfun/dodfun.h
Executable file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DODFUN_H
|
||||
#define DODFUN_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CMisc.h"
|
||||
|
||||
#define GET_PLAYER_POINTER(e) (&players[ENTINDEX(e)])
|
||||
#define GET_PLAYER_POINTER_I(i) (&players[i])
|
||||
|
||||
extern AMX_NATIVE_INFO base_Natives[];
|
||||
extern AMX_NATIVE_INFO pd_Natives[];
|
||||
|
||||
extern int mState;
|
||||
extern int mDest;
|
||||
extern int mPlayerIndex;
|
||||
|
||||
void Client_CurWeapon(void*);
|
||||
void Client_InitObj(void*);
|
||||
void Client_SetObj(void*);
|
||||
|
||||
typedef void (*funEventCall)(void*);
|
||||
|
||||
extern int gmsgScoreShort;
|
||||
extern int gmsgPTeam;
|
||||
extern int gmsgInitObj;
|
||||
extern int gmsgSetObj;
|
||||
|
||||
extern int iFGrenade;
|
||||
extern int iFRocket;
|
||||
extern int iFInitCP;
|
||||
|
||||
extern CPlayer players[33];
|
||||
extern CPlayer* mPlayer;
|
||||
|
||||
extern CObjective mObjects;
|
||||
|
||||
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
|
||||
edict_t *FindEntityByString(edict_t *pentStart, const char *szKeyword, const char *szValue);
|
||||
|
||||
#define CHECK_ENTITY(x) \
|
||||
if (x < 0 || x > gpGlobals->maxEntities) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (x <= gpGlobals->maxClients) { \
|
||||
if (!MF_IsPlayerIngame(x)) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
|
||||
return 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECK_PLAYER(x) \
|
||||
if (x < 1 || x > gpGlobals->maxClients) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (!MF_IsPlayerIngame(x) || FNullEnt(MF_GetPlayerEdict(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECK_NONPLAYER(x) \
|
||||
if (x < 1 || x <= gpGlobals->maxClients || x > gpGlobals->maxEntities) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Non-player entity %d out of range", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (FNullEnt(INDEXENT(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid non-player entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define GETEDICT(n) \
|
||||
((n >= 1 && n <= gpGlobals->maxClients) ? MF_GetPlayerEdict(n) : INDEXENT(n))
|
||||
|
||||
|
||||
#define GET_CAPTURE_AREA(x) \
|
||||
if ( mObjects.obj[x].areaflags == 0 ){\
|
||||
mObjects.obj[x].areaflags = 1;\
|
||||
while ( (mObjects.obj[x].pAreaEdict = FindEntityByString(mObjects.obj[x].pAreaEdict,"target",STRING(mObjects.obj[x].pEdict->v.targetname))) )\
|
||||
if ( strcmp( STRING(mObjects.obj[x].pAreaEdict->v.classname),"dod_capture_area" )==0){\
|
||||
mObjects.obj[x].areaflags = 2;\
|
||||
break;\
|
||||
}\
|
||||
}\
|
||||
if ( mObjects.obj[x].areaflags == 1 )\
|
||||
return 0;
|
||||
|
||||
#endif // DODFUN_H
|
||||
|
||||
|
304
dlls/dod/dodfun/moduleconfig.cpp
Executable file
304
dlls/dod/dodfun/moduleconfig.cpp
Executable file
@ -0,0 +1,304 @@
|
||||
/*
|
||||
* dodfun
|
||||
* Copyright (c) 2004 Lukasz Wlasinski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "amxxmodule.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
funEventCall modMsgs[MAX_REG_MSGS];
|
||||
void (*function)(void*);
|
||||
void (*endfunction)(void*);
|
||||
CPlayer* mPlayer;
|
||||
CPlayer* gPlayerRocket;
|
||||
CPlayer players[33];
|
||||
|
||||
CObjective mObjects;
|
||||
|
||||
int mState;
|
||||
int mDest;
|
||||
int mPlayerIndex;
|
||||
|
||||
int iFGrenade;
|
||||
int iFRocket;
|
||||
int iFInitCP;
|
||||
|
||||
int gmsgCurWeapon;
|
||||
int gmsgScoreShort;
|
||||
int gmsgPTeam;
|
||||
int gmsgInitObj;
|
||||
int gmsgSetObj;
|
||||
|
||||
struct sUserMsg {
|
||||
const char* name;
|
||||
int* id;
|
||||
funEventCall func;
|
||||
bool endmsg;
|
||||
} g_user_msg[] = {
|
||||
{ "InitObj",&gmsgInitObj,Client_InitObj,false},
|
||||
{ "CurWeapon",&gmsgCurWeapon,Client_CurWeapon,false },
|
||||
{ "ScoreShort",&gmsgScoreShort,NULL,false },
|
||||
{ "PTeam",&gmsgPTeam,NULL,false },
|
||||
{ "SetObj",&gmsgSetObj,Client_SetObj,false },
|
||||
|
||||
{ 0,0,0,false }
|
||||
};
|
||||
|
||||
int RegUserMsg_Post(const char *pszName, int iSize){
|
||||
for (int i = 0; g_user_msg[ i ].name; ++i ){
|
||||
if ( !*g_user_msg[i].id && strcmp( g_user_msg[ i ].name , pszName ) == 0 ){
|
||||
int id = META_RESULT_ORIG_RET( int );
|
||||
|
||||
*g_user_msg[ i ].id = id;
|
||||
|
||||
if ( g_user_msg[ i ].endmsg )
|
||||
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
||||
else
|
||||
modMsgs[ id ] = g_user_msg[ i ].func;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
|
||||
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||
|
||||
for( int i = 1; i <= gpGlobals->maxClients; ++i )
|
||||
GET_PLAYER_POINTER_I(i)->Init( i , pEdictList + i );
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ServerDeactivate() {
|
||||
for(int i = 1;i<=gpGlobals->maxClients; ++i){
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->ingame)
|
||||
pPlayer->Disconnect();
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){
|
||||
GET_PLAYER_POINTER(pEntity)->Connect();
|
||||
RETURN_META_VALUE(MRES_IGNORED, TRUE);
|
||||
}
|
||||
|
||||
void ClientDisconnect( edict_t *pEntity ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->ingame)
|
||||
pPlayer->Disconnect();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientPutInServer_Post( edict_t *pEntity ) {
|
||||
GET_PLAYER_POINTER(pEntity)->PutInServer();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
|
||||
if ( !pPlayer->ingame && pPlayer->IsBot() ) {
|
||||
pPlayer->PutInServer();
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
|
||||
if (ed){
|
||||
mPlayerIndex = ENTINDEX(ed);
|
||||
mPlayer = GET_PLAYER_POINTER_I(mPlayerIndex);
|
||||
} else {
|
||||
mPlayerIndex = 0;
|
||||
mPlayer = NULL;
|
||||
}
|
||||
mState = 0;
|
||||
mDest = msg_dest;
|
||||
if ( msg_type < 0 || msg_type >= MAX_REG_MSGS )
|
||||
msg_type = 0;
|
||||
function=modMsgs[msg_type];
|
||||
endfunction=modMsgsEnd[msg_type];
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageEnd_Post(void) {
|
||||
if (endfunction) (*endfunction)(NULL);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteByte_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteChar_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteShort_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteLong_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteAngle_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteCoord_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteString_Post(const char *sz) {
|
||||
if (function) (*function)((void *)sz);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteEntity_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void PlayerPreThink_Post(edict_t *pEntity)
|
||||
{
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
|
||||
// Stamina
|
||||
if(pPlayer->staminaSet)
|
||||
{
|
||||
if ( (int)pEntity->v.fuser4 > pPlayer->staminaMax)
|
||||
pEntity->v.fuser4 = (float)pPlayer->staminaMax;
|
||||
|
||||
else if ( (int)pEntity->v.fuser4 < pPlayer->staminaMin)
|
||||
pEntity->v.fuser4 = (float)pPlayer->staminaMin;
|
||||
}
|
||||
|
||||
if(pPlayer->current == 29 || pPlayer->current == 30 || pPlayer->current == 31)
|
||||
{
|
||||
if(!(pPlayer->pEdict->v.oldbuttons&IN_ATTACK) && (pPlayer->pEdict->v.button&IN_ATTACK))
|
||||
gPlayerRocket = GET_PLAYER_POINTER(pEntity);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void SetModel_Post(edict_t *e, const char *m)
|
||||
{
|
||||
int w_id = 0;
|
||||
|
||||
if(!e->v.owner || !e->v.dmgtime)
|
||||
{
|
||||
int owner = ENTINDEX(e->v.owner);
|
||||
|
||||
if(owner && owner < 33 && m[7]=='w' && m[8]=='_')
|
||||
{
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(owner);
|
||||
bool newNade = (pPlayer->current == 13 || pPlayer->current == 14) ? true : false;
|
||||
|
||||
if(m[9]=='g' && m[10]=='r' && m[11]=='e' && m[12]=='n')
|
||||
w_id = newNade ? 13 : 16; // grenade
|
||||
|
||||
else if(m[9]=='m' && m[10]=='i')
|
||||
w_id = newNade ? 36 : 16 ; // mills ; should I add mills_grenade_ex weapon ?
|
||||
|
||||
else if(m[9]=='s' && m[10]=='t' && m[11]=='i')
|
||||
w_id = newNade ? 14 : 15; // stick
|
||||
|
||||
if(!w_id)
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
if(w_id == 13 || w_id == 14 || w_id == 15 || w_id == 16 || w_id == 36)
|
||||
{
|
||||
MF_ExecuteForward(iFGrenade, pPlayer->index, ENTINDEX(e), w_id);
|
||||
|
||||
/* fuse start */
|
||||
if(pPlayer->fuseSet)
|
||||
{
|
||||
if(newNade)
|
||||
{
|
||||
if(pPlayer->fuseType & 1<<0)
|
||||
{
|
||||
e->v.dmgtime += pPlayer->nadeFuse - 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
float fExp = e->v.dmgtime - gpGlobals->time;
|
||||
e->v.dmgtime += pPlayer->nadeFuse - fExp;
|
||||
}
|
||||
}
|
||||
/* fuse end */
|
||||
}
|
||||
}
|
||||
|
||||
else if(strstr(m, "rocket") && gPlayerRocket)
|
||||
{
|
||||
if(strstr(m, "bazooka"))
|
||||
w_id = 29;
|
||||
|
||||
else if(strstr(m, "piat"))
|
||||
w_id = 30;
|
||||
|
||||
else if(strstr(m, "pschreck"))
|
||||
w_id = 31;
|
||||
|
||||
MF_ExecuteForward(iFRocket, gPlayerRocket->index, ENTINDEX(e), w_id);
|
||||
|
||||
gPlayerRocket = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
MF_AddNatives( base_Natives );
|
||||
MF_AddNatives( pd_Natives );
|
||||
}
|
||||
|
||||
void OnPluginsLoaded()
|
||||
{
|
||||
iFGrenade = MF_RegisterForward("grenade_throw",ET_IGNORE,FP_CELL/*id*/,FP_CELL/*Grenade Ent*/,FP_CELL/*Weapon ID*/,FP_DONE);
|
||||
iFRocket = MF_RegisterForward("rocket_shoot",ET_IGNORE,FP_CELL/*id*/,FP_CELL/*Rocket Ent*/,FP_CELL/*Weapon ID*/,FP_DONE);
|
||||
iFInitCP = MF_RegisterForward("controlpoints_init",ET_IGNORE,FP_DONE);
|
||||
}
|
21
dlls/dod/dodfun/msvc7/dodfun.sln
Normal file
21
dlls/dod/dodfun/msvc7/dodfun.sln
Normal file
@ -0,0 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dodfun", "dodfun.vcproj", "{2742C607-9FAB-47B3-8A13-E999BC6FDB54}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Debug.ActiveCfg = Debug|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Debug.Build.0 = Debug|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Release.ActiveCfg = Release|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
213
dlls/dod/dodfun/msvc7/dodfun.vcproj
Executable file
213
dlls/dod/dodfun/msvc7/dodfun.vcproj
Executable file
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="dodfun"
|
||||
ProjectGUID="{2742C607-9FAB-47B3-8A13-E999BC6FDB54}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="dodfun_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
StructMemberAlignment="3"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/dodfun.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/dodfun_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release/dodfun_amxx.pdb"
|
||||
ImportLibrary=".\Release/dodfun_amxx.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/dodfun.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;dodfun_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/dodfun.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/dodfun_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/dodfun_amxx.pdb"
|
||||
ImportLibrary=".\Debug/dodfun_amxx.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/dodfun.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\NBase.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\NPD.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\usermsg.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Utils.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\CMisc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\dodfun.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Module SDK"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\sdk\moduleconfig.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\svn_version.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="SDK Base"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Pawn Includes"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\..\..\plugins\include\dodconst.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\plugins\include\dodfun.inc">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
20
dlls/dod/dodfun/msvc8/dodfun.sln
Normal file
20
dlls/dod/dodfun/msvc8/dodfun.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dodfun", "dodfun.vcproj", "{2742C607-9FAB-47B3-8A13-E999BC6FDB54}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2742C607-9FAB-47B3-8A13-E999BC6FDB54}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
294
dlls/dod/dodfun/msvc8/dodfun.vcproj
Normal file
294
dlls/dod/dodfun/msvc8/dodfun.vcproj
Normal file
@ -0,0 +1,294 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="dodfun"
|
||||
ProjectGUID="{2742C607-9FAB-47B3-8A13-E999BC6FDB54}"
|
||||
RootNamespace="dodfun"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/dodfun.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="dodfun_EXPORTS"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="3"
|
||||
EnableFunctionLevelLinking="true"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Release/dodfun.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/dodfun_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/dodfun_amxx.pdb"
|
||||
ImportLibrary=".\Release/dodfun_amxx.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/dodfun.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;dodfun_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Debug/dodfun.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/dodfun_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/dodfun_amxx.pdb"
|
||||
ImportLibrary=".\Debug/dodfun_amxx.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\NBase.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\NPD.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\usermsg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Utils.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\CMisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\dodfun.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Module SDK"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\sdk\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\svn_version.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="SDK Base"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Pawn Includes"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\..\plugins\include\dodconst.inc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\plugins\include\dodfun.inc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
3119
dlls/dod/dodfun/sdk/amxxmodule.cpp
Executable file
3119
dlls/dod/dodfun/sdk/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2454
dlls/dod/dodfun/sdk/amxxmodule.h
Executable file
2454
dlls/dod/dodfun/sdk/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
494
dlls/dod/dodfun/sdk/moduleconfig.h
Executable file
494
dlls/dod/dodfun/sdk/moduleconfig.h
Executable file
@ -0,0 +1,494 @@
|
||||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
#include "svn_version.h"
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "DoD Fun"
|
||||
#define MODULE_VERSION SVN_VERSION
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org"
|
||||
#define MODULE_LOGTAG "DODFUN"
|
||||
#define MODULE_LIBRARY "dodfun"
|
||||
#define MODULE_LIBCLASS ""
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/**
|
||||
* AMXX Init functions
|
||||
* Also consider using FN_META_*
|
||||
*/
|
||||
|
||||
/** AMXX query */
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** AMXX attach
|
||||
* Do native functions init here (MF_AddNatives)
|
||||
*/
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
|
||||
/** AMXX Detach (unload) */
|
||||
//#define FN_AMXX_DETACH OnAmxxDetach
|
||||
|
||||
/** All plugins loaded
|
||||
* Do forward functions init here (MF_RegisterForward)
|
||||
*/
|
||||
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/** All plugins are about to be unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
|
||||
|
||||
/** All plugins are now unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
|
||||
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
#define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
#define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
#define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
#define FN_MessageBegin_Post MessageBegin_Post
|
||||
#define FN_MessageEnd_Post MessageEnd_Post
|
||||
#define FN_WriteByte_Post WriteByte_Post
|
||||
#define FN_WriteChar_Post WriteChar_Post
|
||||
#define FN_WriteShort_Post WriteShort_Post
|
||||
#define FN_WriteLong_Post WriteLong_Post
|
||||
#define FN_WriteAngle_Post WriteAngle_Post
|
||||
#define FN_WriteCoord_Post WriteCoord_Post
|
||||
#define FN_WriteString_Post WriteString_Post
|
||||
#define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
9
dlls/dod/dodfun/sdk/svn_version.h
Normal file
9
dlls/dod/dodfun/sdk/svn_version.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _INCLUDE_SVN_VERSION_H_
|
||||
#define _INCLUDE_SVN_VERSION_H_
|
||||
|
||||
/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */
|
||||
/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */
|
||||
|
||||
#define SVN_VERSION "1.8.0.3392"
|
||||
|
||||
#endif //_INCLUDE_SVN_VERSION_H_
|
9
dlls/dod/dodfun/sdk/svn_version.tpl
Normal file
9
dlls/dod/dodfun/sdk/svn_version.tpl
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _INCLUDE_SVN_VERSION_H_
|
||||
#define _INCLUDE_SVN_VERSION_H_
|
||||
|
||||
/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */
|
||||
/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */
|
||||
|
||||
#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||
|
||||
#endif //_INCLUDE_SVN_VERSION_H_
|
111
dlls/dod/dodfun/usermsg.cpp
Executable file
111
dlls/dod/dodfun/usermsg.cpp
Executable file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* DoDFun
|
||||
* Copyright (c) 2004 <20>ukasz W<>asi<73>ski
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "dodfun.h"
|
||||
|
||||
void Client_CurWeapon(void* mValue){
|
||||
static int iState;
|
||||
static int iId;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iState = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!iState) break;
|
||||
iId = *(int*)mValue;
|
||||
mPlayer->current = iId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_InitObj(void* mValue){
|
||||
static int num;
|
||||
|
||||
if ( mDest != MSG_ALL )
|
||||
return;
|
||||
|
||||
switch (mState++){
|
||||
case 0:
|
||||
num = 0;
|
||||
mObjects.count = *(int*)mValue;
|
||||
if ( mObjects.count == 0 )
|
||||
mObjects.Clear();
|
||||
break;
|
||||
case 1:
|
||||
mObjects.obj[num].pEdict = INDEXENT(*(int*)mValue);
|
||||
break;
|
||||
case 2:
|
||||
mObjects.obj[num].index = *(int*)mValue;
|
||||
break;
|
||||
case 3:
|
||||
mObjects.obj[num].default_owner = *(int*)mValue;
|
||||
mObjects.obj[num].owner = mObjects.obj[num].default_owner;
|
||||
break;
|
||||
case 4:
|
||||
mObjects.obj[num].visible = *(int*)mValue;
|
||||
break;
|
||||
case 5:
|
||||
mObjects.obj[num].icon_neutral = *(int*)mValue;
|
||||
break;
|
||||
case 6:
|
||||
mObjects.obj[num].icon_allies = *(int*)mValue;
|
||||
break;
|
||||
case 7:
|
||||
mObjects.obj[num].icon_axis = *(int*)mValue;
|
||||
break;
|
||||
case 8:
|
||||
mObjects.obj[num].origin_x = *(float*)mValue;
|
||||
break;
|
||||
case 9: // 8,9 coord
|
||||
mObjects.obj[num].origin_y = *(float*)mValue;
|
||||
mState = 1;
|
||||
num++;
|
||||
if ( num == mObjects.count ){
|
||||
mObjects.Sort();
|
||||
MF_ExecuteForward( iFInitCP );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_SetObj(void* mValue){
|
||||
static int id;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
id = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
mObjects.obj[id].owner = *(int*)mValue;
|
||||
break;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user