Page 1 of 1

hmm...whats wrong with it...

Posted: Sun May 10, 2009 2:18 pm
by zaroba

Code: Select all

Event( "OSDSelect", "lotto:check" )
	{
	If ($playervar20 > $gservervar20)
		{
		*msg %player% The lotto numbers have not yet been drawn
		}
	else if ($playervar20 = $gservervar20)
		{
		If ($playervar22=1)
			{
			$playervar22=0
			}
		Else If ($playervar26=1)
			{
			$playervar26=0
			}
		Else If ($playervar30=1)
			{
			$playervar30=0
			}
		Else If ($playervar34=1)
			{
			$playervar34=0
			}
		Else If ($playervar38=1)
			{
			$playervar38=0
			}
		Else
			{
			*msg %player% no more tickets to check
			}
		}
	else if ($playervar20 = 0)
		{
		*msg %player% You havn't bought any lottery tickets!
		}
	else 
		{
		*msg %player% sorry, your tickets for lottery number $playervar20 have expired, the current lottery number is $gservervar20
		*msg %player% if you wish to check old tickets, please contact zaroba.
		}
	}
before the script is run, playervar20 = 5, gservervar20 = 4
playervars 22, 26, 30, 34, and 38 = 1

the problem is, when the script is run, it posts the message for playervar20 being bigger then gservervar20, then playervars 30, 34, and 38 get reset to zero
despite the line telling it to only run if playervar20 is the same as gservervar20
[/code]

Image

Posted: Sun May 10, 2009 4:39 pm
by zaroba
removed the else if ($playervar20 = 0) part and now its working fine.
no clue how that would have effected it though