3. C++ anti-cheating against actual combat (actual combat - 3. How to obtain the name coordinates, blood volume, and weapon information of characters in the game (non-CE scanning))

Tips: This chapter will introduce how to obtain the name, coordinates, HP, and weapon information of characters in CS1.6 games (non-CE scanning


foreword

In the previous chapter "3. C++ Anti-cheating Combat (Practical Chapter - 2. Understanding CS1.6 Common Data Structures and Processes)", we learned about some common data structures and some interface functions, which will be introduced here How to obtain the name coordinates, blood volume, and weapon information (non-CE scanning) of characters in the game.

1. Update player information

In the interface body cl_enginefunc_t, there is an interface function that retains the important information of reading the player, such as the name, the name of the current character model, etc. The approximate pseudocode is as follows:

// 以下为官方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

Guess you like

Origin blog.csdn.net/wangningyu/article/details/126572633
Recommended