Forum

> > CS2D > Scripts > How to combine those 2 scrips?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to combine those 2 scrips?

3 replies
To the start Previous 1 Next To the start

old How to combine those 2 scrips?

Crash13
User Off Offline

Quote
I have just learned lua scripts better, i was wondered... .. My script is so hard for me, but works, huh. But now i have a thing and dont understand... I press on Special Colours then press White.... when i write : nothing, i write with a simple color. What i can do now?

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
31
32
33
34
35
36
addhook("serveraction","md_act")
function md_act(id,sact)
	if sact == 1 then
		menu(id,"Config Menu,Configuration,About Script")	
	end	
end

addhook("menu","my_menu")
function my_menu(id,title,button)
if title == "Config Menu" then	
if button == 1 then
menu(id,"Special Menu,Hats,Special colour,Tag,Help")
elseif button == 2 then
msg2(id,"©255255255MD CS2D script")
msg2(id,"©255255255-By Crash13")
end
end
end

addhook("menu","adm_say")
function adm_say(id,title,button)
	if title == "Special Menu" then
		if button == 2 then
			menu(id,"Special Colours,White")
		end
	end
end		

addhook("say","colour_say")	
function colour_say(id,txt,title,button)
	if title == "Special Colours" then
		if button == 1 then
			msg("©255255255"..player(id,"name").."/Adm/: "..txt)
		end	
	end
end

old Re: How to combine those 2 scrips?

EngiN33R
Moderator Off Offline

Quote
You did it all wrong.

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function initArray(f,v)
	local cmd={}
	for c=1,f do
		cmd[c]=v
	end
	return cmd
end

colour=initArray(32,0)

addhook("serveraction","md_act")
function md_act(id,sact)
	if sact == 1 then
		menu(id,"Config Menu,Configuration,About Script")     
	end     
end

addhook("menu","my_menu")
function my_menu(id,title,button)
	if title == "Config Menu" then     
		if button == 1 then
			menu(id,"Special Menu,Hats,Special colour,Tag,Help")
		elseif button == 2 then
			msg2(id,"©255255255MD CS2D script")
			msg2(id,"©255255255-By Crash13")
		end
	end
	if title == "Special Menu" then
		if button == 2 then
			menu(id,"Special Colours,White")
		end
	end
	if title == "Special Colours" then
		if button ==1 then
			colour[id]=255255255
		end
	end
end          

addhook("say","colour_say")     
function colour_say(id,txt)
	if (colour[id]~=0) then
		msg("©"..colour[id]..player(id,"name").."/Adm/: "..txt)
	end
end

old Re: How to combine those 2 scrips?

Crash13
User Off Offline

Quote
user EngiN33R has written
You did it all wrong


ok. Thanks. I wrote return 1 here: under
msg("C"..player(id,"name").." etc...
return 1 <-----
end

but when i write: Crash13/Adm/: lol
Crash13: lol

hmmm.... why? i have write return 1. Why don't work?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview