SA-MP Forums Archive
Problem on possibly unintended assignment... - 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: Problem on possibly unintended assignment... (/showthread.php?tid=150717)



Problem on possibly unintended assignment... - woaha - 27.05.2010

I don't see any problem on this code, but it still says:

warning 211: possibly unintended assignment, line if (answr = "No")
error 006: must be assigned to an array, line if (answr = "No")
warning 204: symbol is assigned a value that is never used: "answr", lol? I am dunno about this..

Код:
	// Lisence driving... part 3
	if(dialogid == 1+1)
	{
		if(response)
		{
			if(listitem == 0)
			{
			new answr = strval(inputtext);
			if (answr = "No")
			{
			CarSchool[playerid] = CarSchool[playerid]+1;
			}
			}
			if(listitem == 1)
			{
			}
		}
		return 1;
	}



Re: Problem on possibly unintended assignment... - MummyKillerSLO - 27.05.2010

You converted string to integer and then compare this integer to string... This cant work... I made new example.
Код:
	// Lisence driving... part 3
	if(dialogid == 1+1)
	{
		if(response)
		{
			if(listitem == 0)
			{
			if (!strcmp(inputtext,"No",true))
			{
			CarSchool[playerid] = CarSchool[playerid]+1;
			}
			}
			if(listitem == 1)
			{
			}
		}
		return 1;
	}



Re: Problem on possibly unintended assignment... - woaha - 27.05.2010

Quote:
Originally Posted by MummyKillerSLO
You converted string to integer and then compare this integer to string... This cant work... I made new example.
Oh yeah of coarse
Thanks.