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

Wysłany: 2017-12-17, 17:47


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Witam ,Premium nie dzia?a
W bazie danych si? ?adnie zapisuje ,na czacie pisze ,?e premium zosta?o nadane jednak?e nie mamy permisji premium
Prosz? o pomoc ,za pomoc stawiam :piwo:

Ostatnio zmieniony przez kajetan254 2017-12-17, 21:57, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-17, 18:11


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Mo?e podasz kod ? Poniewa? nikt tu nie bazuje tylko na jednej pacz? skrypt?w :)

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-17, 21:57


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

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,"user:nickname",v.login1)
        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:reputation",v.reputation)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        setElementData(plr,"nanky:x",v.nankyx)
        setElementData(plr,"nanky:y",v.nankyy)
        setElementData(plr,"nanky:z",v.nankyz)
        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"]:pobierzWyniki(queryA)
        if (resultAthen
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#FFBF00"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
        end
        setElementData(plr,"player:skin",v.skin)
        local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations 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 ogrpg_organizations SET actived=curdate() WHERE uid=?"getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
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 reputation=getElementData(plr,"player:reputation")
    local minuty=getElementData(plr,"player:hours")
    local minutyduty=getElementData(plr,"player:workinjob")
    local xygetElementPosition(plr)
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, hours=?, worker=?, nankyx=?, nankyy=?, nankyz=? WHERE id=?",moneyreputationmandatelicensealicenseblicenseclicenselminutyminutydutyxyzuid)
end
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)

addEvent("antyLost"true)
addEventHandler("antyLost"root, function()
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(client"player:uid"))
if result[1].login2 == false then
setPlayerName(client,result[1].login)
else
setPlayerName(clientresult[1].login2)
end
loadPlayerData(client)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-18, 19:00


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Spraw w ten spos?b Ja tak mia?em i mi wszystko ?adnie dzia?a?o

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,"user:nickname",v.login1)
        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:reputation",v.reputation)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        setElementData(plr,"nanky:x",v.nankyx)
        setElementData(plr,"nanky:y",v.nankyy)
        setElementData(plr,"nanky:z",v.nankyz)
        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,"#dbb234"..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 ogrpg_organizations 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 ogrpg_organizations SET actived=curdate() WHERE uid=?"getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
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 reputation=getElementData(plr,"player:reputation")
    local minuty=getElementData(plr,"player:hours")
    local minutyduty=getElementData(plr,"player:workinjob")
    local xygetElementPosition(plr)
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, hours=?, worker=?, nankyx=?, nankyy=?, nankyz=? WHERE id=?",moneyreputationmandatelicensealicenseblicenseclicenselminutyminutydutyxyzuid)
end
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)

addEvent("antyLost"true)
addEventHandler("antyLost"root, function()
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(client"player:uid"))
if result[1].login2 == false then
setPlayerName(client,result[1].login)
else
setPlayerName(clientresult[1].login2)
end
loadPlayerData(client)
end)


Jak dobrze zrozumia?em to chodzi o to ze premium masz nadane, ale jak wchodzisz na serwer to nie masz uprawnie? gracza premium :)

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kajetan254
Wysłany: 2017-12-19, 17:36


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

"STOPseba" napisał/a:

Spraw w ten spos?b Ja tak mia?em i mi wszystko ?adnie dzia?a?o

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,"user:nickname",v.login1)
        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:reputation",v.reputation)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        setElementData(plr,"nanky:x",v.nankyx)
        setElementData(plr,"nanky:y",v.nankyy)
        setElementData(plr,"nanky:z",v.nankyz)
        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,"#dbb234"..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 ogrpg_organizations 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 ogrpg_organizations SET actived=curdate() WHERE uid=?"getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
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 reputation=getElementData(plr,"player:reputation")
    local minuty=getElementData(plr,"player:hours")
    local minutyduty=getElementData(plr,"player:workinjob")
    local xygetElementPosition(plr)
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, hours=?, worker=?, nankyx=?, nankyy=?, nankyz=? WHERE id=?",moneyreputationmandatelicensealicenseblicenseclicenselminutyminutydutyxyzuid)
end
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)

addEvent("antyLost"true)
addEventHandler("antyLost"root, function()
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(client"player:uid"))
if result[1].login2 == false then
setPlayerName(client,result[1].login)
else
setPlayerName(clientresult[1].login2)
end
loadPlayerData(client)
end)


Jak dobrze zrozumia?em to chodzi o to ze premium masz nadane, ale jak wchodzisz na serwer to nie masz uprawnie? gracza premium :)


Tak dobrze mnie zrozumia?e? ,teraz ?adnie dzia?a ,dzi?ki daje :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: premium
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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