forked from SetzCrew/setz_spawnselector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
27 lines (22 loc) · 884 Bytes
/
server.lua
File metadata and controls
27 lines (22 loc) · 884 Bytes
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
----------------[Setz Crew]----------------
------- Front end: ESCKaybeden ----------
---------- Back end: ra1der -------------
----- Discord: discord.gg/6drAg2vP55 ----
-------------------------------------------
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
Citizen.Wait(5000)
print('[^2setz_spawnselector^0] - ^1Başlatıldı!^0')
end
end)
ESX.RegisterServerCallback("setz:spawnselector:lastlocation",function(source,cb)
local sql = exports.ghmattimysql:executeSync("SELECT `position` FROM `users` WHERE `identifier` = '"..GetPlayerIdentifiers(source)[1].."'")
if sql[1] ~= nil then
position = json.decode(sql[1].position)
else
position = Config.DefaultSpawn
end
cb(position)
end)