-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnatives.h
97 lines (83 loc) · 2.01 KB
/
natives.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#pragma once
#include "vendor/scripthookv/inc/natives.h"
#include <string_view>
#define _NODISCARD [[nodiscard]]
using namespace PLAYER;
using namespace ENTITY;
using namespace PED;
using namespace VEHICLE;
using namespace OBJECT;
using namespace BRAIN;
using namespace TASK;
using namespace MISC;
using namespace AUDIO;
using namespace CUTSCENE;
using namespace INTERIOR;
using namespace CAM;
using namespace WEAPON;
using namespace ITEMSET;
using namespace STREAMING;
using namespace SCRIPT;
using namespace HUD;
using namespace GRAPHICS;
using namespace STATS;
using namespace BRAIN;
using namespace MOBILE;
using namespace APP;
using namespace CLOCK;
using namespace PATHFIND;
using namespace PAD;
using namespace DATAFILE;
using namespace FIRE;
using namespace EVENT;
using namespace ZONE;
using namespace PHYSICS;
using namespace WATER;
using namespace SHAPETEST;
using namespace NETWORK;
using namespace MONEY;
using namespace DLC;
using namespace SYSTEM;
using namespace DECORATOR;
using namespace SOCIALCLUB;
_NODISCARD constexpr inline int _strlen(const char *str)
{
return *str ? 1 + _strlen(str + 1) : 0;
}
_NODISCARD constexpr inline char __tolower(const char c)
{
return c >= 'A' && c <= 'Z' ? c + 'a' - 'A' : c;
}
// Thanks to menyoo!
_NODISCARD constexpr inline Hash GET_HASH_KEY(std::string_view str)
{
int length = _strlen(str.data());
DWORD hash, i;
for (hash = i = 0; i < length; ++i)
{
hash += __tolower(str[i]);
hash += (hash << 10);
hash ^= (hash >> 6);
}
hash += (hash << 3);
hash ^= (hash >> 11);
hash += (hash << 15);
return hash;
}
inline void SET_ENTITY_AS_NO_LONGER_NEEDED(Entity *entity)
{
SET_ENTITY_AS_MISSION_ENTITY(*entity, true, true);
invoke<Void>(0xB736A491E64A32CF, entity); // orig native
}
inline void SET_OBJECT_AS_NO_LONGER_NEEDED(Object *prop)
{
SET_ENTITY_AS_NO_LONGER_NEEDED(prop);
}
inline void SET_PED_AS_NO_LONGER_NEEDED(Ped *ped)
{
SET_ENTITY_AS_NO_LONGER_NEEDED(ped);
}
inline void SET_VEHICLE_AS_NO_LONGER_NEEDED(Vehicle *veh)
{
SET_ENTITY_AS_NO_LONGER_NEEDED(veh);
}