Forum

> > CS2D > Scripts > Problems with hooking, return 1 not working
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Problems with hooking, return 1 not working

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Problems with hooking, return 1 not working

DannyDeth
User Off Offline

Zitieren
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
1× editiert, zuletzt 26.01.11 15:42:56

alt Re: Problems with hooking, return 1 not working

DannyDeth
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht