SA-MP Forums Archive
Few errors - Please read - 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: Few errors - Please read (/showthread.php?tid=419925)



Few errors - Please read - RedWingz - 02.03.2013

pawn Код:
public OnPlayerSpawn(playerid)
{
    new filo[55];
    format(filo,55,"org%d.ini",Member[playerid]);
    SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")));
    return 1;
}
Errors:

error 028: invalid subscript (not an array or too many subscripts): "Member"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Any help? Thanks.


Re: Few errors - Please read - AndreT - 02.03.2013

It seems that the error is once again, quite quite quite straightforward - your declaration of the "Member" array does not conform to how you wish to use it.

Please show how it is declared. It should be an array like this:
pawn Код:
new Member[MAX_PLAYERS];



Re: Few errors - Please read - RedWingz - 02.03.2013

I've just added that, and it just gave me 26 errors.


ERRORS - Please read! ;( - RedWingz - 02.03.2013

Here's the problem...

pawn Код:
public OnPlayerConnect(playerid)
{
        if(PlayerInfo[playerid][pMember] = -255;
    if(PlayerInfo[playerid][pLeader] = 0;
    request[playerid] = -255;
    format(file, sizeof(file), "%s.ini",GetPlayerName(playerid,name,sizeof(name)));
    if(PlayerInfo[playerid][pMember] = dini_Int(file,"Member"); //Get saved file
    if(PlayerInfo[playerid][pLeader] = dini_Int(file,"Leader"); //Get saved file
    return 1;
}
This is the line that's giving the 3-5 errors:
pawn Код:
if(PlayerInfo[playerid][pMember] = -255;
Main Error: error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"


Re: Few errors - Please read - RedWingz - 02.03.2013

Sorry for bumping this, But I really need help ;(


Re: Few errors - Please read - Jstylezzz - 02.03.2013

Do you have the enum PlayerInfo in your mode?
something like this:

pawn Код:
enum PlayerInformation
{
Money,
Admin
}
new PlayerInfo[MAX_PLAYERS][PlayerInformation];
You should have something like that somewhere, if not, create it


Re: Few errors - Please read - RedWingz - 02.03.2013

It's in a seperate filterscript, It's not in my game mode...
And adding that just gives me another error...
It's something to do with PlayerInfo


Re: Few errors - Please read - Jstylezzz - 02.03.2013

You can't use the PlayerInfo stuff outside of your gamemode, unless you make a function to exchange those values cross script.
Isn't there any way you can do this in your gamemode? These things should compile fine in your gamemode, if you have the enum.


Re: Few errors - Please read - RedWingz - 02.03.2013

Yea, I tried, But when It came to coverting to Dini.. I'm not that good.


Re: Few errors - Please read - Jstylezzz - 03.03.2013

Then try creating the enum in the filterscript, it won't work without it, or you have to change the code..