New features and cleanup
Added Networked Markers Added Anim module Added framework default file for things that are native to game related to player Started on a batch network event trigger to allow for single event call for multiple events Updated params notation for ids Removed prints from client_entity + actions + ext
This commit is contained in:
1 parent
91d69a6742
commit
38d0d5527a
17 files changed
+463
-130
No files matched your search
@@ -1,4 +1,9 @@
|
||||
local function RegisterNewMarker(data)
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local id = Ids or Require("lib/utility/shared/ids.lua")
|
||||
Marker = {}
|
||||
local Created = {}
|
||||
|
||||
function Marker.Create(data)
|
||||
if not data.position or not data.position.x or not data.position.y or not data.position.z then
|
||||
print("Invalid marker position. Must be a vector3 with x, y, and z coordinates.")
|
||||
return
|
||||
@@ -17,8 +22,37 @@ local function RegisterNewMarker(data)
|
||||
return
|
||||
end
|
||||
|
||||
TriggerClientEvent("community_bridge:client:marker", source, data)
|
||||
local _id = id.CreateUniqueId(Created)
|
||||
local data = {
|
||||
id = _id,
|
||||
position = data.position,
|
||||
offset = data.offset or vector3(0.0, 0.0, 0.0),
|
||||
marker = data.marker or 1,
|
||||
rotation = data.rotation or vector3(0, 0, 0),
|
||||
size = data.size or vector3(1.0, 1.0, 1.0),
|
||||
color = data.color or vector3(0, 255, 0),
|
||||
alpha = data.alpha or 255,
|
||||
bobUpAndDown = data.bobUpAndDown,
|
||||
-- interaction = data.interaction or false, -- Uncomment if you re-implement interaction logic
|
||||
rotate = data.rotate,
|
||||
textureDict = data.textureDict,
|
||||
textureName = data.textureName,
|
||||
drawOnEnts = data.drawOnEnts,
|
||||
}
|
||||
Created[_id] = data
|
||||
TriggerClientEvent("community_bridge:Client:Marker", -1, data)
|
||||
return _id
|
||||
end
|
||||
|
||||
RegisterNetEvent("community_bridge:server:createMarker", RegisterNewMarker)
|
||||
exports("RegisterNewMarker", RegisterNewMarker)
|
||||
function Marker.Remove(id)
|
||||
if not Created[id] then return end
|
||||
TriggerClientEvent("community_bridge:Client:MarkerRemove", -1, id)
|
||||
Created[id] = nil
|
||||
end
|
||||
|
||||
RegisterNetEvent("community_bridge:Server:MarkerRemove", function(id)
|
||||
Marker.Remove(id)
|
||||
end)
|
||||
|
||||
exports("Marker", Marker)
|
||||
return Marker
|
||||
Reference in new issue
Block a user