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)
+--- Thread: error 022: must be lvalue (non-constant) (
/showthread.php?tid=574949)
error 022: must be lvalue (non-constant) -
SandKing94 - 22.05.2015
Code:
Код:
if(pInfo[playerid][FactionRank] == 1) FactionRank = cache_get_field_content(0,"Rank 1");
Error:
Код:
error 022: must be lvalue (non-constant)
Re: error 022: must be lvalue (non-constant) -
Crystallize - 22.05.2015
Fail delete my post
Re: error 022: must be lvalue (non-constant) -
Dignity - 22.05.2015
https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content
That's not the way to use cache_get_field_content. This is:
pawn Код:
cache_get_field_content(row, field to pull data from, string to store data in);
Like so:
pawn Код:
if(pInfo[playerid][FactionRank] == 1) cache_get_field_content(0,"Rank 1", FactionRank);
Tell me if it solves your error.
Quote:
Originally Posted by Wizzard2H
Код:
if(pInfo[playerid][FactionRank] == 1) FactionRank == cache_get_field_content(0,"Rank 1");
Try this?
|
Not sure if trolling or serious. In case you're serious, read this:
https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Re: error 022: must be lvalue (non-constant) -
paul988 - 22.05.2015
This should work:
pawn Код:
if(pInfo[playerid][FactionRank] == 1) cache_get_field_content(0, "Rank 1", FactionRank);
Edit: Posted too late, nevermind.