Witam ot?? napisa?em grosze na hudzie za pomoca string.gsub i chcialbym zeby przy przelewie,wystawianiu ceny auta. Jak wpisuje /przelej id 433.31 to przelewa sie 433 i zostaje 0.31. Jak zrobi? by grosze te? sie przelewaly?
KOD:
[lua]function zaplac(plr, cmd, target, ile)
if not getElementData(plr, "user:logged") then return end
if not target or not ile then
outputChatBox("#ffc800U?yj: #eeeeee/"..cmd.." [ID/Nazwa gracza] [Kwota]", plr, 255, 255, 255, true)
return
end
local target = findPlayer(plr, target)
if not target then return end
local ile = tonumber(ile)
string.format("%.2f",ile/100)
string.gsub(ile, "^(-?%d+)(%d%d)", '%1,%2')
if not ile then
exports.rpg_noti:createNotification(plr, "error", "Wpisana wartos? musi by? liczb?", 1)
return
end
local ile = math.floor(ile)
if ile < 0.01 then
exports.rpg_noti:createNotification(plr, "error", "Wpisana wartos? musi by? wi?ksza od 0", 1)
return
end
local money1 = getPlayerMoney(plr)
string.format("%.2f",money1/100)
string.gsub(money1, "^(-?%d+)(%d%d)", '%1,%2')
if money1 < ile then
exports.rpg_noti:createNotification(plr, "error", "Nie posiadasz przy sobie takiej sumy", 1)
return
end
takePlayerMoney(plr, ile*100)
givePlayerMoney(target ,ile*100)
string.gsub(ile, "^(-?%d+)(%d%d)", '%1,%2')
outputChatBox(&... |