Forum

> > CS2D > Scripts > Return No Works...
Forums overviewCS2D overview Scripts overviewLog in to reply

English Return No Works...

6 replies
To the start Previous 1 Next To the start

old Return No Works...

superpegamento
User Off Offline

Quote
the problem is that the return not work

code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
staffs = {74551}

addhook("say","staff_say")
function staff_say(id,t)
for _, usgn in ipairs(staffs) do
if player(id,'usgn') == usgn then
msg("©000128128[STAFF] "..player(id,"name").." :©255255255 "..t)
return 1
end
end
end

addhook("say" , "help_txt")
function help_txt(id,tx)
if tx=="!help" then	
msg2(id,"xxxxxxxxxxxxxxxxxx")
return 1
end
end

old Re: Return No Works...

ExecL
User Off Offline

Quote
You have to put it in the same function do not use multiple functions of the same kind!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
staffs = {74551}

addhook("say","staff_say")
function staff_say(id,text)
for _, usgn in ipairs(staffs) do
if player(id,'usgn') == usgn then
msg("©000128128[STAFF] "..player(id,"name").." :©255255255 "..text)
return 1
end
if text=="!help" then     
msg2(id,"xxxxxxxxxxxxxxxxxx")
	return 1
	end
   end
end

Tested, works.
edited 1×, last 19.07.13 08:37:46 am

old Re: Return No Works...

superpegamento
User Off Offline

Quote
user ExecL has written
You have to put it in the same function do not use multiple functions of the same kind!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
staffs = {74551}

addhook("say","staff_say")
function staff_say(id,text)
for _, usgn in ipairs(staffs) do
if player(id,'usgn') == usgn then
msg("©000128128[STAFF] "..player(id,"name").." :©255255255 "..text)
return 1
end
if text=="!help" then     
msg2(id,"xxxxxxxxxxxxxxxxxx")
	return 1
	end
   end
end

Tested, works.


no works... check the script

old Re: Return No Works...

Rainoth
Moderator Off Offline

Quote
Tested it. Works fine.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
staffs = {15476}

addhook("say","staff_say")
function staff_say(id,text)
	if text=="!help" then     
		msg2(id,"xxxxxxxxxxxxxxxxxx")
		return 1
	else
		for _, usgn in ipairs(staffs) do
			if player(id,'usgn') == usgn then
				msg("\169000128128[STAFF] "..player(id,"name").." :\169255255255 "..text)
				return 1
			end
		end
	end
end

It might be because you're running few other scripts that use "say" hook.

old Re: Return No Works...

superpegamento
User Off Offline

Quote
user Rainoth has written
Tested it. Works fine.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
staffs = {15476}

addhook("say","staff_say")
function staff_say(id,text)
	if text=="!help" then     
		msg2(id,"xxxxxxxxxxxxxxxxxx")
		return 1
	else
		for _, usgn in ipairs(staffs) do
			if player(id,'usgn') == usgn then
				msg("\169000128128[STAFF] "..player(id,"name").." :\169255255255 "..text)
				return 1
			end
		end
	end
end

It might be because you're running few other scripts that use "say" hook.


tanks
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview