SA-MP Forums Archive
must be lvalue (non-constant) - 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: must be lvalue (non-constant) (/showthread.php?tid=585950)



must be lvalue (non-constant) - alexanderjb918 - 18.08.2015

Код:
CMD:stats(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new
			string[ 128 ],
			Age = PlayerInfo[ playerid ][ pAge ],
			Money = GetPlayerCash( playerid )
		;

		new Sex[20];
		new Faction[20];
	    if(PlayerInfo[ playerid ][ pFaction ] == 1) { Faction = "LSPD"; }
		if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Male"; }
		else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Female"; }

		SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
		format(string, sizeof(string), "Name: %s | Money: %d | Age: %d | Sex: %s", RPName(playerid), Money, Age, Sex);
		SendClientMessage(playerid, COLOR_GRAD2, string);
	}
	return 1;
}
Any idea whats wrong? the error is on line


Код:
if(PlayerInfo[ playerid ][ pFaction ] == 1) { Faction = "LSPD"; }



Re: must be lvalue (non-constant) - alexanderjb918 - 18.08.2015

nvm fixed.