Dateien

> > CS2D > Lua Scripts > Advanced minute advertisement
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch Advanced minute advertisement >

21 Kommentare650 b, 433 Downloads

alt 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
3× editiert, zuletzt 29.07.14 17:22:41
Zugelassen von GeoB99

Download Download

650 b, 433 Downloads

Kommentare

21 Kommentare
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

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.

alt

Dracosto
User Off Offline

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

alt

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

alt

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()

alt 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

alt

Nemesis1999
User Off Offline

Very nice, keep it up!

alt

Sparty
Reviewer Off Offline

Alright, Very creative and its okay.

alt

Hellcat
GAME BANNED Off Offline

Easy but i like!
Ich mag es!

alt

oxytamine
User Off Offline

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

alt License

gUtZ
User Off Offline

So I can claim it as my friend's?

alt

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.
3× editiert, zuletzt 10.04.14 23:25:30

alt

Infinite Rain
Reviewer Off Offline

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

alt

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.
1× editiert, zuletzt 10.04.14 22:31:01

alt

AlcatrazZ
BANNED Off Offline

Why are you use PL tag?
PL - Poland
Ich mag es!

alt

H-X
User Off Offline

I had this idea for more than a year.

Simple and effective.
Ich mag es!

alt

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.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang