error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" - 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 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" (
/showthread.php?tid=654741)
error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" -
BanSilog - 04.06.2018
Код:
enum PlayerInfo
{
Pass[129],
Adminlevel,
VIPlevel,
Money,
Scores,
Kills,
Duty,
Deaths
Код:
format(str,sizeof(str),"%s has kicked %s for %s.",(PlayerInfo[playerid]pName,PlayerInfo[id]pName,reason);
i get this error
Код:
error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
error 029: invalid expression, assumed zero
error 076: syntax error in the expression, or invalid function call
fatal error 107: too many error messages on one line
Re: error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" -
altunatively - 04.06.2018
Have you use 'new' for it? like this
Код:
enum pInfo //change it from PlayerInfo, cause we use PlayerInfo in 'new'
{
Pass[129],
Adminlevel,
VIPlevel,
Money,
Scores,
Kills,
Duty,
Deaths,
pName[MAX_PLAYER_NAME] //add this, otherwise it will return error too
}
new PlayerInfo[MAX_PLAYERS][pInfo];//Declaring it from pInfo enum, MAX_PLAYERS declare the ID
And you didnt declare 'pName' in the enum, it will be an error too.
Код:
format(str,sizeof(str),"%s has kicked %s for %s.", PlayerInfo[playerid][pName], PlayerInfo[id][pName] , reason);
Correct me if i'm wrong