Bartlomiej
Uczeń Lua / Mapper
Wiek: 23 Na forum: 3086 dni Posty: 56
Nick w MP: Bartłomiej
Piwa : 2
Witam mam k?opot z premk? posiadam wgrany modu? i DB na paczce Pys podam kod save player k?opot ze daje ale nie daje pisze ze otrzyma? ale nie otrzyma? help
kod Kod: s_saveplayers
--[[
Resource: OURGame v2
Developers: Split <split.programista@gmail.com>
You have no right to use this code without my permission.
(c) 2015 <split.programista@gmail.com>. All rights reserved.
]]
function getPremium(plr,premium)
if premium then
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=? AND premium=?",getElementData(plr,"player:sid"), premium)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=?", getElementData(plr,"player:sid"))
if result and #result > 0 then
return true
else
return false
end
end
end
function loadPlayerData(plr)
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_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: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)
local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:sid"))
local resultA=exports["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 queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
--local resultA=exports["ogrpg-db"]:dbSet(queryA)
--if (resultA) then
--[[if getPremium(plr,1) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#FFFF00"..getPlayerName(plr))
else
setElementData(plr,"player:premium",false)
end--]]
-- org
--local org=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje 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['pystories-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
--end
--local org=exports["pystories-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid"))
--local org=exports["pystories-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
--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['pystories-db']:dbSet("UPDATE ogrpg_organization_list WHERE id=? AND uid=?", id, uid)
--\\\--exports['pystories-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
--end
local org=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
local name = get
a tu c_saveplayers
local timer=getTickCount()
--[[
addEventHandler("onClientRender",root,function()
local tick=getTickCount()
if tick-timer>=1000 then
timer=getTickCount()
local h=getElementData(localPlayer,"h") or 0
local m=getElementData(localPlayer,"player:hours") or 0
local s=getElementData(localPlayer,"s") or 0
s=s+1
if s>=60 then
s=0
m=m+1
end
setElementData(localPlayer,"s",s)
setElementData(localPlayer,"player:hours",m)
if m>=60 then
m=0
h=h+1
end
setElementData(localPlayer,"m",m)
setElementData(localPlayer,"h",h)
end
end)
]]
local minuta = 60
addEventHandler("onClientRender",root,function()
local sid=getElementData(localPlayer,"player:sid")
if not sid then return end
local tick=getTickCount()
if tick-timer>=minuta*1000 then
timer=getTickCount()
local m=getElementData(localPlayer,"player:hours") or 0
setElementData(localPlayer,"player:hours",m+1)
end
end)
[ Dodano : 2018-10-03, 17:26 ]
prosze o szybk? pomoc
[ Dodano : 2018-10-03, 17:45 ]
help
[ Dodano : 2018-10-03, 17:47 ]
Pomozcie