Wysłany: 2021-01-22, 01:33
Lucky!!! :)
Wiek: 20 Na forum: 2372 dni Posty: 121
Nick w MP: Lucky
Piwa : 1163
Witam, chc? zrobi?, aby w wersji serwera by?a godzina, lecz si? ona od?wie?a jedynie poprzez zresetowanie skryptu. Pomo?e kto?, daje piwka?
Version ={
m_string = '' ,
m_label = nil ,
}
local screenWidth , screenHeight = GuiElement . getScreenSize ()
local time = getRealTime ()
local hours = time . hour
local minutes = time . minute
local seconds = time . second
local miesiacday = time . monthday
local miesiac = time . month
local year = time . year
if ( hours < 10 ) then
hours = "0" .. hours
end
if ( minutes < 10 ) then
minutes = "0" .. minutes
end
if ( seconds < 10 ) then
seconds = "0" .. seconds
end
function init ()
local pidek = getElementData ( localPlayer , "player:sid" )
Version . m_string = '' .. hours .. ':' .. minutes .. ':' .. seconds .. ' | AmperRPG v1'
Version . m_label = guiCreateLabel ( screenWidth - 338 , screenHeight - 15 , 250 , 18 , Version . m_string .. ' |' , false )
guiSetAlpha ( Version . m_label , 0.5 )
guiLabelSetHorizontalAlign ( Version . m_label , 'right' )
end
init ()
function destroy ()
if Version . m_label then
Version . m_label : destroy ()
end
end
function setString ( version )
Version . m_string = version
end
function getString ()
return Version . m_string
end
Wysłany: 2021-01-22, 07:12
Mikołajj
Wiek: 22 Na forum: 2885 dni Posty: 303
Nick w MP: Mikołaj
Piwa : 132
W takim razie zmienne pochodne od getRealTime() oraz wszystkie warunki musisz umie?ci? w onClientRender, ?eby to mia?o logik?, wtedy czas b?dzie si? od?wie?a? co klatk? przez gta
Wysłany: 2021-01-22, 15:27
Lucky!!! :)
Wiek: 20 Na forum: 2372 dni Posty: 121
Nick w MP: Lucky
Piwa : 1163
Miko?ajj ,
Wszystko spoko, tylko teraz tak jakby nak?adaj? si? na siebie te guilabel i jest troch? ?le. Co robi? ?le?
Kod: Version={
m_string='',
m_label=nil,
}
local screenWidth, screenHeight=GuiElement.getScreenSize()
function init()
local time = getRealTime()
local hours = time.hour
local minutes = time.minute
local seconds = time.second
local miesiacday = time.monthday
local miesiac = time.month
local year = time.year
if (hours < 10) then
hours = "0"..hours
end
if (minutes < 10) then
minutes = "0"..minutes
end
if (seconds < 10) then
seconds = "0"..seconds
end
Version.m_string=''..hours..':'..minutes..':'..seconds..' | AmperRPG v1'
Version.m_label=guiCreateLabel(screenWidth-338, screenHeight-15, 250, 18, Version.m_string .. ' |', false)
guiSetAlpha(Version.m_label, 0.5)
guiLabelSetHorizontalAlign(Version.m_label, 'right')
end
addEventHandler("onClientRender", root, init)
function destroy()
if Version.m_label then
Version.m_label:destroy()
end
end
function setString(version)
Version.m_string=version
end
function getString()
return Version.m_string
end
Tagi: godzina :: wersji :: serwera
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: