Enum with two dimensional string
#4

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
MemberName[sizeof_hStorage
That's a string, if you format it like for example
"Message", it has 7 letters, so MemberName[0], MemberName[1], .......... MemberName[6] would be occupied by the letters of "Message".

And the thing explained in the thread is 2-dimensional arrays in enum, but your's is 1 dimensional.

MemberName[0][0] <- 2 dimensional
MemberName[0] <- 1 dimensional

You can use the 2 dimensional as this
PHP код:
CMD:name(playerid)
{
format(GroupInfo[21][MemberName][6][0], MAX_PLAYER_NAME"Message");
return 
1;
}
CMD:pr(playerid)
{
for(new 
g=0g<20g++)
 {
 new 
string[64];
 
format(stringsizeof(string), "%s"GroupInfo[21][MemberName][g][0]);
 
SendClientMessage(playerid, -1string);
 }
return 
1;

Another thing to change is
PHP код:
#define hStorage][%1][%2] hStorage][((%1)*hStorage_size2)+(%2)] 
to
PHP код:
#define MemberName][%1][%2] MemberName][((%1)*hStorage_size2)+(%2)] 
Understood?
I do not necessarily want 2-dimensional arrays in enum, I just want string array in enum and I thought that I could do that with 2 dimensional array I cant do it like this
enum Data
{
MemberName[20][MAX_PLAYER_NAME]
};
because it brings me error
Reply


Messages In This Thread
Enum with two dimensional string - by ax1 - 15.10.2017, 10:05
Re: Enum with two dimensional string - by ax1 - 17.10.2017, 12:46
Re: Enum with two dimensional string - by StrikerZ - 17.10.2017, 12:52
Re: Enum with two dimensional string - by ax1 - 17.10.2017, 17:04
Re: Enum with two dimensional string - by ax1 - 18.10.2017, 13:18
Re: Enum with two dimensional string - by StrikerZ - 18.10.2017, 13:49
Re: Enum with two dimensional string - by ax1 - 18.10.2017, 19:53
Re: Enum with two dimensional string - by Mauzen - 18.10.2017, 20:10
Re: Enum with two dimensional string - by ax1 - 19.10.2017, 11:30

Forum Jump:


Users browsing this thread: 1 Guest(s)