-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI.h
More file actions
73 lines (62 loc) · 2.51 KB
/
API.h
File metadata and controls
73 lines (62 loc) · 2.51 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
/*
RW:MP Modification
Copyright 2018 RW:MP Team
*/
#pragma once
#ifdef _WIN32
#include <windows.h>
#endif
#include <string>
#include <stdio.h>
/* VECTOR STRUCTURE */
typedef struct _VECTOR {
float X, Y, Z;
} VECTOR;
#ifdef _WIN32
#define MP_API __declspec(dllexport)
#else
#define MP_API
#endif
class API_FUNCS
{
public:
/* Utils */
virtual void print(std::string message) = 0;
virtual bool SendClientMessage(int playerID, unsigned int color, std::string message) = 0;
virtual int GetPlayerPoolSize() = 0;
virtual int GetVehiclePoolSize() = 0;
virtual int GetActorPoolSize() = 0;
/* Game functions */
virtual void SetGamemodeText(std::string gamemode) = 0;
virtual void SetWeather(int weatherID) = 0;
virtual bool SetGravity(float gravity) = 0;
/* Player functions */
virtual std::string GetPlayerName(int playerID) = 0;
virtual void SpawnPlayer(int playerID) = 0;
virtual int AddPlayerClass(int skin, float posX, float posY, float posZ, float rotation, int weapon1, int weaponammo1, int weapon2, int weaponammo2, int weapon3, int weaponammo3) = 0;
virtual bool SetPlayerPos(int playerID, float posX, float posY, float posZ) = 0;
virtual VECTOR GetPlayerPos(int playerID) = 0;
virtual bool SetPlayerInterior(int playerID, int interior) = 0;
virtual int GetPlayerInterior(int playerID) = 0;
virtual bool SetPlayerFacingAngle(int playerID, float angle) = 0;
virtual bool SetPlayerCameraPos(int playerID, float posX, float posY, float posZ) = 0;
virtual bool SetPlayerCameraLookAt(int playerID, float posX, float posY, float posZ) = 0;
virtual bool GivePlayerMoney(int playerID, int amount) = 0;
virtual bool GivePlayerWeapon(int playerID, int weaponID, int ammo) = 0;
virtual bool ResetPlayerWeapons(int playerID) = 0;
virtual bool SetPlayerWeather(int playerID, int weatherID) = 0;
virtual bool SetPlayerTeam(int playerID, int teamID) = 0;
virtual bool ShowPlayerDialog(int playerID, int dialogid, int style, std::string caption, std::string info, std::string button1, std::string button2) = 0;
/* Vehicle functions */
virtual int CreateVehicle(int modelID, float posX, float posY, float posZ, float rotation, int color1, int color2, int delay) = 0;
virtual int AddStaticVehicle(int modelID, float posX, float posY, float posZ, float rotation, int color1, int color2) = 0;
virtual bool ChangeVehicleColor(int vehicleID, int color1, int color2) = 0;
virtual VECTOR GetVehiclePos(int vehicleID) = 0;
};
class API :
public API_FUNCS
{
public:
static API * API_INSTANCE;
static API& GetModule() { return *API_INSTANCE; }
};