Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2019-02-18, 21:58


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? mam core, i po reconnecie nie zapisuje mi zdanego prawka
kod
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]
function loadPlayerData(plr)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(plr,"player:uid"))
    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:pjD",v.pjD)
        setElementData(plr,"player:reputation",v.reputation)
        setElementData(plr,"player:movep",v.movep)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        --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 (resultAthen
        local resultA=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:uid"))
        if (resultA and #resultA > 0) then
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#FFFF00"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
            setPlayerName(plr,getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
        end
        setElementData(plr,"player:skin",v.skin)
        
        local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ms_organizacje WHERE uid=? LIMIT 1"getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
        if org and #org > 0 then
            setElementData(plr,"player:organization",org[1].code)
            exports['ogrpg-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?"getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
end

addEvent("load:player",true)
addEventHandler("load:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("ogrpg_users> Zaladowano statystyki gracza: "..getPlayerName(player))
end
end)
function savePlayerData(plr)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local money=getPlayerMoney(plr)
    local mandate=getElementData(plr,"player:mandate")
    local licensea=getElementData(plr,"player:license:pjA")
    local licenseb=getElementData(plr,"player:license:pjB")
    local licensec=getElementData(plr,"player:license:pjC")
    local licensel=getElementData(plr,"player:license:pjL")
    local licensed=getElementData(plr,"player:license:pjD")
    local reputation=getElementData(plr,"player:reputation")
    local movep=getElementData(plr,"player:movep")
    local worker =getElementData(plr,"player:workinjob")
    local hourstonumber(getElementData(plr,"player:hours")) or 0
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, movep=?.mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, pjD=?,worker=?, hours=? WHERE id=?",
    moneyreputationmovep,mandatelicensealicenseblicenseclicensellicensed,worker,hoursuid)
end
addEvent("save:player",true)
addEventHandler("save:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("ogrpg_users> Zapisano statystyki gracza: "..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)


[ Dodano: 2019-02-18, 22:06 ]
db3
Kod:

ogrpg-db\s_db.lua:20 dbPoll failed; You have an erro in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax use near 'mandate=0' Pja=0, pjB=0, pjC=0 pjL=0 pjD=0, worker=0, hours=2425 WHERE id


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-18, 22:26


Mikołajj







Wiek: 22
Na forum: 2885 dni
Posty: 303
Nick w MP: Mikołaj

Piwa: 132

Respekt: 91


--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]
function loadPlayerData(plr)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(plr,"player:uid"))
    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:pjD",v.pjD)
        setElementData(plr,"player:reputation",v.reputation)
        setElementData(plr,"player:movep",v.movep)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        --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 (resultAthen
        local resultA=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:uid"))
        if (resultA and #resultA > 0) then
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#FFFF00"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
            setPlayerName(plr,getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
        end
        setElementData(plr,"player:skin",v.skin)
        
        local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ms_organizacje WHERE uid=? LIMIT 1"getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
        if org and #org > 0 then
            setElementData(plr,"player:organization",org[1].code)
            exports['ogrpg-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?"getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
end

addEvent("load:player",true)
addEventHandler("load:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("ogrpg_users> Zaladowano statystyki gracza: "..getPlayerName(player))
end
end)
function savePlayerData(plr)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local money=getPlayerMoney(plr)
    local mandate=getElementData(plr,"player:mandate")
    local licensea=getElementData(plr,"player:license:pjA")
    local licenseb=getElementData(plr,"player:license:pjB")
    local licensec=getElementData(plr,"player:license:pjC")
    local licensel=getElementData(plr,"player:license:pjL")
    local licensed=getElementData(plr,"player:license:pjD")
    local reputation=getElementData(plr,"player:reputation")
    local movep=getElementData(plr,"player:movep")
    local worker =getElementData(plr,"player:workinjob")
    local hourstonumber(getElementData(plr,"player:hours")) or 0
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, movep=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, pjD=?,worker=?, hours=? WHERE id=?",
    moneyreputationmovep,mandatelicensealicenseblicenseclicensellicensed,worker,hoursuid)
end
addEvent("save:player",true)
addEventHandler("save:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("ogrpg_users> Zapisano statystyki gracza: "..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-02-18, 22:49


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Dzi?kuje <3

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Tagi: zapisy :: prawek
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zapisy prawek Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku