Forum

> > CS2D > Scripts > function say not work
Forums overviewCS2D overview Scripts overviewLog in to reply

English function say not work

6 replies
To the start Previous 1 Next To the start

old function say not work

Gaios
Reviewer Off Offline

Quote
Why when I add line if level[id] == 1 then, function not work?

1
function say(id,txt)
1
2
3
4
5
6
7
8
9
10
11
if mute[id] == true then
	return 1
end
if mute[id] == false then
	if text[id] == true then
		if level[id] == 1 then
			m(id,cmds.colors.member,player(id,"name").." [Member]: "..txt,1)
			return 1
		end
	end
end

Others >
edited 3×, last 05.10.12 06:18:48 am

old Re: function say not work

- - - - - - - - - - - - -
User Off Offline

Quote
Error Line 7:

1
m(id,cmds.colors.member,player(id,"name").." [Member]: "..txt,1)

is

1
msg(id,cmds.colors.member,player(id,"name").." [Member]: "..txt,1)

i think that is that

old Re: function say not work

omg
User Off Offline

Quote
user - - - - - - - - - - - - - has written
Error Line 7:

1
m(id,cmds.colors.member,player(id,"name").." [Member]: "..txt,1)

is

1
msg(id,cmds.colors.member,player(id,"name").." [Member]: "..txt,1)

i think that is that

can u not be dumb? its a function that he wrote himself, obviously + its still wrong

also, we need more of ur code. specifically, stuff involved with level and the function its in

old Re: function say not work

Gaios
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
function m(id,color,txt,mode)
	if mode == 1 then
		msg("©"..color..""..txt)
	elseif mode == 2 then
		msg2(id,"©"..color..""..txt)
	end
end
1
2
3
4
5
cmds = {
	colors = {
		member = "255255000",
	},
}

old Re: function say not work

Yates
Reviewer Off Offline

Quote
Use tables;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
MyTable = {}

addhook("join","_join")
function _join(id)
 MyTable[id] = {}
 MyTable[id].text = 1
 MyTable[id].level = 1
end

addhook("say","_say")
function _say(id,text)
 if MyTable[id].text == 1 then
  if MyTable[id].level == 1 then
   -- Text shit
  end
 end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview