- big update to labs
This commit is contained in:
1 parent
eaec5fc40f
commit
0956b1d49c
9 files changed
+547
-33
No files matched your search
+2
-26
@@ -1,36 +1,12 @@
|
||||
|
||||
local Bags = {}
|
||||
local function setBucket(src, bucket)
|
||||
if src and bucket then
|
||||
Player(src).state:set('instance', bucket, true)
|
||||
SetPlayerRoutingBucket(src, bucket)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
local function saveBags(src)
|
||||
ps.debug('Current', GetEntityRoutingBucket(GetPlayerPed(src)))
|
||||
Bags[ps.getIdentifier(src)] = {original = GetEntityRoutingBucket(GetPlayerPed(src)), new = GetEntityRoutingBucket(GetPlayerPed(src)) + 1}
|
||||
setBucket(src, Bags[ps.getIdentifier(src)].new)
|
||||
ps.debug('New', Bags[ps.getIdentifier(src)].new)
|
||||
end
|
||||
|
||||
local function restoreBags(src)
|
||||
local id = ps.getIdentifier(src)
|
||||
if Bags[id] then
|
||||
setBucket(src, Bags[id].original)
|
||||
Bags[id] = nil
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('TestMethLab', function()
|
||||
local src = source
|
||||
saveBags(src)
|
||||
saveBucket(src, 2)
|
||||
TriggerClientEvent('md-methlab:client:EnterMethLab', src)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('RestoreMethLab', function()
|
||||
local src = source
|
||||
restoreBags(src)
|
||||
restoreBucket(src)
|
||||
end)
|
||||
Reference in new issue
Block a user