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: przecinki
1. Przecinki w walucie
Hej, mam taki problem, bo ju? d?ugo szukam jak doda? przecinki do waluty na hudzie i nie mog? znale?? jakby m?g?by mi kto? doda? do hudu przecinki by?bym bardzo wdzi?czny. Stawiam Zimne Piwerko!

[code]local czcionka = dxCreateFont("a/cz.ttf", 30)
if not czcionka then czcionka = "default" end

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root, function()
local hajs = string.format("%08d", getPlayerMoney(getLocalPlayer()))
showPlayerHudComponent("money", false)
dxDrawText("PLN"..hajs, (screenW * 0.7758) - 2, (screenH * 0.22) - 2, (screenW * 0.9531) - 2, (screenH * 0.2904) - 2, tocolor(0, 0, 0, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText("PLN"..hajs, (screenW * 0.7758) + 2, (screenH * 0.22) - 2, (screenW * 0.9531) + 2, (screenH * 0.2904) - 2, tocolor(0, 0, 0, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText("PLN"..hajs, (screenW * 0.7758) - 2, (screenH * 0.22) + 2, (screenW * 0.9531) - 2, (screenH * 0.2904) + 2, tocolor(0, 0, 0, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText("PLN"..hajs, (screenW * 0.7758) + 2, (screenH * 0.22) + 2, (screenW * 0.9531) + 2, (screenH * 0.2904) + 2, tocolor(0, 0, 0, 255), 1.00, czcionk...
2. Przecinki w salonie np 1,000,000
Witam przychodz? z pro?b? ?eby mi kto? pom?gl mianowicie Chc? zrobic Przecinki w salonie patrzy?em Jak to si? robi itd Ale co? mi nie dzia?a. mam salon z ogrpg. Wczesniej pisa?em o Hud z przecinkiem ale z tamtym sobie poradzi?em Wi?c teraz z tym mam problem I nie mog? go rozwi?za? sam za pomoc Piwo


[code]
createBlip(1535.30,1761,11.29,5)
createBlip(761.53,1980.96,5.02,55)
createBlip(1167.32,2094.24,10.51,55)

function przecinkimagic(amount)
local formatted = amount
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if (k==0) then
break
end
end
return formatted
end

--local limit_aut = 5


local positionVehicles = {
-- nazwa, model, przebieg, cena, x,y,z,rx,ry,rz, sprzeda?
--------------------------------------------------------------------------------------
----// Salon Sportowy San Fierro
--------------------------------------------------------------------------------------
{'Slamvan', 535, {0,100}, {40000000,40000000}, -1661.35,1212.67,6.90,359.5,0.0,288.5},
{'Zr-350', 477, {0,100}, {50000000,50000000}, -1648.26,1207.11,13.29,359.4,0.0,39.3},
{'Sandking', 495, {0,100}, {70000000,70000000}, -1664.22,1222.61,13.30,359.5,359.9,205.4},
{'Elegy', 562, {0,100}, {60000000,60000000}, -1671.90,1205.37,13.30,359.5,360.0,272.8},
{'Uranus', 558, {0,100}, {70000000,70000000}, -1675.24,1206.53,20.81,359.5,0.0,269.6},
{'Infernus', 411, {0,0}, {99999999,99999999}, -1649....
3. Przecinki w salonie
Witam ot?? mam kod doda?by mi kto? to, by w cenie pojawia?y si? przecinki? Formule mam tylko nwm gdzie wstawi? (przecinek)
kod
[lua]createBlip(-1639.27, 1203.25, 7.23, 55,2,0,0,0,0,0,275)
createBlip(-1956.21, 303.02, 35.47, 55,2,0,0,0,0,0,275)
createBlip(-2034.21, 179.80, 28.84, 27,2,0,0,0,0,0,275)
--createBlip(-2018.74, -50.83, 35.27, 55,2,0,0,0,0,0,275)
--createBlip(-1513.71, 522.74, 0.67, 55,2,0,0,0,0,0,275)
--createBlip(152.97,-194.03,1.78, 34,2,0,0,0,0,0,275)
--createBlip(45.40, -275.68, 1.86, 27,2,0,0,0,0,0,275)
--createBlip(117.65, -166.27, 1.16, 27,2,0,0,0,0,0,275)
--createBlip(83.02, 1160.99, 18.17, 27,2,0,0,0,0,0,275)
--posX="1443.9" posY="-1578.6" posZ="13.6"
--posX="1965.3" posY="2169.7" posZ="9.5"

function przecinek(liczba)
local format = liczba
while true do
format, k = string.gsub(format, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end
return format
end


local positionVehicles = {
-- nazwa, model, przebieg, cena, x,y,z,rx,ry,rz, sprzeda?

-- CYGAN

-- {'Moonbeam', 418, math.random(51718,82719), 22250, -946.16, -531.85, 25.92, -0.05, -0.00, 334.02},
-- {'Walton', 478, math.random(51718,82719), 30830, -925.99, -500.32, 25.90, 0.70, 0.01, 229.49},
-- {'Sadler', 543, math.random(51718,82719), 54780, -918.07, -533.91, 25.72, 0.95, 0.05, 30.56},
...
4. Przecinki w hudzie #2
Witam ot?? doda?em przecinki do hudu i wyskakuje taki b??d
W DB3
[lua]hud/c_gui.lua:39: attempt to call global 'przecinek' (a nil value)[/lua]
kod
c_gui
[lua]--[[
Skrypt: HUD
Autor: Venteer
Dla GTAO.pl
]]

--Dane

local sW, sH=guiGetScreenSize() -- /1920*sW /1080*sH
local font = dxCreateFont ("files/czcionka.ttf", 30)
setElementData(localPlayer, "hud", true)

--HUD



addEventHandler("onClientRender", root, function()
setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("area_name", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("breath", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)
setPlayerHudComponentVisible("radio", false)
setPlayerHudComponentVisible("wanted", false)
if not getElementData(localPlayer, "hud") then return end
local health = getElementHealth(localPlayer)
health = math.floor(health)
local rp = getElementData(localPlayer, "player:reputation") or 0 -- Tu zmie? elementdate rp na w?asn?
local mp = getElementData(localPlayer, "player:movep") or 0 -- ...
5. Przecinki w hudzie
Witam pomocy, doda? by mi kto? przecinki co 3 cyfry do hudu? Za pomoc daj? respekt oraz zimne piwsko !
kod
[lua]-Dane

local sW, sH=guiGetScreenSize() -- /1920*sW /1080*sH
local font = dxCreateFont ("files/czcionka.ttf", 30)
setElementData(localPlayer, "hud", true)

--HUD



addEventHandler("onClientRender", root, function()
setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("area_name", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("breath", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)
setPlayerHudComponentVisible("radio", false)
setPlayerHudComponentVisible("wanted", false)
if not getElementData(localPlayer, "hud") then return end
local health = getElementHealth(localPlayer)
health = math.floor(health)
local rp = getElementData(localPlayer, "player:reputation") or 0 -- Tu zmie? elementdate rp na w?asn?
local mp = getElementData(localPlayer, "player:movep") or 0 -- Tu zmie? elementdate rp na w?asn?
local money = getPlayerMoney()
dxDrawImage(sW * 0, sH * 0, sW * 1, sH * 1, "files/hud.png", 0, 0, 0,...