function loadPlayerData(plr)
local result=exports["gl-db"]:dbGet("SELECT * FROM gl_users WHERE id=?", getElementData(plr,"player:sid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
setElementData(plr,"player:logged",true)
setElementData(plr,"player:mandate",v.mandate)
setElementData(plr,"player:license:pjA",v.pjA)
setElementData(plr,"player:license:pjB",v.pjB)
setElementData(plr,"player:license:pjC",v.pjC)
setElementData(plr,"player:license:pjL",v.pjL)
setElementData(plr,"player:license:licS",v.licS)
setElementData(plr,"player:srp",v.srp)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
setElementData(plr,"player:skin",v.skin)
setElementData(plr,"player:bank", v.bank_money)
local queryA=string.format("SELECT * FROM gl_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:sid"))
local resultA=exports["gl-DB2"]:pobierzWyniki(queryA)
if (resultA) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#C0FF00"..getPlayerName(plr))
setElementData(plr,"premium:level",1)
else
setElementData(plr,"player:premium",false)
end
local org=exports["gl-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
local name = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
outputChatBox("* Jeste? w organizacji, kt?ra nosi nazwe: "..org[1].code.."", plr)
exports['gl-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
end
return true
end
return false
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach