PDA

View Full Version : script runtime error, but works



qwrtyp
17th February 2014, 03:07
hi, a have this situation in my console log:


******* script runtime error *******
cannot cast undefined to bool: (file 'maps/mp/gametypes/_name.gsc', line 120)
if(isSubStr(self.name, "^1^2"))
*
started from:
self waittill("menuresponse", menu, response);


server is running ok, script seems to work, is a "name protect" for admin openscr.. commands. but every time this message appear in console log, someone can help me?

filthy_freak_
17th February 2014, 04:01
Can't give you solid advice as you haven't posted any code (Read stickies before posting) but you can try placing;

if(!isDefined(self.name)) return;

Before

if(isSubStr(self.name, "^1^2"))

IzNoGoD
17th February 2014, 07:19
Might be the "disconnect" response that is messing with you. After a player disconnects you'd have no player but the script has triggered the waittill.