SA-MP Forums Archive
error 022: 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 022: must be lvalue (non-constant) (/showthread.php?tid=173779)



error 022: must be lvalue (non-constant) - DiddyBop - 03.09.2010

Getting error...

pawn Code:
{
                new Float:weed;
                GetPVarFloat(playerid, "druglvls") = High; //this line gives error
            }
There is more to the script, but thats not causing errors.

It gives error "error 022: must be lvalue (non-constant)" And warning "warning 215: expression has no effect"


Re: error 022: must be lvalue (non-constant) - Vince - 03.09.2010

Switch the two. You want to assign a value to high, not the the other way round.
pawn Code:
High = GetPVarFloat(playerid, "druglvls");



Re: error 022: must be lvalue (non-constant) - LarzI - 03.09.2010

Show the definition of "High"

[This forum requires that you wait 120 seconds between posts. Please try again in 64 seconds.] stfu

EDIT: OMG I'm tired! Hahaha, epic fail by me..


Re: error 022: must be lvalue (non-constant) - DiddyBop - 03.09.2010

Quote:
Originally Posted by Vince
View Post
Switch the two. You want to assign a value to high, not the the other way round.
pawn Code:
High = GetPVarFloat(playerid, "druglvls");
ahh stupid ass me, Thanks man.