-
Notifications
You must be signed in to change notification settings - Fork 5
/
GameFunctions.cpp
42 lines (34 loc) · 1.04 KB
/
GameFunctions.cpp
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
#include "GameFunctions.h"
/*bool CGameFunctions::can_shoot()
{
auto m_local = m_pEntityList->GetClientEntity(m_pEngine->GetLocalPlayer());
if (!m_local) return false;
auto m_weapon = m_local->GetWeapon();
if (!m_local)
return false;
if (!m_weapon)
return false;
float flServerTime = m_local->GetTickBase() * m_pGlobals->interval_per_tick;
return (!(m_weapon->GetNextPrimaryAttack() > flServerTime));
}
void CGameFunctions::add_shot(CUserCmd* m_pcmd, int& shots, bool has_target, IClientEntity* m_target)
{
auto m_local = m_pEntityList->GetClientEntity(m_pEngine->GetLocalPlayer());
auto m_weapon = m_local->GetWeapon();
if (m_weapon)
{
if (!m_weapon->IsGrenade() && !m_weapon->IsKnife() && !m_weapon->IsC4() && m_weapon->GetAmmoInClip() > 0 && has_target)
{
if (can_shoot() && m_pcmd->buttons & IN_ATTACK)
{
shots += 1;
CPlayer* m_player = plist.get_player(m_target->GetIndex());
if (!m_player->is_empty)
{
m_player->resolver_data.missed_shots += 1;
m_player->resolver_data.shots += 1;
}
}
}
}
}*/