SA-MP Forums Archive
I get a little error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I get a little error (/showthread.php?tid=186909)



I get a little error - karakana7 - 31.10.2010

Error:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(77) : error 029: invalid expression, assumed zero
And this is the line:
Код:
      
                else
  		{
   		       dini_IntSet(file, "Logged", 1);
	    		Zaidejas[playerid][Logged] = 1;
	    		Zaidejas[playerid][Level] = dini_Int(file,"Level");
	    		SendClientMessage(playerid, 0xFFFFFFFF, "Dabar tu esi prisijunges!");
	    		return 1;
		}
	        else //this is line 77
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "Rasyk /register [pass]");
			return 1;
		}
	}



Re: I get a little error - karakana7 - 31.10.2010

So can someone help or everyone are sleeping right now?!


Re: I get a little error - Babul - 31.10.2010

you are using 2x else w/o any check behind.
the "empty" else statement is supposed to work ONCE only. you are ttrying to use 2.
i got 2 solutions:
either you add something like
Код:
else if (condition==2)
or simply remove the second else (line 77) and see what will happen.
the basic if-else if-else should work like this:
Код:
if (condition==0){condition1fits;}
else if (condition==1){condition1failed;}
else {nomatchesatall;}