This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathLuaObject.cpp
More file actions
98 lines (84 loc) · 1.94 KB
/
Copy pathLuaObject.cpp
File metadata and controls
98 lines (84 loc) · 1.94 KB
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
98
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <sstream>
#include <limits>
#include <stdexcept>
#include <cstdint>
#include <vector>
#include <map>
#include "api.h"
// Math
#include "sdk/CVector2.h"
#include "sdk/CVector3.h"
#include "sdk/CVector4.h"
#include "sdk/Plane.h"
#include "sdk/Quaternion.h"
#include "sdk/util.h"
#include "sdk/CMaths.h"
#include "sdk/Structs.h"
// API Function Imports
#include "sdk/APICef.h"
#include "sdk/APIVisual.h"
#include "sdk/APIWorld.h"
#include "sdk/APIEntity.h"
#include "sdk/APICheckpoint.h"
#include "sdk/APINpc.h"
#include "sdk/APIObject.h"
#include "sdk/APIPlayer.h"
#include "sdk/APIServer.h"
#include "sdk/APIVehicle.h"
#include "sdk/APIBlip.h"
#include "sdk/APICamera.h"
#include "sdk/APILog.h"
extern "C" {
#include "inc_lua/lua.h"
#include "inc_lua/lualib.h"
#include "inc_lua/lauxlib.h"
}
#include "LuaBridge/LuaBridge.h"
#include "LuaBridge/RefCountedPtr.h"
#include "LuaBridge/RefCountedObject.h"
using namespace luabridge;
// API Lua Functions
#include "LuaVector3.h"
#include "LuaPlayer.h"
#include "LuaNpc.h"
#include "LuaVehicle.h"
#include "LuaObject.h"
int Object::ShowBlip(lua_State* L)
{
const int args = lua_gettop(L);
if (args == 2)
{
Object* ent = luabridge::Userdata::get<Object>(L, 1, false);
Player* player = luabridge::Userdata::get<Player>(L, 2, false);
API::Blip::Show(ent->entity, player->entity);
ent = nullptr;
player = nullptr;
}
else
{
API::Log::Warning("Object:ShowBlip requires arg (Player player).");
}
lua_pop(L, args);
return 0;
}
int Object::HideBlip(lua_State* L)
{
const int args = lua_gettop(L);
if (args == 2)
{
Object* ent = luabridge::Userdata::get<Object>(L, 1, false);
Player* player = luabridge::Userdata::get<Player>(L, 2, false);
API::Blip::Hide(ent->entity, player->entity);
ent = nullptr;
player = nullptr;
}
else
{
API::Log::Warning("Object:HideBlip requires arg (Player player).");
}
lua_pop(L, args);
return 0;
}