error 028: invalid subscript (not an array or too many subscripts):
#1

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;
}
Reply
#2

Show us how do you create "pPoziciaX","pPoziciaY" and "pPoziciaZ" variables.
Reply
#3

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.
Reply
#4

I want to see the line that will look SOMETHING like this: new something[MAX_PLAYERS][pInformacie];
Reply
#5

Eh, i guess this one.
pawn Код:
new Informacie[MAX_PLAYERS][pInformacie];
Reply
#6

Yes, it is!

Change this
pawn Код:
pPoziciaX[playerid]
To this
pawn Код:
Informacie[playerid][pPozicijaX]
Reply
#7

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerPos(playerid, Informacie[playerid][pPoziciaX], Informacie[playerid][pPoziciaY], Informacie[playerid][pPoziciaZ]);
// .....
return 1;
}
Reply
#8

Where?
Reply
#9

on your OnPlayerDisconnect callback
Reply
#10

Okay, solved.
Ty guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)