Author Topic: Auto show ulx motd to everyone every x seconds  (Read 2913 times)

0 Members and 1 Guest are viewing this topic.

Offline mindzombies

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Auto show ulx motd to everyone every x seconds
« 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: [Select]
timer.Create("motd", 600,0, function() RunConsoleCommand("ulx", "cexec", "*", "ulx", "motd") end)
I also tried this:
Code: [Select]
timer.Create("motd", 600,0, function() RunConsoleCommand("ulx cexec * ulx motd", "") end)
However it does not seem to work :$


Quote
Even the smartest of the smartest arent the smartest xD

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Auto show ulx motd to everyone every x seconds
« Reply #1 on: November 03, 2014, 01:29:57 PM »
Where did you place it in your server files?
Once you get to know me, you'll find you'll have never met me at all.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Auto show ulx motd to everyone every x seconds
« Reply #2 on: November 03, 2014, 03:26:07 PM »
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: [Select]
timer.Create("motd", 600,0, function() RunConsoleCommand("ulx", "cexec", "*", "ulx", "motd") end)
I also tried this:
Code: [Select]
timer.Create("motd", 600,0, function() RunConsoleCommand("ulx cexec * ulx motd", "") end)
However it does not seem to work :$




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?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline mindzombies

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Auto show ulx motd to everyone every x seconds
« Reply #3 on: November 04, 2014, 03:10:45 AM »
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

Offline mindzombies

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Auto show ulx motd to everyone every x seconds
« Reply #4 on: November 04, 2014, 03:39:27 AM »
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: [Select]
timer.Create("motd", 300,0, function() RunConsoleCommand("say", "If you love this server, please add bloodrp.us.to:27018 to favorites") end)

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

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Auto show ulx motd to everyone every x seconds
« Reply #5 on: November 04, 2014, 07:11:13 PM »
Are you getting any errors, or is your IG console giving you errors?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline mindzombies

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Auto show ulx motd to everyone every x seconds
« Reply #6 on: November 05, 2014, 03:51:07 AM »
No, I don't think my console outputs any errors, at least not related to this... But if it does, then they must have escaped my notice :/

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given