Mam taki problem. Zrobi?em skrypt na temperatur? cia?a, wszystko git, ale gdy zrobi?em zapis tej temperatury to wog?le si? nie pokazuje dxDrawText.
P.S. Gdy robi?em to na setElementDatach itp. to si? pojawia? text lecz nie zapisywa? si?.
[lua]local x, y = guiGetScreenSize()
local nar = getTickCount()
function narastanie()
if getTickCount()-nar > 6000 then
nar = getTickCount()
local konto = getPlayerAccount(localPlayer)
local temp = getAccountData(konto, "temperatura") or 0
temp1 = temp + 0.1
setAccountData(konto, "temperatura", temp1)
end
end
addEventHandler("onClientRender", root, narastanie)
function wyswietl()
local konto = getPlayerAccount(localPlayer)
local temperatura = getAccountData(konto, "temperatura")
local temper1 = string.format("%.02f", temperatura)
dxDrawText("Temperatura: "..temper1.." ?C ", x/1.80, y/6.5, 1209, 835, tocolor(255, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false)
end
addEventHandler("onClientRender", root, wyswietl)
function zapisz()
local konto = getPlayerAccount(localPlayer)
local stan = getAccountData(konto, "temperatura")
end
addEventHandler("onClientPlayerQuit", root, zapisz)
function wczytaj()
if getAccountData(konto, "temperatura") then
setAccountData(konto, "temperatura", stan)
else
setAccountData(konto, "t... |