Forum

> > CS2D > Scripts > Color, Whats wrong?!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Color, Whats wrong?!

7 replies
To the start Previous 1 Next To the start

old Color, Whats wrong?!

Cons
User Off Offline

Quote
Please guys, take a look on that, and show me or correct to me whats wrong..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
color="255255255"

addhook("say","admine")
function admine(id, txt)
for _, usgn in ipairs(admin) do
if player(id,'usgn') == usgn then
	if txt:lower():sub(1, 1) == "!" then
	local changecolor = tonumber(txt:sub(1))
color="changecolor"
msg2(id,"©192192192[Sistem]: Admin Color has been changed!")
end
end
end
end

old Re: Color, Whats wrong?!

Avo
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
color="255255255"

addhook("say","admine")
function admine(id, txt)
for _, usgn in ipairs(admin) do
if player(id,'usgn') == usgn then
     if txt:lower():sub(1, 1) == "!" then
     local changecolor = tonumber(txt:sub(1))
color=changecolor		--without "" here!
msg2(id,"©192192192[Sistem]: Admin Color has been changed!")
end
end
end
end

old Re: Color, Whats wrong?!

Cons
User Off Offline

Quote
user Avo has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
color="255255255"

addhook("say","admine")
function admine(id, txt)
for _, usgn in ipairs(admin) do
if player(id,'usgn') == usgn then
     if txt:lower():sub(1, 1) == "!" then
     local changecolor = tonumber(txt:sub(1))
color=changecolor		--without "" here!
msg2(id,"©192192192[Sistem]: Admin Color has been changed!")
end
end
end
end


Fail! ×

old Re: Color, Whats wrong?!

Avo
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
admin={}	--usgns here
color="255255255"
addhook("say","admine")
function admine(id, txt)
	for _, usgn in ipairs(admin) do
		if player(id,'usgn') == usgn then
			if txt:lower():sub(1, 1) == "!" then
				local changecolor=txt:gsub("!","")	--you get text without "!"
				color=changecolor
				msg2(id,"©192192192[Sistem]: Admin Color has been changed!")
			end
		end
	end
end
Any errors in console?

old Re: Color, Whats wrong?!

Cons
User Off Offline

Quote
user Avo has written
More >

Any errors in console?


Now Its Ok... A √ for your help.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview