error 028: invalid subscript (not an array or too many subscripts): -
Riwerry - 02.11.2013
Hello guys, can somebody help me to fix this error? Thanks.
error 028: invalid subscript (not an array or too many subscripts):
pawn Код:
public OnPlayerDisconnect( playerid, reason )
{
GetPlayerPos( playerid, pPoziciaX[ playerid ], pPoziciaY[ playerid ], pPoziciaZ[ playerid ] ); //THIS IS ERROR
GetPlayerFacingAngle( playerid, Angle[ playerid ] );
new INI:File = INI_Open( PouzivatelovaCesta(playerid));
INI_WriteInt(File,"AdminLevel",Informacie[playerid][pAdminLevel]);
INI_WriteInt(File,"Interiйr", GetPlayerInterior(playerid));
INI_WriteInt(File,"Peniaze",GetPlayerMoney(playerid));
INI_WriteFloat(File,"PozнciaX", pPoziciaX[playerid]);
INI_WriteFloat(File,"PozнciaY", pPoziciaY[playerid]);
INI_WriteFloat(File,"PozнciaZ", pPoziciaZ[playerid]);
INI_WriteInt(File,"Svet", GetPlayerVirtualWorld( playerid ));
INI_WriteFloat(File,"Uhol", pUhol[playerid]);
INI_Close(File);
return 1;
}
Re: error 028: invalid subscript (not an array or too many subscripts): -
dusk - 02.11.2013
Show us how do you create "pPoziciaX","pPoziciaY" and "pPoziciaZ" variables.
Re: error 028: invalid subscript (not an array or too many subscripts): -
Riwerry - 02.11.2013
pawn Код:
enum pInformacie
{
pAdminLevel,
pHeslo[129],
pInterier,
pPeniaze,
Float:pPoziciaX,
Float:pPoziciaY,
Float:pPoziciaZ,
pSvet,
Float:pUhol
}
Or this, not sure what you want
pawn Код:
INI_WriteFloat(File,"PozнciaX", pPoziciaX[playerid][pPoziciaX]);
INI_WriteFloat(File,"PozнciaY", pPoziciaY[playerid][pPoziciaY]);
INI_WriteFloat(File,"PozнciaZ", pPoziciaZ[playerid][pPoziciaZ]);
But i guess problem is in these 3, i don't know correct form.
Re: error 028: invalid subscript (not an array or too many subscripts): -
dusk - 02.11.2013
I want to see the line that will look SOMETHING like this: new something[MAX_PLAYERS][pInformacie];
Re: error 028: invalid subscript (not an array or too many subscripts): -
Riwerry - 02.11.2013
Eh, i guess this one.
pawn Код:
new Informacie[MAX_PLAYERS][pInformacie];
Re: error 028: invalid subscript (not an array or too many subscripts): -
dusk - 02.11.2013
Yes, it is!
Change this
To this
pawn Код:
Informacie[playerid][pPozicijaX]
Re: error 028: invalid subscript (not an array or too many subscripts): -
Aliassassin123456 - 02.11.2013
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerPos(playerid, Informacie[playerid][pPoziciaX], Informacie[playerid][pPoziciaY], Informacie[playerid][pPoziciaZ]);
// .....
return 1;
}
Re: error 028: invalid subscript (not an array or too many subscripts): -
Riwerry - 02.11.2013
Where?
Re: error 028: invalid subscript (not an array or too many subscripts): -
Aliassassin123456 - 02.11.2013
on your OnPlayerDisconnect callback
Re: error 028: invalid subscript (not an array or too many subscripts): -
Riwerry - 02.11.2013
Okay, solved.
Ty guys.