Forum

> > CS2D > Scripts > msg bug [Solved]
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch msg bug [Solved]

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt msg bug [Solved]

Ridho
User Off Offline

Zitieren
hi all, I found a bug in my script (maybe) , I've made this:
1
2
3
4
5
6
7
8
9
addhook("say","say_")
function say_(id,txt)
	if string.lower(txt)=="rank" then
		return 0
	else
		msg(color.."000255000"..player(id,"name")..":  "..txt)
	return 1
	end
end

initially it works, but after I edit that and test it, I just found a bug, although It's same with the beginning

I think this picture can explain it

IMG:https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xap1/t31.0-8/p526x395/1911286_958837834146150_6531689324869838954_o.jpg


Ignore about my bad english
thank you
1× editiert, zuletzt 20.12.14 11:13:08

alt Re: msg bug [Solved]

Joni And Friends
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
color="\169"
addhook("say","say_")
function say_(id,txt)
     if string.lower(txt)=="rank" then
          return 0
     else
          msg(color.."000255000"..player(id,"name")..":  "..txt)
     return 1
     end
end
Check is you adding "msg" variable?
1× editiert, zuletzt 20.12.14 09:52:29

alt Re: msg bug [Solved]

Ridho
User Off Offline

Zitieren
I just make one say hook, btw by using
1
color="\169"

is that different with this?
1
color=string.char(169)

alt Re: msg bug [Solved]

Joni And Friends
User Off Offline

Zitieren
No, but that error is on the msg variable, is you adding msg variable? check it, that error will coming if you put this code on your script
1
msg()
because you forgot to adding (")

alt Re: msg bug [Solved]

Ridho
User Off Offline

Zitieren
I dont really understand but there is only 1 "msg", but a lot of "msg2" in my script

I've changed the string.char(169) to "\169" but the same thing appeared (again)
IMG:https://i62.tinypic.com/15s6j3a.png

alt Re: msg bug [Solved]

DC
Admin Off Offline

Zitieren
The message looks like "msg" is a table in your script. So at some point you probably declare a table called "msg". E.g. this way:
1
msg = {}
This overwrites the msg function so you can't use it anymore. This can either happen in your script or in any other script you load.

Search for all occurrences of "msg" in all used scripts to find the problem.

alt Re: msg bug [Solved]

Ridho
User Off Offline

Zitieren
[Edit]

I've searched "msg" as user DC: suggested me, finally Problem Solved thanks
1× editiert, zuletzt 20.12.14 11:12:42

alt Re: msg bug [Solved]

DC
Admin Off Offline

Zitieren
No... this CAUSES the problem! DO NOT add it. You probaly already have something like this in your code otherwise you wouldn't get the error message.

Edit: Glad to hear that it helped
Please note that simply removing a table declaration probably causes new problems at another point... unless the table wasn't used at all.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht