Siema, bawi?em si? z tym troch? i troch? nie ogarniam jak to zrobi?.
Przy zakupie auta w salonie bierze kase z portfela a chc? zrobi? ?eby z banku bra?o.
ElementData banku to bank:hajs
getElementData(localPlayer,"bank:hajs")
Kod: addEvent("buyVehicle", true)
addEventHandler("buyVehicle", resourceRoot, function(model, mileage, cost, capacity)
cost=tonumber(cost)
if model and mileage and cost then
if cost <= client.money then
local uid = client:getData("player:uid")
if not uid then return false end
client:takeMoney(cost)
triggerClientEvent(client, "onClientAddNotification", client, "Zakupi?e?(a?) pojazd prywatny, znajdziesz go w przechowalni pojazd?w.", "success")
exports["ogrpg-db"]:dbGet("INSERT INTO ogrpg_vehicles (model, ownedPlayer, firstowner, mileage, parking, capacity) VALUES (?,?,?,?,1,?)", model, uid, client.name, mileage, capacity)
else
triggerClientEvent(client, "onClientAddNotification", client, "Nie posiadasz wystarczajacej kwoty pieni?dzy!n(Brakuje Ci: "..string.format("%.02fPLN", cost-client.money)..")", "error")
end
end
end)