SA-MP Forums Archive
error 029: invalid expression, assumed zero - 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)
+--- Thread: error 029: invalid expression, assumed zero (/showthread.php?tid=597980)



error 029: invalid expression, assumed zero - Shura - 07.01.2016

Код:
else
	{
		if(PlayerData[playerid][pFactionDuty] && GetPlayerFactionType(playerid) == FAC_TYPE_MEDIC)
		{
        	COLOR_TEMP = 0xDC6A78FF;
		}
		else
		{
	    	COLOR_TEMP = COLOR_WHITE;
	    }
	}
else // This is where the only mistake I strip
	{
		if(PlayerData[playerid][pFactionDuty] && GetPlayerFactionType(playerid) == FAC_TYPE_POLICE)
		{
        	COLOR_TEMP = 0x2288FFFF;
		}
		else
		{
	    	COLOR_TEMP = COLOR_WHITE;
	    }
	}



Re: error 029: invalid expression, assumed zero - FreAkeD - 07.01.2016

else checks if something has failed, so pretty much you are checking if something has failed twice.

https://sampwiki.blast.hk/wiki/Control_Structures#else


Re: error 029: invalid expression, assumed zero - HarrisonC - 07.01.2016

Quote:
Originally Posted by Shura
Посмотреть сообщение
Код:
else if(PlayerData[playerid][pFactionDuty] && GetPlayerFactionType(playerid) == FAC_TYPE_MEDIC)
{
	COLOR_TEMP = 0xDC6A78FF;
}
else if(PlayerData[playerid][pFactionDuty] && GetPlayerFactionType(playerid) == FAC_TYPE_POLICE)
{
	COLOR_TEMP = 0x2288FFFF;
}
else
{
	COLOR_TEMP = COLOR_WHITE;
}
This will fix your problem and looks nicer
Rep me if this helped you, thanks!