Files

> > CS2D > Lua Scripts > Advanced minute advertisement
Files overviewCS2D overviewLua Scripts overview

English Advanced minute advertisement >

21 comments650 b, 433 Downloads

old Advanced minute advertisement

TopNotch
User Off Offline

Hello everyone,

I think the title says enough already.

• Features •
∗ Unlimited custom advertisements
∗ Random advertisements every minute

• Commands •
∗ !ads - Counts how many items there are to advertise
∗ !advertise <item> - Adds an item to be advertised.

• FAQ •
How to change the advertisements? >

How to add/change a color? >


Guess what? You can do whatever you want with it, just don't claim it as yours.

This file was modified last on 11/04/2014
edited 3×, last 29.07.14 05:22:41 pm
Approved by GeoB99

Download Download

650 b, 433 Downloads

Comments

21 comments
Page
To the start Previous 1 2 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

GeoB99
Moderator Off Offline

@user Dracosto: Argh, wait there's another solution to do that easier than what I've posted below.
1
timer(5000, "parse","sv_msg "..string.char(169).." "..color.." "..messages[math.random(1, #messages)])
Just replace the parser line with this. I could have think about this before but I didn't pay attention into that. Silly me.

old

Dracosto
User Off Offline

user GeoB99: still no work but thanks for the attention ..

old

GeoB99
Moderator Off Offline

@user Dracosto:
1
2
3
4
5
6
7
8
9
10
11
12
13
-- CONFIG --
admin = {95753}
messages = {"Message 1","Message 2","Message 3"} -- Edit this
color = "216117117" -- You can change the color of the advertisement here
Seconds = 0 -- This should be kept un-touched

-- MAIN SCRIPT --
addhook("second","_second")
function _second()
	if Seconds == 5 then -- This is where you can change the second value in your choice
		parse('sv_msg '..string.char(169)..''..color..''..messages[math.random(1,#messages)])
	end
end

old

GeoB99
Moderator Off Offline

@user Dracosto: You can do that by replacing cs2d lua hook minute hook with cs2d lua hook second. It won't take a long time.
1
2
addhook("minute","_minute")
function _minute()
This is where you have to change it, also you can change the hook function name but that it's optional. Note that you must change the function name too by the way:
1
2
addhook("second","_second")
function _second()

old Time Change

Dracosto
User Off Offline

how to change it from minute to seconds ?? cause its causes such time to show it up cause my server is only 3 mins long and round ends usually in just 1m30s

I'm just planning to set it up every 5 seconds

old

Nemesis1999
User Off Offline

Very nice, keep it up!

old

Sparty
Reviewer Off Offline

Alright, Very creative and its okay.

old

Hellcat
GAME BANNED Off Offline

Easy but i like!
I like it!

old

oxytamine
User Off Offline

I hereby declare that this script was originally written by gUtZ.

old License

gUtZ
User Off Offline

So I can claim it as my friend's?

old

TopNotch
User Off Offline

user Alistaire 1. That's the code inside the .vbs.
Spoiler >

Deleted it as some just can't trust it.

2, 3: No need fix, simply removed.

4: I don't want to spent time in making an administration system for this.

EDIT: Gonna update the file tommorow.
edited 3×, last 10.04.14 11:25:30 pm

old

Infinite Rain
Reviewer Off Offline

@user Alistaire:
You need to use #<table name> in order to get a table length. Your information is outdated.

old

Alistaire
User Off Offline

Detailed comments:

1. You added a .vbs in your .zip. I read the code and it's not malicious, but please note that it is kinda suspicious to add a script (in vbs, which has IO support and could literally contain any virus you want) in your very empty zip archive.

2. Your code will break. The color = {} array has one comma too many, which is a syntax error.

3. Your code states one could add more RGB colour values. However, your script practically doesn't utilize any more (or any less) than 3. This is not a feature, and it shouldn't be listed as one.

4. The saycommands are accesible to anyone. This means anyone could come to a server with your script, spam "!advertise lol", and wreck an entire advertisement system.

5. Your tablelength() function's return isn't saved and is virtually useless. If you're gonna table.insert() messages into a table, they're numerically ordered and can their length can be returned with #array, without your completely unnecessary tablelength() function.
edited 1×, last 10.04.14 10:31:01 pm

old

AlcatrazZ
BANNED Off Offline

Why are you use PL tag?
PL - Poland
I like it!

old

TopNotch
User Off Offline

user Alistaire Didn't get you.
user Rainoth Thanks. And, could also be used for tips, hints, reminders etc.

old

H-X
User Off Offline

I had this idea for more than a year.

Simple and effective.
I like it!

old

Alistaire
User Off Offline

1
2
3
4
5
color = {
          "216116116", --You can add as many RGB colors as you want
          "255255255",
          "255220000",
},

Well that will break.
To the start Previous 1 2 Next To the start