Forum

> > CS2D > Scripts > How to create script?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How to create script?

15 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How to create script?

Mxcd2345
COMMUNITY BANNED Off Offline

Zitieren
Hello.
I wanted to ask how to create a script on the system of rank type :
1.SuperVip
2.Vip
3.ExtraVip
4.MegaVip
I like to set each rank could write in color .

If you helped me not insulted or ignored it thanks .

Sorry My English is NOT Perfect!

alt Re: How to create script?

sonkii
User Off Offline

Zitieren
How to change the tags,

Someone hat geschrieben
Open chat.lua inside modules folder, just right the start of file you will see
1
2
3
4
5
6
hc.chat.SAY_TAGS = {
    [hc.VIP] = "VIP",
    [hc.MODERATOR1] = "Mod",
    [hc.MODERATOR2] = "Mod",
    [hc.ADMINISTRATOR] = "Adm"
}

Just modify it for your own.


Believe me.That was not lying you.

Tips for asking:

> Use the Search functions before asking!
> If you wanna asking for something,just use this thread!
> And ask the owner of the script if you have a problem of his/her script.

alt Re: How to create script?

Mami Tomoe
User Off Offline

Zitieren
This is not enough to change the tags, some parts of the script might remain with the old names and it will cause confusion, I recommend not changing the tags unless you know what you're doing.

alt Re: How to create script?

Rainoth
Moderator Off Offline

Zitieren
Here's a SUPER old code for ranks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
admin = {1}
mod = {55555}
vip = {12345}

local rnd1 = math.random(0,255)
local rnd2 = math.random(0,255)
local rnd3 = math.random(0,255)
local color =("0"):rep(3-#rnd1)..rnd1..("0"):rep(3-#rnd2)..rnd2..("0"):rep(3-#rnd3)..rnd3

addhook("say","coloredtext")
function coloredtext(id,txt)
	for k,v in ipairs(admin) do
		if player(id,"usgn") == v then
			msg("©255255255Admin "..player(id,"name").." : ©"..color.." "..txt)
			return 1
		end
	end
	for k,v in ipairs(mod) do
		if player(id,"usgn") == v then
			msg("©255255255Moderator "..player(id,"name").." : ©"..color.." "..txt)
			return 1
		end
	end
	for k,v in ipairs(vip) do
		if player(id,"usgn") == v then
			msg("©255255255Very Important Person "..player(id,"name").." : ©"..color.." "..txt)
			return 1
		end
	end
end

alt Re: How to create script?

GeoB99
Moderator Off Offline

Zitieren
@user Rainoth: Your script will bug afterwards. Considering rnd1, rnd2 and rnd3 as numbers you cannot get the length of them with
#
operator since they're not strings. We gotta use
tostring()
for that then.
The Code >

I tweaked the code a bit. It should work properly now.

alt Re: How to create script?

Rainoth
Moderator Off Offline

Zitieren
@user GeoB99: I was aware of that, but I remember the script working. Maybe it didn't work as intended.
Didn't care for it because the guy asked for showing ranks, not making chat in random colors so I didn't bother to fix it and I assumed (and still assume) those parts will be deleted.

alt Re: How to create script?

sonkii
User Off Offline

Zitieren
And I dont know to help you and I cannot understand what are you say.Maybe you can read tutorials.Next time,i hope you write understandable words.

alt Re: How to create script?

sonkii
User Off Offline

Zitieren
Oh,i forgot about this.You can also see one of the samples to help you.The samples are at (your cs2d folder/sys/lua/samples).I'll recommend you to read the tutorial.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht