Author Topic: How to add a advert?  (Read 3839 times)

0 Members and 2 Guests are viewing this topic.

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
How to add a advert?
« on: January 15, 2007, 11:08:42 AM »
Ok, i'm looking at my Garrysmod/lua/ulx/configs/server.ini and i'm confused on this hole section.

Code: [Select]
// Adverts
// addCsayAdvert <msg> <r> <g> <b> <repeat_time> <length> [<group>]
// addAdvert <msg> <repeat_time> [<group>]
// addCsayAdvert puts adverts in the middle of the screen, addAdvert puts adverts in the text area.
// You can use %host%, %curmap%, and %ulx_version% in your message and have it automagically parsed for you.
// If you specify a group, adverts in that group will run sequentially instead of simultaneously. EX:
// ulx addAdvert "This message is run first" 10 a
// ulx addAdvert "This message is run second" 10 a
ulx addCsayAdvert "You're playing on %host%, Enjoy your stay!"100 255 200 300 10

// Please, if you have any compassion at all, leave this one in.
ulx addAdvert "This server is running ULX version %ulx_version% from ulyssesmod.net" 360

I really don't know how to make a advert useing this code.
Code: [Select]
addCsayAdvert <msg> <r> <g> <b> <repeat_time> <length> [<group>]Or this one.
Code: [Select]
addAdvert <msg> <repeat_time> [<group>]
Even if i could were would i put the new advert?

Can someone help me? Please?

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: How to add a advert?
« Reply #1 on: January 15, 2007, 11:21:58 AM »
// addCsayAdvert <msg> <r> <g> <repeat_time> <length> [<group>]
// addAdvert <msg> <repeat_time> [<group>]
// addCsayAdvert puts adverts in the middle of the screen, addAdvert puts adverts in the text area.
// You can use %host%, %curmap%, and %ulx_version% in your message and have it automagically parsed for you.
// If you specify a group, adverts in that group will run sequentially instead of simultaneously. EX:
// ulx addAdvert "This message is run first" 10 a
// ulx addAdvert "This message is run second" 10 a
ulx addCsayAdvert "You're playing on %host%, Enjoy your stay!"100 255 200 300 10

// Please, if you have any compassion at all, leave this one in.
ulx addAdvert "This server is running ULX version %ulx_version% from ulyssesmod.net" 360


// just put it here
ulx addAdvert "I'm a monkey!" 361


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How to add a advert?
« Reply #2 on: January 15, 2007, 11:34:03 AM »
GD's right, put it anywhere.
Experiencing God's grace one day at a time.

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
Re: How to add a advert?
« Reply #3 on: January 15, 2007, 06:09:32 PM »
Do the #'s always need to be diffrent?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How to add a advert?
« Reply #4 on: January 15, 2007, 07:36:00 PM »
Only if you want them to be.
Experiencing God's grace one day at a time.

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
Re: How to add a advert?
« Reply #5 on: January 16, 2007, 07:37:18 AM »
Ok, i put them all at diffrent numbers. To me it seems like its the time peroid before they advert again. BUT, it somtimes even though there are diffrent numbers they all come up at the same time. i want them to be sepreate.

Help please.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How to add a advert?
« Reply #6 on: January 16, 2007, 04:08:56 PM »
*sigh* let me try this one guys.

Brett.
Let start with the simplest.
// addAdvert <msg> <repeat_time> [<group>]

if you use
ulx addAdvert "I'm a monkey!" 360

This would repeat every 6 minutes

if you use
1) ulx addAdvert "I'm a monkey!" 360
This would repeat every 6 minutes
2) ulx addAdvert "He's a monkey" 390
This would repeat every 6 minutes, 30 seconds.

Now, I believe here is where you might be getting confused. The way I just listed those two, they would only be 30 seconds apart the first time they were advertised.
They don't run at the same time.
Look at this math. (seconds were converted to minutes for easy viewing)
1) would print at (6),(12),(18),(24),(30),(36)
2) would print at (6.5),(13),(19.5),(26),(32.5),(39)
See how the times start growing apart? Depending on what numbers you chose, they usually start circling in on each other.
I see most people confusing that.

HOWEVER, if you want 2) to run 30 seconds after 1) all the time. You'd specify a groupname for both.
1) ulx addAdvert "I'm a monkey!" 360 monkey
2) ulx addAdvert "He's a monkey" 390 monkey

2) would always be 30 seconds after 1)

That help?


« Last Edit: January 16, 2007, 04:13:36 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How to add a advert?
« Reply #7 on: January 16, 2007, 06:09:11 PM »
1) ulx addAdvert "I'm a monkey!" 360 monkey
2) ulx addAdvert "He's a monkey" 390 monkey

2) would always be 30 seconds after 1)

That help?
Actually it would be:
1) ulx addAdvert "I'm a monkey!" 360 monkey
2) ulx addAdvert "He's a monkey" 30 monkey

Otherwise, great explaination JamminR! :)
Experiencing God's grace one day at a time.

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
Re: How to add a advert?
« Reply #8 on: January 17, 2007, 08:30:11 AM »
Alright, thank you. I will re-post if i'm doing anything wrong.