Page 1 of 1

issue with using 'and' statement

Posted: Sat Jan 15, 2011 10:56 pm
by lisa
This is no doubt purely an issue with how I am trying to use it but I just can't seem to get the code to work.

This code sets player.Class2 == CLASS_SCOUT even though there is no class2 yet. So amu will only = 1 if second class is set to scout.

Code: Select all

if  _charclass2answer == "2" then
		_charclass2 = "_scout"
		mpuser2 = "1"
		amu = "1"
end
Next code always returns mpuser = 99, never makes it = 0

Code: Select all

if player.Class1 == CLASS_ROGUE and mpuser2 == "1" then mpuser = "0" else mpuser = "99" end
but the following code works perfectly

Code: Select all

if player.Class1 == CLASS_SCOUT or amu == "1" then buyarrows = "2" else buyarrows = "0" end
Only difference is the usage of 'and' and 'or'

Re: issue with using 'and' statement

Posted: Sat Jan 15, 2011 11:52 pm
by Administrator
I think part of your problem is that you're using strings to compare numbers. Why are you putting those integers in quotes?

Re: issue with using 'and' statement

Posted: Sun Jan 16, 2011 12:01 am
by lisa
that would explain it, numbers = no "" , otherstuff = "" lol
Only been at this coding stuff 3-4 weeks =)


Works perfectly now, ty