forked from Tobias00723/DCS-Scripting-Library-Updated
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDCS.lua
More file actions
244 lines (197 loc) · 9.45 KB
/
DCS.lua
File metadata and controls
244 lines (197 loc) · 9.45 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
--[[
made by Tobias00723
from the TGFB server
Discord : https://discord.gg/hEHd4A3czx
any questions? ^^
find me on the my discord server ^^
feel free to use these DCS prototypes
no mentions or anything needed :)
]]
---@meta
---**No documentation** WIP
DCS = {}
---**No documentation** WIP
---*advised to simple see link below for instructions*
---https://wiki.hoggitworld.com/view/DCS_func_setUserCallbacks
hook = {}
---Pauses/resumes the simulation. Server-side only.
---https://wiki.hoggitworld.com/view/DCS_func_setPause
---@param action boolean
function DCS.setPause(action) end
---Returns the pause state of a server. True for server is paused, false if server is not paused.
---https://wiki.hoggitworld.com/view/DCS_func_getPause
---@return boolean
function DCS.getPause() end
---Command to stop the mission
---https://wiki.hoggitworld.com/view/DCS_func_stopMission
function DCS.stopMission() end
---Command to close the DCS application.
---https://wiki.hoggitworld.com/view/DCS_func_stopMission
function DCS.exitProcess() end
---Returns whether or not the game is in the multiplayer mode. True for multiplayer, false for single player.
---https://wiki.hoggitworld.com/view/DCS_func_isMultiplayer
---@return boolean
function DCS.isMultiplayer() end
---Returns whether or not the game is running as a server or is in the single player mode.
---https://wiki.hoggitworld.com/view/DCS_func_isServer
---@return boolean
function DCS.isServer() end
---Returns the DCS simulation time in seconds. Dependent on how long the game has been open.
---https://wiki.hoggitworld.com/view/DCS_func_getModelTime
---@return number
function DCS.getModelTime() end
---Returns the current time in a mission relative to the DCS start time.
---https://wiki.hoggitworld.com/view/DCS_func_getRealTime
---@return number
function DCS.getRealTime() end
---Returns the table of the options for a given mission as stored in the options.lua file embedded in a miz.
---https://wiki.hoggitworld.com/view/DCS_func_getMissionOptions
---@return table
function DCS.getMissionOptions() end
---Returns a list of coalitions which have client slots available.
---https://wiki.hoggitworld.com/view/DCS_func_getAvailableCoalitions
---@return table
function DCS.getAvailableCoalitions() end
---Returns a table of slots available to a given coalition.
---https://wiki.hoggitworld.com/view/DCS_func_getAvailableSlots
---@param coaId number number or string
---@return table
function DCS.getAvailableSlots(coaId) end
---Returns the table of the mission as stored in the mission file embedded in a miz.
---https://wiki.hoggitworld.com/view/DCS_func_getCurrentMission
---@return table
function DCS.getCurrentMission() end
---Returns the name of the mission.
---https://wiki.hoggitworld.com/view/DCS_func_getMissionName
---@return string
function DCS.getMissionName() end
---Returns the file name of the current mission file.
---https://wiki.hoggitworld.com/view/DCS_func_getMissionFilename
---@return string
function DCS.getMissionFilename() end
---Returns the current result for a given coalition as defined by the mission goals in the mission.
---https://wiki.hoggitworld.com/view/DCS_func_getMissionResult
---@return number
function DCS.getMissionResult() end
---Returns the given property for the passed unit.
---https://wiki.hoggitworld.com/view/DCS_func_getUnitProperty
---@return string
---@param unitId number
---@param propertyId string see enum.DCS
function DCS.getUnitProperty(unitId, propertyId) end
---Shortcut of DCS.getUnitProperty(missionId, DCS.UNIT_TYPE)
---https://wiki.hoggitworld.com/view/DCS_func_getUnitType
---@return string
---@param missionId number
function DCS.getUnitType(missionId) end
---Returns the attribute of the specified type for the specified unit type.
---https://wiki.hoggitworld.com/view/DCS_func_getUnitTypeAttribute
---@return string
---@return number
---@return table
---@param typeName string
---@param attribute string
function DCS.getUnitType(typeName , attribute) end
---**Undocumented** might not work
---@return unknown
---@param unknown unknown
function DCS.writeDebriefing(unknown) end
---**Undocumented** might not work
---@return unknown
---@param unknown unknown
function DCS.makeScreenShot(unknown) end
---*advised to simple see link below*
---https://wiki.hoggitworld.com/view/DCS_func_setUserCallbacks
---@param functions table
function DCS.setUserCallbacks(functions) end
---Occurs when a server begins loading a mission.
---https://wiki.hoggitworld.com/view/DCS_hook_onMissionLoadBegin
function hook.onMissionLoadBegin() end
---While a mission is loading this callback will contain information about the loading progress.
---https://wiki.hoggitworld.com/view/DCS_hook_onMissionLoadProgress
---@param progress string
---@param message string
function hook.onMissionLoadProgress(progress , message ) end
---Occurs when a server finishes loading a mission.
---https://wiki.hoggitworld.com/view/DCS_hook_onMissionLoadEnd
function hook.onMissionLoadEnd() end
---Occurs when loading is finished and the mission is fully initialized. On an install with rendering it is effectively when you enter the "3d world" of the game and the mission is ready to be unpaused.
---https://wiki.hoggitworld.com/view/DCS_hook_onSimulationStart
function hook.onSimulationStart() end
--- Occurs when exiting the simulation. Effectively is when the user goes from the 3d game world the the UI.
---https://wiki.hoggitworld.com/view/DCS_hook_onSimulationStop
function hook.onSimulationStop() end
---Occurs constantly as the simulation is running. This function runs extremely fast, **several hundred times a second**. It is highly recommended to put in checks to limit how often code can run from this function.
---https://wiki.hoggitworld.com/view/DCS_hook_onSimulationFrame
function hook.onSimulationFrame() end
---Occurs when the mission is paused.
---https://wiki.hoggitworld.com/view/DCS_hook_onSimulationPause
function hook.onSimulationPause() end
---Occurs when the mission is resumed
---https://wiki.hoggitworld.com/view/DCS_hook_onSimulationResume
function hook.onSimulationResume() end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onGameEvent(unkown) end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onNetConnect(unkown) end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onNetMissionChanged(unkown) end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onNetConnect(unkown) end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onNetDisconnect(unkown) end
---**No documentation**
---@return unknown
---@param unkown unknown
function hook.onNetDisconnect(unkown) end
---Occurs when a player connects to a server. Passed id value is a simple unique identifier that is used with network functions to get other information about that player or actions like kicking them from the server.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerConnect
---@param id number
function hook.onPlayerConnect(id) end
---Occurs when a player disconnects from a server.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerDisconnect
---@param id number
function hook.onPlayerDisconnect(id) end
---Occurs when a player has fully loaded into the simulation and can select a slot.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerStart
---@param id number
function hook.onPlayerStart(id) end
---Occurs just before onPlayerDisconnect if the user chose to leave the server..
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerStop
---@param id number
function hook.onPlayerStop(id) end
---Occurs when a player successfully moves into a new slot. This will not be called for example if they try to RIO for a player and the pilot rejects the request.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerChangeSlot
---@param playerId number
function hook.onPlayerChangeSlot(playerId) end
---*recommended to see documentation*
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerTryConnect
---@param addr string
---@param ucid string
---@param name string
---@param playerId number
function hook.onPlayerTryConnect(addr , ucid , name , playerId) end
---Occurs when a player attempts to send a chat message. This function can be used to suppress or modify the message from appearing. For example chat commands can be created for admins by checking who sent the message and doing an action based on that.
--IMPORTANT: If any value is returned with this function then any other callback that uses it will be ignored. If no choice is to be made, then do NOT return any value.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerTrySendChat
---@param playerId number
---@param message string
---@param all boolean
function hook.onPlayerTrySendChat(playerId , message , all) end
---Occurs when a player clicks on a new slot to try and enter a given aircraft. Can be used for slot blocking purposes within a mission or to force players
--IMPORTANT: If any value is returned with this function then any other callback that uses it will be ignored. If no choice is to be made, then do NOT return any value. DCS itself uses this callback as part of the multicrew slot interface. By returning true the pilot will not get the prompt or have any choice in allowing another player from entering their aircraft.
---https://wiki.hoggitworld.com/view/DCS_hook_onPlayerTryChangeSlot
---@param playerId number
---@param side number
---@param slotid string
function hook.onPlayerTryChangeSlot(playerId , side , slotid) end