SA-MP Forums Archive
Y_INI Stats Command Errors - 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: Y_INI Stats Command Errors (/showthread.php?tid=507918)



Y_INI Stats Command Errors - NoahF - 19.04.2014

Hello!!

For some reason when I compile my script, it gives me these errors:

Код:
C:\Users\X\Desktop\X\gamemodes\X.pwn(530) : error 022: must be lvalue (non-constant)
C:\Users\X\Desktop\X\gamemodes\X.pwn(530) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\X\Desktop\X\gamemodes\X.pwn(530) : warning 215: expression has no effect
C:\Users\X\Desktop\X\gamemodes\X.pwn(530) : error 001: expected token: ";", but found "]"
C:\Users\X\Desktop\X\gamemodes\X.pwn(530) : fatal error 107: too many error messages on one line
Код:
Line 530: Adminlevel = PlayerInfo[playerid][Adminlevel];
Here is the whole Stats command:

Код:
CMD:stats(playerid, params[])
{
	new sString[128];
  	Adminlevel = PlayerInfo[playerid][Adminlevel];
   	money = PlayerInfo[playerid][Money];
    score = PlayerInfo[playerid][Score];
    deaths = PlayerInfo[playerid][Deaths];
    kills = PlayerInfo[playerid][Kills];

	format(sString,sizeof(sString), "Admin Level: %d | Money: %d | Score: %d | Deaths: %d  | Kills: %d", Adminlevel, money, score, deaths, kills);
 	SendClientMessage(playerid, COLOR_ORANGE, sString);
	return 1;
}
Here's the PlayerInfo enum:

Код:
enum PlayerInfo
{
    Pass[129], //User's password
    Adminlevel, //User's admin level
    Money, //User's money
    Score, //User's scores
    Kills, //User's kills
    Deaths //User's deaths
}
I am using Y_INI.


Re: Y_INI Stats Command Errors - NoahF - 19.04.2014

o_O I was following a tutorial and this is what it said.. But thanks, I'll look into it further.