Reflex# Posted March 17, 2012 Posted March 17, 2012 ----->meta.xml "ReFleX" type">type="script" name="Server Time" version="1.0" /> function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end I create this..but thing dont work..dont show in resource column,whats wrong? And 2-nd question How i can to create Ghostmode:On/off table in place what i want? Scripting in lua
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 oh sorry about time all work..but how to create table time? Scripting in lua
tinnetju Posted March 17, 2012 Posted March 17, 2012 ----->meta.xml "ReFleX" type">type">type="script" name="Server Time" version="1.0" /> >type="server" /> function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end I create this..but thing dont work..dont show in resource column,whats wrong? And 2-nd question How i can to create Ghostmode:On/off table in place what i want? You didnt write it you copied it from the wiki, and what exactly do you want to be done?
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 ----->meta.xml "ReFleX" type">type">type">type="script" name="Server Time" version="1.0" /> function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end I create this..but thing dont work..dont show in resource column,whats wrong? And 2-nd question How i can to create Ghostmode:On/off table in place what i want? You didnt write it you copied it from the wiki, and what exactly do you want to be done? I want to create table in what will be write Server Time:[here time] Scripting in lua
Castillo Posted March 17, 2012 Posted March 17, 2012 You can use the server side text functions to create a text server side: https://wiki.multitheftauto.com/wiki/Ser ... _functions San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 You can use the server side text functions to create a text server side: https://wiki.multitheftauto.com/wiki/Ser ... _functions function showTextDisplay ( player, command ) local serverDisplay = textCreateDisplay() textDisplayAddObserver ( serverDisplay, player ) local serverText = textCreateTextItem ( "Server Time:", 0.5, 0.5 ) textDisplayAddText ( serverDisplay, serverText ) end addCommandHandler( "showText", showTextDisplay ) function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute end Something like this? Scripting in lua
Castillo Posted March 17, 2012 Posted March 17, 2012 function showTextDisplay ( ) local serverDisplay = textCreateDisplay ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( serverDisplay, player ) end serverText = textCreateTextItem ( "Server time:", 0.5, 0.5 ) textDisplayAddText ( serverDisplay, serverText ) end addEventHandler ( "onResourceStart", resourceRoot, showTextDisplay ) function updateText ( ) local realTime = getRealTime() local hours = realTime.hour local minutes = realTime.minute local seconds = realTime.second if ( serverText ) then textItemSetText ( serverText, "Server time: ".. hours ..":".. minutes ..":".. seconds ) end end setTimer ( updateText, 1000, 0 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 function showTextDisplay ( ) local serverDisplay = textCreateDisplay ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( serverDisplay, player ) end serverText = textCreateTextItem ( "Server time:", 0.5, 0.5 ) textDisplayAddText ( serverDisplay, serverText ) end addEventHandler ( "onResourceStart", resourceRoot, showTextDisplay ) function updateText ( ) local realTime = getRealTime() local hours = realTime.hour local minutes = realTime.minute local seconds = realTime.second if ( serverText ) then textItemSetText ( serverText, "Server time: ".. hours ..":".. minutes ..":".. seconds ) end end setTimer ( updateText, 1000, 0 ) Oh thx man that work How i can change font? and place of this thing?now it in the center.I want it in upper right corner.. Scripting in lua
Castillo Posted March 17, 2012 Posted March 17, 2012 As far as I know, you can't change the font of a server side text. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 As far as I know, you can't change the font of a server side text. Ok,thx again And how i can choose a place for this text? Scripting in lua
Castillo Posted March 17, 2012 Posted March 17, 2012 Read the wiki arguments: https://wiki.multitheftauto.com/wiki/TextCreateTextItem San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Reflex# Posted March 17, 2012 Author Posted March 17, 2012 Read the wiki arguments:https://wiki.multitheftauto.com/wiki/TextCreateTextItem when i add place what i need..script dont work..shit..sorry Solidsnake14 for my bad scripting..i'm just newbie...but i trying Scripting in lua
Castillo Posted March 17, 2012 Posted March 17, 2012 0.5, 0.5 that's the X and Y position, accepts 0-1. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now