W00t, what's the problem ?
#1

pawn Код:
new Fishes[][] =
{
    // name, cost //
    {"Akar betta", "300"},
    {"Asian Arowana", "250"},
    {"Amiets Lyretail", "145"},
    {"Badis", "250"}
};
I made some test function:
pawn Код:
for(new vc=0; vc<sizeof(Fishes); vc++) {
    printf("%s cost %s$",Fishes[vc][0],Fishes[vc][1]);
}
And it prints this>>
Код:
[15:08:36] Akar betta cost kar betta$
[15:08:36] Asian Arowana cost sian Arowana$
[15:08:36] Amiets Lyretail cost miets Lyretail$
[15:08:36] Badis cost adis$
I've never before had problem with this, my /slap working in same way, but it works fine o_O What i did wrong ?
Reply
#2

pawn Код:
new Fishes[][] =
should be
pawn Код:
new Fishes[][][] =
using enumerations would be easier though

pawn Код:
#define MAX_FISH_NAME   20

enum E_FISH {
    E_FISH_NAME[MAX_FISH_NAME],
    E_FISH_COST
}
new Fishes[][E_FISH] =
{
    // name, cost //
    {"Akar betta", 300},
    {"Asian Arowana", 250},
    {"Amiets Lyretail", 145},
    {"Badis", 250}
};

for(new vc; vc < sizeof(Fishes); vc++) {
    printf("%s cost $%i", Fishes[vc][E_FISH_NAME], Fishes[vc][E_FISH_COST]);
}
Reply
#3

Thx a lot, you're god !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)