-
Notifications
You must be signed in to change notification settings - Fork 0
/
c-main.lua
40 lines (39 loc) · 1.32 KB
/
c-main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
Citizen.CreateThread(function()
while true do
local sleep = 100
for k, v in pairs(Config.Zones.Locations) do
local me = PlayerPedId()
if GetDistanceBetweenCoords(GetEntityCoords(me), v) <= Config.DrawDistance then
DrawText3D(v-vector3(0.0, 0.0, -0.5), vector3(0.0, 0.0, 0.0), vector3(0.0, 0.0, 0.0),"~r~ARMAS~s~", 0, 0.1, 0.1,255)
DrawMarker(Config.Type,v-vector3(0.0, 0.0, 0.0), vector3(0.0, 0.0, 0.0), vector3(0.0, 0.0, 90.0), vector3(1.0, 1.0, -3.0), 255, 0, 0, 150, false, false, 2, false, false, false)
sleep = 0
if GetDistanceBetweenCoords(GetEntityCoords(me),v) <= 1.8 and not IsPedDeadOrDying(me, true) then
if not IsPedInAnyVehicle(me, false) then
HelpText(_U('shop_menu_prompt'))
if IsControlJustReleased(0, 38) then
if Config.Licenciadearmasactivada then
ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense)
if hasWeaponLicense then
OpenShopMenu()
else
OpenBuyLicenseMenu()
end
end, GetPlayerServerId(PlayerId()), 'weapon')
else
OpenShopMenu()
end
end
end
end
end
end
Wait(sleep)
end
end)