May 31, 2020, 06:34 pm

Author Topic: [TonyE2][Release] Smart-Advert ft. Player count related timer scaling  (Read 926 times)

Offline The Honourable Tony Abbott

  • Supporter
  • ByB Newbie
  • *
  • Posts: 12
  • Australian Prime Minister
    • View Profile
    • My Profile - The Liberal Party of Australia
Hi ya'll, I know I haven't been everyones favourite person lately, so I figured I'd release my first (rather simple) E2 to sweeten you all up.

So what's the difference between this and a normal auto-advert? Basically this advert scales its timer based on the number of players connected on the server, At 20 players the advert will run every 2 mins, at 2 players the advert will run every 20 mins, after 20 players the timer stops scaling, and returns to a flat rate of 2 mins.

So whats the purpose? Basically, it reduces the spammy auto-adverts that go off every 2 mins, when the server only has a low population, its a simple change but works great!

Code: [Select]
@name TonyE2_Advert

if(first()|duped()){
    printColor(vec(255,255,255),"[",vec(255,0,0),"TonyE2",vec(255,255,255),"] Started Advert!")
}
if(numPlayers()>19) {
    interval(120000)
    concmd("say /advert <ADD YOUR ADVERT>")
}elseif(numPlayers()<20) {
    interval(1320000-(60000*numPlayers()))
    concmd("say /advert <ADD YOUR ADVERT")
}

You should be able to paste that straight into the in game editor, enjoy! :)
My Quotes
  • Climate change is crap.
  • I instinctively try to protect people from filth.
  • A tax cut to compensate for a tax increase is not a cut - it's a con.
  • We just can't stop people from being homeless if that's their choice.