General > Developers Corner

Auto show ulx motd to everyone every x seconds

(1/2) > >>

mindzombies:
Hey peeps, i was hoping one of you smart alecks could help me out with my teeny problem.

Im not that great in lua :$ okay not good at all, but here is a crude setup i tried to make, which is supposed to show the ulx motd every 10 minutes. As in, its supposed to run this command on console: ulx cexec * ulx motd

Here is my code:

--- Code: ---timer.Create("motd", 600,0, function() RunConsoleCommand("ulx", "cexec", "*", "ulx", "motd") end)

--- End code ---
I also tried this:

--- Code: ---timer.Create("motd", 600,0, function() RunConsoleCommand("ulx cexec * ulx motd", "") end)
--- End code ---

However it does not seem to work :$


--- Quote ---Even the smartest of the smartest arent the smartest xD
--- End quote ---

Caustic Soda-Senpai:
Where did you place it in your server files?

Bite That Apple:

--- Quote from: mindzombies on November 03, 2014, 10:11:27 AM ---Hey peeps, i was hoping one of you smart alecks could help me out with my teeny problem.

Im not that great in lua :$ okay not good at all, but here is a crude setup i tried to make, which is supposed to show the ulx motd every 10 minutes. As in, its supposed to run this command on console: ulx cexec * ulx motd

Here is my code:

--- Code: ---timer.Create("motd", 600,0, function() RunConsoleCommand("ulx", "cexec", "*", "ulx", "motd") end)

--- End code ---
I also tried this:

--- Code: ---timer.Create("motd", 600,0, function() RunConsoleCommand("ulx cexec * ulx motd", "") end)
--- End code ---

However it does not seem to work :$


--- End quote ---


If I'm correct, the first one is actually "right", rather than the second one you made. Though, as the man above said, where was this file placed?

mindzombies:
I placed this in lua/autorun/server if I am correct. I'm pretty sure I've placed it in correct location, and I've added both code. None works. I will get back after checking the location

mindzombies:
Yep that's the directory,  lua/autorun/server/motd.lua

In fact, I also have a 'say' command, which basically makes console say something:

--- Code: ---timer.Create("motd", 300,0, function() RunConsoleCommand("say", "If you love this server, please add bloodrp.us.to:27018 to favorites") end)

--- End code ---

I'm not sure, but I remember reading somewhere that the RunConsolecommand  is in the following way: ("command" "parameter") something like that

Navigation

[0] Message Index

[#] Next page

Go to full version