Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: lecąca
1. kasa lecąca do banku
Sprawa wygl?da tak, ?e tworz? export kt?ry pobiera pieni?dze z bankomatu gracza, przy pr?bie dodawania pieni?dzy w pracy do bankomatu - po prostu tej kasy nie dodaje.
addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", root, function(value,value2)
    if 
not tonumber(value) then return end
    
if not getElementData(source,"player:logged") then return end
    local bankmoney 
= exports["pystories-db"]:dbGet("SELECT `bank_money` FROM `pystories_users` WHERE `id` = ?", sid)
    
local kasabank = 0
    
for i, v in ipairs(bankmoney) do
        
kasabank = v["bank_money"]
    
end

    exports
["pystories-db"]:dbSet("UPDATE `pystories_users` SET `bank_money` = `bank_money` + ? WHERE `pystories_users`.`id` = ?", value, sid)
    if 
not value2 then
        local rnd
={math.random(1,10),math.random(1,3)}
        
local rep=getElementData(source,"player:reputation") or 0
        local xd
=rep+rnd[2]
        
setElementData(source,"player:reputation",xd)
        if 
rnd[1] == 1 or rnd[1] == 4 or rnd[1] == 9 then
            triggerClientEvent
(source, "reputation:show", resourceRoot, rnd)
        
end
    end
end
)

Zero b??d?w, w 'zabieraniu' kasy z banku bez problemu dzia?o, po zmianie na dodawanie kasy do banku - nie dodaje.