W00t, what's the problem ? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: W00t, what's the problem ? (
/showthread.php?tid=105006)
W00t, what's the problem ? -
Dreftas - 27.10.2009
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 ?
Re: W00t, what's the problem ? -
Dabombber - 27.10.2009
should be
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]);
}
Re: W00t, what's the problem ? -
Dreftas - 27.10.2009
Thx a lot, you're god !