eAi Posted May 24, 2008 Share Posted May 24, 2008 How about making this into a resource? It could be quite useful for server admins in general Link to comment
XetaQuake Posted May 25, 2008 Author Share Posted May 25, 2008 Now i have a another question I tried now very long with the differents way to get the script restarts after a time. Because i want that the random text comes from time to time... Here is one from many ways i tried: ... setTimer ( function stufftest() ... ... end , 120000, 0) ... But it don´t work, i still get this error: http://b.imagehost.org/0436/hmmm.png Also i don´t know that the script loads a new node from the xml file when a timer launch them again? Can anybody help me? Link to comment
[UVA]Bart Posted May 25, 2008 Share Posted May 25, 2008 sorry xetaquake this is off topic but do you have msn ? also about the showing every other time, write to xml howmany times a player has opend the gui and on the 3rd one show the immage, that way when the gui is open the other 2 times it wont show and then re-write in the xml "0" u get me ? basically check the xml for the players name and if it == 3 then show the scrolling lable else dont show it and add 1 to whats in the xml Link to comment
XetaQuake Posted May 25, 2008 Author Share Posted May 25, 2008 No i don´t have msn Its not possibly for a player to show or hide the window (its a static little window), i searching for a way to reload the script every 2 minutes, so it will be a new random text every 2 minutes. Link to comment
[UVA]Bart Posted May 25, 2008 Share Posted May 25, 2008 stick a timer on the function that makes the sliding text just call that function every 2 mins Link to comment
XetaQuake Posted May 25, 2008 Author Share Posted May 25, 2008 Here is one from many ways i tried: ... setTimer ( function stufftest() ... ... end , 120000, 0) ... But it don´t work, i still get this error: http://b.imagehost.org/0436/hmmm.png Also i don´t know that the script loads a new node from the xml file when a timer launch them again? Can anybody help me? Link to comment
Remp Posted May 25, 2008 Share Posted May 25, 2008 ... setTimer ( function() stufftest() ... ... end , 120000, 0) ... Link to comment
XetaQuake Posted May 25, 2008 Author Share Posted May 25, 2008 Hi, then i get this error: attempt to call global stufftest (a nil value) And the functions are don´t to see ingame Link to comment
50p Posted May 25, 2008 Share Posted May 25, 2008 Hi,then i get this error: attempt to call global stufftest (a nil value) And the functions are don´t to see ingame stufftest() is just an example to show you what to do. You can show or hide the window using guiSetVisible func. You can change its text too, using guiSetText func. Link to comment
[UVA]Bart Posted May 25, 2008 Share Posted May 25, 2008 setTimer (stufftest(), 120000, 0) function stufftest() outputChatBox("stuff test function") end Link to comment
50p Posted May 26, 2008 Share Posted May 26, 2008 setTimer (stufftest(), 120000, 0) function stufftest() outputChatBox("stuff test function") end You don't use brackets when you call a function using timer.: setTimer (stufftest, 120000, 0) function stufftest() outputChatBox("stuff test function") end Link to comment
XetaQuake Posted May 26, 2008 Author Share Posted May 26, 2008 I already tried it to add the function name directly in the setTimer, but then i get everytime a "bad argument @ setTimer" error. So i learned it to copy the complete function in a seTimer...but this don´t work too on my script (but on all others) Is there any eventHandlers to restart the script? I was searching for client-side Events in the wiki, but found nothing Link to comment
[UVA]Bart Posted May 26, 2008 Share Posted May 26, 2008 well spotted 50p lol cause a copied the function name must a copied brackets too lol Link to comment
50p Posted May 26, 2008 Share Posted May 26, 2008 I already tried it to add the function name directly in the setTimer, but then i get everytime a "bad argument @ setTimer" error.So i learned it to copy the complete function in a seTimer...but this don´t work too on my script (but on all others) Is there any eventHandlers to restart the script? I was searching for client-side Events in the wiki, but found nothing Timers are useful and you must know how to use it. As Lua is typeless language you must check if variable/param is that what it should be. First, scripts gets executed from top to the bottom, from left to right. In the example above you call a function that does not exist at the time you call it. It will also happen if you addEvent AFTER you attach a function to it. Link to comment
XetaQuake Posted May 26, 2008 Author Share Posted May 26, 2008 Thanks 50p for the information for lua now i getting it working =) Link to comment
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