Witam, tak jak w temacie. Mam pewien problem i nie umiem go rozwi?za?. Chodzi o to, ?e chcia?bym zamiast "UstawKase" by?o po prostu getPlayerMoney + nawi?zanie do Bazy danych MySQL, "DodajKase", givePlayerMoney, "ZabierzKase" takePlayerMoney, i "PobierzKase"
[lua]
function PobierzKase (player)
local player = player or source
if not player then return end
local UID = getElementData(player, "UID")
if not UID then return end
local ACC = getAccountName(getPlayerAccount(player))
if not ACC then return end
local gh = dbQuery(DB, "SELECT * FROM Ev_Konta WHERE UID=?" , tostring(UID))
local result1 = dbPoll(gh, -1)
dbFree(gh)
if #result1 ~= 0 then
local q1 = dbQuery( DB, "SELECT Kasa FROM Ev_Konta WHERE UID=?" , tostring(UID))
dbFree(q1)
return result1[1]['Kasa']
else
local q2 = dbQuery(DB, "INSERT INTO Ev_Konta SET UID=?, Login=?, Kasa=?, Bank=?", UID, ACC, 0, 0)
dbFree(q2)
return 0
end
end
-----------------------------------------------------------------------------
function DodajKase (player, Wartosc)
local player = player or source
if not player then return end
local UID = getElementData(player, "UID")
if not UID then return end
local ACC = getAccountName(getPlayerAccount(player))
if not ACC then return end
local Bank = 0
if not Wartosc then return end
local Wartosc = tonumber(Wartosc)
if not Wartosc then return end...