Minor fixes, fixed restarting script

This commit is contained in:
ElPumpo
2018-07-01 14:14:02 +02:00
parent 13d3bf09e8
commit 9af2bf7545
3 changed files with 99 additions and 95 deletions
+11 -19
View File
@@ -11,8 +11,6 @@ local Keys = {
}
ESX = nil
local GUI = {}
GUI.Time = 0
local OwnedProperties = {}
local Blips = {}
local CurrentProperty = nil
@@ -861,7 +859,13 @@ end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerLoaded = true
PlayerLoaded = true
ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties)
for i=1, #ownedProperties, 1 do
SetPropertyOwned(ownedProperties[i], true)
end
end)
end)
AddEventHandler('esx_property:getProperties', function(cb)
@@ -881,17 +885,6 @@ AddEventHandler('esx_property:setPropertyOwned', function(name, owned)
SetPropertyOwned(name, owned)
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties)
for i=1, #ownedProperties, 1 do
SetPropertyOwned(ownedProperties[i], true)
end
end)
end)
RegisterNetEvent('instance:onCreate')
AddEventHandler('instance:onCreate', function(instance)
@@ -987,7 +980,7 @@ end)
Citizen.CreateThread(function()
while true do
Wait(0)
Citizen.Wait(1)
local coords = GetEntityCoords(GetPlayerPed(-1))
@@ -1017,7 +1010,7 @@ end)
Citizen.CreateThread(function()
while true do
Wait(0)
Citizen.Wait(1)
local coords = GetEntityCoords(GetPlayerPed(-1))
local isInMarker = false
@@ -1083,7 +1076,7 @@ end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
Citizen.Wait(10)
if CurrentAction ~= nil then
@@ -1091,7 +1084,7 @@ Citizen.CreateThread(function()
AddTextComponentString(CurrentActionMsg)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
if IsControlPressed(0, Keys['E']) and (GetGameTimer() - GUI.Time) > 300 then
if IsControlJustReleased(0, Keys['E']) then
if CurrentAction == 'property_menu' then
OpenPropertyMenu(CurrentActionData.property)
@@ -1116,7 +1109,6 @@ Citizen.CreateThread(function()
end
CurrentAction = nil
GUI.Time = GetGameTimer()
end