question about variables -
Tomejus - 22.11.2011
Is it possible to make this:
for example:
Enum[ vehicleid/playerid ][ variable ][ 1 ] = "string";
?
Because, if i do for example:
enum<...>
Name[ 5 ][ 10 ]; // it gives no errors, but not works the way it should work.
<..>
if i create a global variable like:
new Something[ 5 ][ 100 ]; it works perfectly, but with MAX_PLAYERS/MAX_VEHICLES it doesn't work, so is there any method to create it?
Re: question about variables -
Pharrel - 22.11.2011
pawn Код:
new Variable[MAX_PLAYERS][100 char];
then you can use...
pawn Код:
format(Variable[playerid], size, "string", ...);
Re: question about variables -
Tomejus - 22.11.2011
I meant not this, i mean that how (if its possible) to make that:
pawn Код:
format(Variable[playerid][ 0 ], size, "string", ...);
pawn Код:
format(Variable[playerid][ 1 ], size, "string", ...);
and so on...
Re: question about variables -
Pharrel - 22.11.2011
pawn Код:
new Variable[MAX_PLAYERS][NUMBER OF ARRAYS][100 char];
Re: question about variables -
JaTochNietDan - 22.11.2011
Add another dimension to your array?
For example:
pawn Код:
new variable[MAX_PLAYERS][10][128];
format(variable[playerid][0], 128, "string");
format(variable[playerid][1], 128, "string");
That's what you're looking for?
Edit: Woah, way too slow!
Re: question about variables -
Tomejus - 22.11.2011
Quote:
Originally Posted by Pharrel
pawn Код:
new Variable[MAX_PLAYERS][NUMBER OF ARRAYS][100 char];
|
Try'd, it gives no error, but works not how it should work. (If you format it - it gives a one letter of each format in others message, in case i have a photo:
Code:
pawn Код:
Format( myEnum[ playerid ][ BankOperation ][ 0 ], 8, "Nėra." ); // In english it means: N/A
Format( myEnum[ playerid ][ BankOperation ][ 1 ], 8, "Nėra." );
Format( myEnum[ playerid ][ BankOperation ][ 2 ], 8, "Nėra." );
Format( myEnum[ playerid ][ BankOperation ][ 3 ], 8, "Nėra." );
Format( myEnum[ playerid ][ BankOperation ][ 4 ], 8, "Nėra." );
how it looks in game:
http://www.part.lt/perziura/37ab4d80...7ffcb9f288.png
Re: question about variables -
JaTochNietDan - 22.11.2011
Now you're using it as a 4D array, he only showed you how to create a 3D array!
Although now ****** tells us that it's not possible, which I didn't know, although I did some small quick tests and it did work in the ways I tested it.
Re: question about variables -
Tomejus - 22.11.2011
Quote:
Originally Posted by JaTochNietDan
Now you're using it as a 4D array, he only showed you how to create a 3D array!
Although now ****** tells us that it's not possible, which I didn't know, although I did some small quick tests and it did work in the ways I tested it.
|
Oh, so only, 2d is possible in PAWN? Not even 3? : / sad.
Re: question about variables -
Tomejus - 22.11.2011
Sorry for double post, but i run a few tests too, and actually it works for me too (without enum).
pawn Код:
// TEST
new
myVeh[ MAX_VEHICLES ][ 4 ][ 256 ];
And the output was a good.
So thank you guys. you can close/delete theard.