Skip to content

Commit

Permalink
Merge pull request #146 from manueljlz/open-map
Browse files Browse the repository at this point in the history
feat(open-map): Added ServerCallBack for MenuIsOpen, Added BigMap whe…
  • Loading branch information
DmACKGL authored Aug 8, 2020
2 parents 0d9cca5 + ede7174 commit bf853f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions resources/gcphone/client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ end --]]
AddEventHandler('esx:onPlayerDeath', function()
if menuIsOpen then
menuIsOpen = false
TriggerEvent('gcPhone:setMenuStatus', false)
SendNUIMessage({show = false})
PhonePlayOut()
SetBigmapActive(0,0)
end
end)

Expand Down Expand Up @@ -655,21 +657,28 @@ function TooglePhone()
SendNUIMessage({show = menuIsOpen})
if menuIsOpen == true then
PhonePlayIn()
TriggerEvent('gcPhone:setMenuStatus', true)
SetBigmapActive(1,0)
else
PhonePlayOut()
TriggerEvent('gcPhone:setMenuStatus', false)
SetBigmapActive(0,0)
end
end
RegisterNUICallback('faketakePhoto', function(data, cb)
menuIsOpen = false
TriggerEvent('gcPhone:setMenuStatus', false)
SendNUIMessage({show = false})
cb()
TriggerEvent('camera:open')
end)

RegisterNUICallback('closePhone', function(data, cb)
menuIsOpen = false
TriggerEvent('gcPhone:setMenuStatus', false)
SendNUIMessage({show = false})
PhonePlayOut()
SetBigmapActive(0,0)
cb()
end)

Expand Down
1 change: 0 additions & 1 deletion resources/gcphone/server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
-- #Version 2.0
--====================================================================================
ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

math.randomseed(os.time())
Expand Down

0 comments on commit bf853f2

Please sign in to comment.