-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgame.h
54 lines (47 loc) · 1.36 KB
/
game.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef GAME_H
#define GAME_H
#include "globalsettings.h"
#include "madmath.h"
#include <string>
#include <cstring>
#include <iostream>
#include <vector>
struct PlayerInfo_t;
extern PlayerInfo_t nearestEnemy;
extern std::vector<float> own_location;
// structure to manage the player information that's required for the aimbot
struct PlayerInfo_t
{
uint64_t addr;
int team;
std::vector<float> location;
int health;
// distance from own position on the map
float distance;
PlayerInfo_t(uint64_t addr, int team, std::vector<float> location, int health) : addr(addr), team(team), location(location), health(health)
{
distance = MadMath::get3DDistance(own_location[0], own_location[1], own_location[2], location[0], location[1], location[2]);
// value has been reset --> set initial value for current round
if (nearestEnemy.distance == 0)
{
nearestEnemy = *this;
}
else
{
if (distance < nearestEnemy.distance)
{
nearestEnemy = *this;
}
}
}
};
class Game
{
public:
static bool getAddrs();
static std::vector<float> getPlayerLocation();
static std::vector<float> getEntityLocation(uint64_t entity_base_addr);
static std::vector<PlayerInfo_t> getEnemies();
static bool setAngle(float x, float y);
};
#endif