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

Wysłany: 2017-02-15, 19:21


xluq







Wiek: 30
Na forum: 3411 dni
Posty: 64
Nick w MP: SagaPlayer8912

Piwa: 3

Respekt: 80

Witam, mam problem

Ot?? to gdy wpisze przyk?adowo /dajvipa 1 1000, to daje graczowi vipa, lecz w bazie danych nie zapisuje si? on.

Co zrobi?? posiadam paczke ogrpg
Lub co wpisa? w tym?
http://screenshot.sh/ouA8JktL9XUFq

Stawiam zimne piwko :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-15, 22:03


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Zobacz w paczce itsa czyli ogrpg-gui i tam znajd? daj vip ale zamiast tego jest daj premium nie wiem to si? nazywa chyba c_vgui lub s_vgui jako? tak.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
xluq
Wysłany: 2017-02-16, 06:30


xluq







Wiek: 30
Na forum: 3411 dni
Posty: 64
Nick w MP: SagaPlayer8912

Piwa: 3

Respekt: 80

"DylemaT929" napisał/a:

Zobacz w paczce itsa czyli ogrpg-gui i tam znajd? daj vip ale zamiast tego jest daj premium nie wiem to si? nazywa chyba c_vgui lub s_vgui jako? tak.


addCommandHandler("dajvipa",function(plr,cmd,cel,dni)
    if exports['dutyadmin']:getAdmin(plr,3) or exports['dutyadmin']:getAdmin(plr,4then
    if not cel then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
    if not tonumber(dnithen outputChatBox("/dajvipa [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 dla "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
        outputChatBox("Otrzymales konto premium na "..dni.." dni od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), target)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
        setElementData(target,"player:premium",true)
    end
end)


po daniu vipa nic w bazie, po reconnect vip si? usuwa, bo nie ma w bazie mysql.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-16, 07:07


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Hmm zapisane jest ?e zapisuje u gracza jak wychodzi z serwera lub jak nadajesz vipa zr?b jeszcze zapisz statystyki.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
xluq
Wysłany: 2017-02-16, 07:11


kaMMi







Wiek: 25
Na forum: 3642 dni
Posty: 134

Piwa: 294

Respekt: 91,5

Mo?e nie ??czy z baz? danych? Daj debugscript 3

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
xluq
Wysłany: 2017-02-16, 07:18


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

"kaMMi" napisał/a:

Mo?e nie ??czy z baz? danych? Daj debugscript 3

Jak by nie ??czy?o na duty admin by si? nie zalogowal. Jest jeszcze opcja ?e nie posiada DB2 ale warto sprawdzi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-16, 07:46


kaMMi







Wiek: 25
Na forum: 3642 dni
Posty: 134

Piwa: 294

Respekt: 91,5

DylemaT929, czasami najprostsze rozwi?zania okazuj? si? dobre. ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-16, 14:54


xluq







Wiek: 30
Na forum: 3411 dni
Posty: 64
Nick w MP: SagaPlayer8912

Piwa: 3

Respekt: 80

"kaMMi" napisał/a:

Mo?e nie ??czy z baz? danych? Daj debugscript 3


zapis z konsoli

(1146) Table 'db_22103.ogrpg_punish' doesn't exist
[2017-02-16 14] INFO: Zapisano statystyki gracza :**
[2017-02-16 14] INFO: Zapisano statystyki gracza :**
[2017-02-16 14] INFO: Zaladowano zmienionych domow: 0
[2017-02-16 14] INFO: SELECT * FROM ogrpg_users WHERE id=3 AND premiumdate>NOW() LIMIT 1
[2017-02-16 14] ERROR: [ogrpg]/ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)
[2017-02-16 14] ERROR: [ogrpg]/ogrpg-core/saveplayers.lua:26: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
[2017-02-16 14] debugscript: Incorrect client type for this command




Prawdopodobnie b??d tkwi w tym
ERROR: [ogrpg]/ogrpg-core/saveplayers.lua:26callfailed to call 'ogrpg-db:pobierzWyniki' [string "?"]


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-16, 15:05


ExtreM

Profesjonalny Mapper






Wiek: 33
Na forum: 3478 dni
Posty: 104
Nick w MP: ExtreM

Piwa: 462

Respekt: 86,8

DylemaT , DB2 jest potrzebne do dom?w tylko i wy??cznie ;3

Podpis
Discord : ExtreM#7905

Wykonuję profesjonalne mapy/interiory/exteriory na zamówienie!
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
xluq
Wysłany: 2017-02-16, 15:53


xluq







Wiek: 30
Na forum: 3411 dni
Posty: 64
Nick w MP: SagaPlayer8912

Piwa: 3

Respekt: 80

"ExtreM" napisał/a:

DylemaT , DB2 jest potrzebne do dom?w tylko i wy??cznie ;3


a pomo?esz? kod save-players (wystepuje blad)

--[[
    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:reputation",v.reputation)
        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"]:pobierzWyniki(queryA)
        if (resultAthen
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#dbb234"..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

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("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 reputation=getElementData(plr,"player:reputation")
    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=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
    moneyreputationmandatelicensealicenseblicenseclicensel,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("Zapisano statystyki gracza :"..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)


a dok?adniej to tu

local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)

[ Dodano: 2017-02-16, 17:08 ]
[2017-02-16 17:01] ERROR: [ogrpg]/ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)

[2017-02-16 17:01] ERROR: [ogrpg]/ogrpg-core/base.lua:101: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]

dodam ze mam exporta pobierzwyniki w ogrpg db, db2, ogrpg-core, wiec co jest nie tak?

[ Dodano: 2017-02-16, 17:20 ]
Dobra, wystarczylo utworzy? folder modules, wkleic mta_mysql.so.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-16, 22:15


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

We? z innej paczki ogrpg-db podmien oraz z ogrpg-cpny saveplayers.

Postaw piwo autorowi tego posta
 

 
Tagi: nadawnie :: vipa/ :: mysql
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