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

Wysłany: 2018-10-06, 13:09


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Siema mam problem daje premke tylko jak kto? dostanie nie wczytuje si? od razu

addCommandHandler("vip",function(plr,cmd,cel,dni) 
    if exports['dutyadmin']:getAdmin(plr,7then
    if not cel then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not tonumber(dnithen outputChatBox("/komenda [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni!"plr25580)
        outputChatBox("Otrzymales konto premium na "..dni.." dni!"target25580)
        outputChatBox("Aby wszystko dzia?a?o wykonaj reconnect"target25580)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)


A TUTAJ CORE
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:shoe",toJSON(v.prize))
        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,"p:title",v.rp_tytul)
        setElementData(plr,"nanky:x",v.nankyx)
        setElementData(plr,"nanky:y",v.nankyy)
        setElementData(plr,"nanky:z",v.nankyz)
        --if v.prize ~= "" then setElementData(plr"player:shoe"fromJSON(v.prize)) else setElementData(plr"player:shoe", {}) 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"]: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")
    local data getElementData(plr,"_zalogowany")
    if not uid then return end
    if not data then return end
    local money=getPlayerMoney(plr)
    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 prize=getElementData(plr,"player:shoe")
    local rypy=getElementData(plr,"p:title")
    local xygetElementPosition(plr)
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, pjA=?, pjB=?, pjC=?, pjL=?, hours=?, worker=?, rp_tytul=?, nankyx=?, nankyy=?, nankyz=? WHERE id=?",money,reputationlicensealicenseblicenseclicenselminutyminutydutyrypyxyzuid)
]]--end
 
function hook_givePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] + money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_givePlayerMoney, {"givePlayerMoney"})
 
function hook_takePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] - money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_takePlayerMoney, {"takePlayerMoney"})
 
function hook_setPlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',money,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_setPlayerMoney, {"setPlayerMoney"})
 
function hook_setElementDatasourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
   local args = {...}
   if args[2] == "player:reputation" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set reputation=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:workinjob" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set worker=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:hours" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=hours+? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjA" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjB" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjC" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjL" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
end
addDebugHook"postFunction"hook_setElementData, {"setElementData"})
 
addEventHandler("onPlayerQuit",root,function(x)
    local tresc getPlayerName(source):gsub("#%x%x%x%x%x%x","").." opuscil gre. pieniadze: "..getPlayerMoney(source).." RP "..getElementData(source,"player:reputation").." przepracowane "..getElementData(source,"player:workinjob")
    exports['ogrpg-db']:dbSet("insert into ogrpg_logi (uid,tresc,serial,typ,data) values (?,?,?,?,?)",getElementData(source,"player:uid"),tresc,getPlayerSerial(source,"player:uid"),x,"NOW()")
end)


Ostatnio zmieniony przez AkossPL 2018-10-06, 17:14, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 13:28


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

opisz bardziej problem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 13:36


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Kalizman, No jak daje komu? premke komendom pisze ?e dosta? ale musi rconnect zrobi?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 16:53


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

AkossPL, nadawaj mu elementdate zwi?zan? z premium przy wpisaniu tej komendy :)

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 16:56


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

addCommandHandler("vip",function(plr,cmd,cel,dni) 
    if exports['dutyadmin']:getAdmin(plr,7then
    if not cel then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not tonumber(dnithen outputChatBox("/komenda [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni!"plr25580)
        outputChatBox("Otrzymales konto premium na "..dni.." dni!"target25580)
        setElementData(targer"player:premium"true)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:12


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Wercio., Dalej nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:14


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Ups m?j b??d zobacz teraz
addCommandHandler("vip",function(plr,cmd,cel,dni) 
    if exports['dutyadmin']:getAdmin(plr,7then
    if not cel then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not tonumber(dnithen outputChatBox("/komenda [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni!"plr25580)
        outputChatBox("Otrzymales konto premium na "..dni.." dni!"target25580)
        setElementData(target"player:premium"true)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:17


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Wercio., Dalej nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:19


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Powinno normalnie dzia?a?..
addCommandHandler("vip",function(plr,cmd,cel,dni) 
    if exports['dutyadmin']:getAdmin(plr,7then
    if not cel then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not tonumber(dnithen outputChatBox("/komenda [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni!"plr25580)
        outputChatBox("Otrzymales konto premium na "..dni.." dni!"target25580)
        setElementData(target"player:premium"true)
        setElementData(target"player:premiumdate"dni)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:28


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Wercio., Dalej nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:31


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Hmm nie wiem, powinno dzia?a? normalnie

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 17:35


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Wercio., To mo?e co? innego jest ?le zrobione

        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)


Postaw piwo autorowi tego posta
 

 
Tagi: daje :: premke :: razu :: się :: nie :: wczytuje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Daje premke i od razu się nie wczytuje 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