mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
Consistent indentation and remove some files
Mixing tabs and spaces when embedding Lua can easily break MDX syntax.
This commit is contained in:
1 parent
b87ef48d2e
commit
6bead3ca32
21 files changed
+146
-240
No files matched your search
@@ -7,19 +7,19 @@ https://github.com/overextended/ox_lib/blob/master/resource/cache/client.lua
|
||||
|
||||
## States
|
||||
```lua
|
||||
cache.ped -- player entity id
|
||||
cache.vehicle -- vehicle entity id
|
||||
cache.seat -- vehicle seat index
|
||||
cache.ped -- player entity id
|
||||
cache.vehicle -- vehicle entity id
|
||||
cache.seat -- vehicle seat index
|
||||
```
|
||||
|
||||
## lib.onCache
|
||||
Register a callback function when the value is changed.
|
||||
```lua
|
||||
lib.onCache('vehicle', function(value)
|
||||
print('vehicle', value)
|
||||
print('vehicle', value)
|
||||
end)
|
||||
|
||||
lib.onCache('seat', function(value)
|
||||
print('seat', value)
|
||||
print('seat', value)
|
||||
end)
|
||||
```
|
||||
@@ -11,7 +11,7 @@ The response is handled in a separate coroutine.
|
||||
lib.callback(name, delay, cb, ...)
|
||||
|
||||
lib.callback('ox_inventory:getItemCount', false, function(count)
|
||||
print(count)
|
||||
print(count)
|
||||
end, 'water', {type = 'fresh'})
|
||||
```
|
||||
|
||||
|
||||
@@ -9,23 +9,23 @@ Simple and centralised distance checking, supporting callbacks when entering, le
|
||||
lib.points.new(coords, distance, data)
|
||||
|
||||
local point = lib.points.new(playerCoords, 5, {
|
||||
dunak = 'nerd',
|
||||
dunak = 'nerd',
|
||||
})
|
||||
|
||||
function point:onEnter()
|
||||
print('entered range of point', self.id)
|
||||
print('entered range of point', self.id)
|
||||
end
|
||||
|
||||
function point:onExit()
|
||||
print('left range of point', self.id)
|
||||
print('left range of point', self.id)
|
||||
end
|
||||
|
||||
function point:nearby()
|
||||
DrawMarker(2, self.coords.x, self.coords.y, self.coords.z, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 200, 20, 20, 50, false, true, 2, nil, nil, false)
|
||||
DrawMarker(2, self.coords.x, self.coords.y, self.coords.z, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 200, 20, 20, 50, false, true, 2, nil, nil, false)
|
||||
|
||||
if self.currentDistance < 1 and IsControlJustReleased(0, 38) then
|
||||
print('inside marker', self.id)
|
||||
print(self.dunak)
|
||||
end
|
||||
if self.currentDistance < 1 and IsControlJustReleased(0, 38) then
|
||||
print('inside marker', self.id)
|
||||
print(self.dunak)
|
||||
end
|
||||
end
|
||||
```
|
||||
@@ -18,7 +18,7 @@ Requires the vehicle to belong to the client. _Do not use NetworkRequestControlO
|
||||
lib.setVehicleProperties(vehicle, props)
|
||||
|
||||
RegisterNetEvent('lualib:setVehicleProperties', function(netid, data)
|
||||
lib.setVehicleProperties(NetToVeh(netid), data)
|
||||
lib.setVehicleProperties(NetToVeh(netid), data)
|
||||
end)
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user