⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.h

📁 我对他如何控制准星、显示敌友很好奇
💻 H
字号:
#ifndef CLIENT_H
#define CLIENT_H
#include <string>
#include <vector>
#include "util_vector.h"

#undef NDEBUG
#include <assert.h>

#include "wrect.h"
#include "cl_dll.h"

#include "cvar.h"

void CheckForClientHook(FARPROC* pProc,LPCTSTR lpProcName);
int WallActive(void);
bool LambertActive(void);
int GlExtraActive(void);
void StatusDump(void);
void ParseDump(void);

std::string getOgcDirFile(const char* basename);
extern char ogcdir [256];
extern char hldir  [256];

extern struct engine_studio_api_s* pIEngineStudio;

void tintArea(int x,int y,int w,int h, struct ColorEntry* clr);
void gDrawFilledBoxAtLocation( float* origin, DWORD color = 0xFFFFFFFF, int radius=1);
void gSetHudMessage2(const char* message);
void gSetHudMessage(const char* message);
void Con_Echo(const char *fmt, ... );


// from cldll_int.h 
#ifndef CDLL_INT_H
typedef unsigned char 		byte;
typedef unsigned short 		word;
typedef struct
{
	char *name;
	short ping;
	byte thisplayer;  // TRUE if this is the calling player

  // stuff that's unused at the moment,  but should be done
	byte spectator;
	byte packetloss;

	char *model;
	short topcolor;
	short bottomcolor;

} hud_player_info_t;
#endif


//================================================================
struct local_player_info
{
	local_player_info():team(0),iClip(0),iFOV(0)
		,sin_yaw(0),minus_cos_yaw(-1),inZoomMode(false)
		,alive(false),ent(0),headshots(0)
	{}

	int team;
	struct cl_entity_s *ent;
	int iClip;
	int iFOV;  // holds the current FOV in CS, not the one which OGC has set.
	bool inZoomMode;
	bool alive;
	float punchangle[3];
	int pmFlags; 
	int pmMoveType; // movetype 5 = ladder
	float pmVelocity[3];
	float pmEyePos[3];

	float viewAngles[3];
	float sin_yaw, minus_cos_yaw;

	//int kills;  // already found in playerinfo
	//int deaths; // already found in playerinfo
	int headshots;
	float hspercent;
};
extern local_player_info me;



//================================================================
enum    { MAX_TARGET_SPOTS=10 };
class PlayerInfo 
{
public:
	void init( int _entindex) 
	{ 
		team=2;
		iInfo=0;
		entinfo.name="\\missing-name\\";
		entinfo.ping=0;
		entinfo.thisplayer=0;
		entinfo.spectator=0;
		entinfo.packetloss=0;
		entinfo.model="missing-model";
		entinfo.topcolor=0;
		numTargetSpots=0;
		inpvs=0;
		alive=false;
		entindex = _entindex;
		distance = 1000.0;
		visible  = false;
		frags=0;
		deaths=0;
		ratio=0;
		bestplayer=false;
	}

	hud_player_info_t entinfo;
	int    team;
	int    iInfo;
	float  distance;
	bool   visible;

	// infos needed for points system:
	int    frags;
	int    deaths;
	float  ratio;
	bool   bestplayer; // based on ratio, not frags!
	float  fovangle;   // minimum fov a player is in

	// aimbot points
	float points;

	// model based aiming data:
	int     numTargetSpots;
	vec3_t  TargetSpots[MAX_TARGET_SPOTS];

	// in player view scope (entity data received from the server)
	bool getPVS()   { return inpvs!=0;   }
	void clearPVS() { inpvs = 0;         }
	void setPVS()   { inpvs = alive ? cvar.inpvs : 0; }
	void decrPVS()  { if(inpvs) --inpvs; }

	void setAlive( bool state=true ) { alive = state; }
	bool getAlive()                  { return  alive; }

	struct cl_entity_s * getEnt() { return gEngfuncs.GetEntityByIndex(entindex); }

private:
	int inpvs;
	bool alive;
	int entindex;

public:
	PlayerInfo() { init(0); }
};



//================================================================
enum{  MAX_VPLAYERS =36 };
class VecPlayers
	: public std::vector<PlayerInfo>
{
	typedef std::vector<PlayerInfo> STL_VecPlayers;
public:
	VecPlayers()
		: STL_VecPlayers (MAX_VPLAYERS)
	{
		for(int i=0;i<(int)size();i++) operator [] (i).init( i );
	}

	PlayerInfo& operator [] (unsigned int i)
	{
		if(i>=MAX_VPLAYERS) return std::vector<PlayerInfo>::operator[](0);
		return std::vector<PlayerInfo>::operator[](i);
	}
};
extern VecPlayers vPlayers;


struct dllfuncs_t
{
	int (* Initialize)(cl_enginefunc_t *pEnginefuncs, int iVersion);
	
	void* HUD_Init;
	void* HUD_VidInit;

	int (*HUD_Redraw)(float,int);

	void* HUD_UpdateClientData;
	void* HUD_Reset;

	void (*HUD_PlayerMove)(struct playermove_s *a, int b);

	void* HUD_PlayerMoveInit;
	void* HUD_PlayerMoveTexture;
	void* IN_ActivateMouse;
	void* IN_DeactivateMouse;
	void* IN_MouseEvent;
	void* IN_ClearStates;
	void* IN_Accumulate;

	void (*CL_CreateMove)(float,struct usercmd_s*,int);

	void* CL_IsThirdPerson;
	void* CL_CameraOffset;
	void* KB_Find;
	void* CAM_Think;

	void (*V_CalcRefdef) (struct ref_params_s*);
	int  (*HUD_AddEntity)(int type, struct cl_entity_s *ent, const char *modelname);

	void* HUD_CreateEntities;
	void* HUD_DrawNormalTriangles;
	void* HUD_DrawTransparentTriangles;
	void* HUD_StudioEvent;
	void* HUD_PostRunCmd;
	void* HUD_Shutdown;
	void* HUD_TxferLocalOverrides;
	void* HUD_ProcessPlayerState;
	void* HUD_TxferPredictionData;
	void* Demo_ReadBuffer;
	void* HUD_ConnectionlessPacket;
	void* HUD_GetHullBounds;
	void* HUD_Frame;
	void* HUD_Key_Event;
	
	void* HUD_TempEntUpdate;

	void* HUD_GetUserEntity;
	void* HUD_VoiceStatus;
	void* HUD_DirectorMessage;
	int (*HUD_GetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
};
void ClientApiHook(dllfuncs_t* df);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -