Enum with two dimensional string
#1

Код:
const hStorage_size1 = 20; // amount of members
const hStorage_size2 = MAX_PLAYER_NAME; // player name size
const sizeof_hStorage = hStorage_size1 * hStorage_size2;

enum Data
{
MemberName[sizeof_hStorage],
};
new GroupInfo[1000][Data];
#define hStorage][%1][%2] hStorage][((%1)*hStorage_size2)+(%2)]

CMD:name(playerid)
{
format(GroupInfo[21][MemberName][0], MAX_PLAYER_NAME, "Message");
return 1;
}

CMD:pr(playerid)
{
for(new g=0; g<20; g++)
 {
 new string[64];
 format(string, sizeof(string), "%s", GroupInfo[21][MemberName][g]);
 SendClientMessage(playerid, -1, string);
 }
return 1;
}
this is what I get after typing /name and /pr

Код:
[12:55:01] Message

[12:55:01] essage

[12:55:01] ssage

[12:55:01] sage

[12:55:01] age

[12:55:01] ge

[12:55:01] e

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01] 

[12:55:01]
anyone know where the problem is? GroupInfo[21][MemberName][1] should be " ", but instead it's "essage"

I did this according to this tutorial https://sampforum.blast.hk/showthread.php?tid=373107
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)