Forum

> > CS2D > Scripts > Problems with hooking, return 1 not working
Forums overviewCS2D overview Scripts overviewLog in to reply

English Problems with hooking, return 1 not working

2 replies
To the start Previous 1 Next To the start

old Problems with hooking, return 1 not working

DannyDeth
User Off Offline

Quote
Hi there,
I was wondering if I could get some help, I have been searching for answers for about 20 minutes now and I can't seem to find anything.

I was wondering if anyone knew what the issue with 'return 1' was, and how to fix it. I have multiple scripts which use return in some way, for instance a small bomb-defuse script to randomise it:
1
2
3
4
5
6
addhook("bombdefuse","df")
function df()
	local chosen = math.random(0,1)
	msg(chosen.." was picked") -- show which was picked --
	return chosen
end

EDIT:

I'm also having severe trouble with 'say', and it's return the most. The defuse script was because an error in my server.lua file stopped it at that line and the dofile was afterwards. Any ideas how to stop chat using the say hook and return 1? I can't seem to figure out what is wrong with it
edited 1×, last 26.01.11 03:42:56 pm

old Re: Problems with hooking, return 1 not working

DannyDeth
User Off Offline

Quote
Tried that, the hook doesn't work. The text still comes through It's really annoying actually, the whole script is held simply by this

EdiT: it turns out there was another error which stopped it, there were no problems after all, just some bad code i forgot to remove, but thanks Yasday
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview