Wysłany: 2020-04-23, 20:16
Gabik
Wiek: 24 Na forum: 2234 dni Posty: 14
Nick w MP: Gabik
Piwa : 16
Witam posiadam wgran? paczk? santori 1.0 i wszystko prawie dzia?a opr?cz tego g??wnie ?e nie zapisuj? si? dane do mysql. Logowanie sie zapisuje i to tyle, pieni?dze, prawo jazdy itp,itd po wyj?ciu z serwera znikaj?. Pomo?e kto??
EDIT: Zauwa?y?em ?e po wp?acie kasy na konto zapisuj? si? dane mysql (pieni?dzy na koncie) ale ju? w got?wce nie.
Więcej szczegółów
Wystawiono 15 piw(a):Kebsyy , Dawidokrusz250 , Kubsonek_2k , DRZAKSMIF , zetrox125 , szafranek_yt , Patriczek , Michalkmita1234 , aleks123y1234 , Paweleq_1 , wodzu24 , gchftvbjy , gabrielxd2025 , damian232161 , gigajaboss
Wysłany: 2020-04-23, 23:35
RudyTMM [Usunięty ]
brak przesy?u do bazy danych
Wysłany: 2020-04-24, 08:33
Gabik
Wiek: 24 Na forum: 2234 dni Posty: 14
Nick w MP: Gabik
Piwa : 16
"RudyTMM" napisał/a :brak przesy?u do bazy danych
Czyli to wina podpi?cia czy raczej czego? innego?
Pieni?dze do banku mo?na wysy?a? i si? zapisuj? lecz inne rzeczy ju? nie, z tego co widzia?em to plik w pystories-core o nazwie s_saveplayers.lua posiada zapisywanie i ?adowanie z bazy danych ale nie wiem na pewno czy to jest to:
Kod: 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)
setElementData(plr,"sv",v.sv)
setElementData(plr,"player:bp", v.bp)
setElementData(plr,"player:opis", v.opis)
setElementData(plr,"player:exp_magazynier", v.exp_magazynier)
setElementData(plr,"player:zarobki_magazynier", v.zarobki_magazynier)
setElementData(plr,"player:exp_kurier", v.exp_kurier)
setElementData(plr,"player:zarobki_kurier", v.zarobki_kurier)
setElementData(plr,"player:exp_busy", v.exp_busy)
setElementData(plr,"player:zarobki_busy", v.zarobki_busy)
setElementData(plr,"player:glod", v.glod)
setElementData(plr,"player:exp_bagaze", v.exp_bagaze)
setElementData(plr,"player:zarobki_bagaze", v.zarobki_bagaze)
setElementData(plr,"player:exp_burgery", v.exp_burgery)
setElementData(plr,"player:zarobki_burgery", v.zarobki_burgery)
setElementData(plr,"player:ogol_zarobki", v.ogol_zarobki)
setElementData(plr,"marycha", v.marycha)
setElementData(plr,"player:marychaall", v.marychaall)
setElementData(plr,"player:zarobki_marycha", v.zarobki_marycha)
setElementData(plr,"marycha:przerobiona", v.marycha_przerobiona)
setElementData(plr, "player:pp", v.punktyp)
setElementData(plr, "phone:stan_konta", v.phone_stan_konta)
local spr = exports['pystories-db']:dbGet("SELECT * FROM pystories_users WHERE id=?", getElementData(plr,"player:sid"))
if spr[1].ostatnia_pozycja:len() > 1 then
local pozycja = split(spr[1].ostatnia_pozycja, ",")
local x2, y2, z2 = pozycja[1], pozycja[2], pozycja[3]
setElementData(plr, "ostatania:pozycja", {x2, y2, z2})
end
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)
else
setElementData(plr,"player:premium",false)
end
local mute = exports["pystories-db"]:dbGet("SELECT * FROM pystories_punish WHERE type=? AND active=1 AND serial=? AND time>NOW() LIMIT 1;", "mute", getPlayerSerial(plr))
if mute and #mute > 0 then
setElementData(plr,'mute:player',true)
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 = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
exports['pystories-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
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("USERS> Za?adowano statystyki gracza: "..getPlayerName(player))
end
end)
function savePlayerData(plr)
local sid=getElementData(plr,"player:sid")
if not sid 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 srp=getElementData(plr,"player:srp")
local worker =getElementData(plr,"player:workinjob")
local hours= tonumber(getElementData(plr,"player:hours")) or 0
local exp_magazynier = getElementData(plr,"player:exp_magazynier")
local zarobki_magazynier = getElementData(plr,"player:zarobki_magazynier")
local exp_kurier = getElementData(plr,"player:exp_kurier")
local zarobki_kurier = getElementData(plr,"player:zarobki_kurier")
local exp_busy = getElementData(plr,"player:exp_busy")
local zarobki_busy = getElementData(plr,"player:zarobki_busy")
local glod = getElementData(plr,"player:glod")
local exp_bagaze = getElementData(plr,"player:exp_bagaze")
local zarobki_bagaze = getElementData(plr,"player:zarobki_bagaze")
local exp_burgery = getElementData(plr,"player:exp_burgery")
local zarobki_burgery = getElementData(plr,"player:zarobki_burgery")
local ogol_zarobki = getElementData(plr,"player:ogol_zarobki")
local bp = getElementData(plr, "player:bp")
local opis = getElementData(plr, "player:opis")
local sv = getElementData(plr, "sv")
local marycha = getElementData(plr,"marycha")
local marychaall = getElementData(plr,"player:marychaall")
local zarobki_marycha = getElementData(plr,"player:zarobki_marycha")
local marycha_przerobiona = getElementData(plr,"marycha:przerobiona")
local punktyp = getElementData(plr, "player:pp")
local phone_stan_konta = getElementData(plr, "phone:stan_konta") or 0
x,y,z = getElementPosition(plr)
local ostatnia_pozycja = x..", "..y..", "..z
local query=exports["pystories-db"]:dbSet("UPDATE pystories_users SET money=?, srp=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=?, exp_magazynier=?, zarobki_magazynier=?, exp_kurier=?, zarobki_kurier=?, exp_busy=?, zarobki_busy=?, glod=?, exp_bagaze=?, zarobki_bagaze=?, exp_burgery=?, zarobki_burgery=?, ogol_zarobki=?, bp=?, opis=?, marycha=?, marychaall=?, zarobki_marycha=?, marycha_przerobiona=?, punktyp=?, ostatnia_pozycja=?, phone_stan_konta=? WHERE id=?",
money, srp, mandate, licensea, licenseb, licensec, licensel, worker, hours, paczki_magazynier, zarobki_magazynier, exp_kurier, zarobki_kurier, exp_busy, zarobki_busy, glod, exp_bagaze, zarobki_bagaze, exp_burgery, zarobki_burgery, ogol_zarobki, bp, opis, marycha, marychaall, zarobki_marycha, marycha_przerobiona, punktyp, ostatnia_pozycja, phone_stan_konta, sid)
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("USERS> Zapisano statystyki gracza: "..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)
Więcej szczegółów
Wystawiono 1 piw(a):DRZAKSMIF
Tagi: paczka :: santori
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: