三、C++反作弊对抗实战 (实战篇 —— 3.如何获取游戏中角色人物角色的名称坐标、血量、武器信息(非CE扫描))

提示:本章节将介绍如何获取CS1.6游戏中角色人物角色的名称、坐标、血量、武器信息(非CE扫描


前言

在上一章节中《三、C++反作弊对抗实战 (实战篇 —— 2.认识CS1.6常见的数据结构与流程)》我们了解了一些常见的数据结构与一些接口函数,在这里将介绍如何获取游戏中角色人物角色的名称坐标、血量、武器信息(非CE扫描)的方法。

一、更新玩家信息

在接口体cl_enginefunc_t中有一个接口函数保留着读取玩家的重要信息,例如名称,当前人物模型名字等等,大致伪代码如下:

// 以下为官方SDK中的代码片段
typedef struct hud_player_info_s
{
	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;

struct cl_entity_s
{
	int						index;      // Index into cl_entities ( should match actu

猜你喜欢

转载自blog.csdn.net/wangningyu/article/details/126572633
今日推荐