Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-24-2003 21:18
Im forming a little group of betaers for my products IW, and for security, I wanted the object to check against its owner to see if any of the keys I entered are the owner. If not, the object dies. Heres the code I used: key gDevKey = //my key key gCalsKey = //Cal Roger's Key
default { state_entry() { if(llGetOwner() != gDevKey | llGetOwner != gCalsKey) llDie(); } }
what is odd is that I created this object (btw, used same object), and I added an llSay(0,(string)llGetOwner()); in, and it gave the gDevKey, so therefore it shouldnt die. But it dies anyways. I also tryed this code: key gDevKey = //my key key gCalsKey = //Cal Roger's Key default { state_entry() { if(llGetOwner() == gDevKey | llGetOwner == gCalsKey) llDie(); } }
with (obviously) the same result. This is definately not intentional... ::yells:: Will someone please fix this?? -Chris
|
si Money
The nice demon.
Join date: 21 May 2003
Posts: 477
|
Re: ALERT Problem with llGetOwner() and conditional statement.
06-24-2003 21:20
From: someone Originally posted by Christopher Omega Im forming a little group of betaers for my products IW, and for security, I wanted the object to check against its owner to see if any of the keys I entered are the owner. If not, the object dies. Heres the code I used:
key gDevKey = //my key key gCalsKey = //Cal Roger's Key
default { state_entry() { if(llGetOwner() != gDevKey | llGetOwner != gCalsKey) llDie(); } }
what is odd is that I created this object (btw, used same object), and I added an llSay(0,(string)llGetOwner()); in, and it gave the gDevKey, so therefore it shouldnt die. But it dies anyways. I also tryed this code:
key gDevKey = //my key key gCalsKey = //Cal Roger's Key default { state_entry() { if(llGetOwner() == gDevKey | llGetOwner == gCalsKey) llDie(); } }
with (obviously) the same result.
This is definately not intentional...
::yells:: Will someone please fix this??
-Chris Err, well I haven't investigated LSL syntax to the extent where I can say this with authority, but don't you want ||, not |? You'd throw syntax errors in many languages using a single |
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-24-2003 21:27
Not sure, ill try that in a sec...
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-24-2003 21:28
nope, that didnt solve the problem eiather.
|
si Money
The nice demon.
Join date: 21 May 2003
Posts: 477
|
06-24-2003 21:39
From: someone Originally posted by Christopher Omega nope, that didnt solve the problem eiather. key myOwner = llGetOwner(); if ((myOwner != Key1) && (myOwner != Key2)) { llDie(); }
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-24-2003 22:14
hmm... but still.. shouldnt it work the other way? and I want it OR'ed not AND'ed lol. Ill try that method tho, ty si 
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-24-2003 22:19
oops... I was wrong... it shoulda been AND'ed. Ty si 
|