Little problem with error 001
#1

pawn Код:
enum bInfo
{
  bOwned,
    bOwner[MAX_PLAYER_NAME],
    bMessage[128],
    Float:bEntranceX,
    Float:bEntranceY,
    Float:bEntranceZ,
    Float:bExitX,
    Float:bExitY,
    Float:bExitZ,
    bPrice,
    bSelling,
    bEntranceCost,
    bTill,
    bLocked,
    bInterior,
    bVirtualWorld,
    bProducts,
    bProductsBuying,
    bPriceProd,
    bEmployee[11][MAX_PLAYER_NAME], //C:\Documents and Settings\Sйbastien\Mes documents\GTA\samp02Xserver.win32\gamemodes\BCL-RP.pwn(259) : error 001: expected token: "}", but found "["
    bEmployees
}; new BizInfo[MAX_BIZ][bInfo];
Any suggestion?
Reply
#2

Huh? Where's the problem?
Didn't notice that the code is rolled-able.
Where do you use this variable?
Reply
#3

Quote:
Originally Posted by MenaceX^
Huh? Where's the problem?
Didn't notice that the code is rolled-able.
Where do you use this variable?
Nowhere atm, I'm trying to make it work first..
Reply
#4

I don't think you can put arrays into enums, but I've never tried it first hand so I don't know.
Reply
#5

Код:
bEmployee[11][MAX_PLAYER_NAME]
Yes,it does not work.
PAWN only supports 3-size array.
Enum supports 1, due to pevent
this happen:
Код:
enum enumt{
  enumt_test[10]
};
new test[10][enumt][10];
//test[0][enumt_test][0][0] 
//It's 4-size array now.
plz read pawn_lang.pdf before scripting by PAWN
Reply
#6

Код:
solution:
enum et{
  et_t[11]//store the id
};
new et_a[10][et_t];
new etname[11][MAX_PLAYER_NAME];

//use etname[et_a[et_t][10]]
PS:cannot modtify my reply, strange : (
Reply
#7

If your code would work it would be
BizInfo[bID][[id[name]]] lol
Reply
#8

Quote:
Originally Posted by Lavamike
I don't think you can put arrays into enums, but I've never tried it first hand so I don't know.
Sure it does support. But it doesn't support 3 arrays.
Reply
#9

Ok thanks
Reply
#10

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by Lavamike
I don't think you can put arrays into enums, but I've never tried it first hand so I don't know.
Sure it does support. But it doesn't support 3 arrays.
Lies. I have this, and it works:

pawn Код:
enum PlayerInfo
{
  Array[64]
}

new Player[MAX_PLAYERS][PlayerInfo];
And I can do this:

pawn Код:
format(Player[playerid][Array], 64, "Hello!");
Notice I can't use sizeof(), don't know why, never really investigated it. But you can do 3-deep arrays, never pushed it any further though.

Note: This will also work:

pawn Код:
Player[playerid][Array][0] = 5;
Player[playerid][Array][5] = 10;
// etc etc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)