delete me
#1

delete
Reply
#2

Код:
format(FactionInfo[1][fName], 30, "%s", dest);
You cannot get the sizeof FactionInfo[1][fName] as far as I know. Just gotta put in the current size that you put in the enum.
Reply
#3

For some reasons you cannot get the size of 2D+ arrays;

Replace "sizeof(FactionInfo[1][fName])" with "30" accordingly to the original size. You can use macros if you want an alternative.

pawn Код:
#define MAX_FACTION_NAME 30
format(FactionInfo[1][fName], MAX_FACTION_NAME, "%s", dest);
Reply
#4

Create a string for it.

Ex:-
PHP код:
new String[128];
format(Stringsizeof(String), "%s"FactionInfo[1][fName]);
SendClientMessage(playerid, -1String); //whatever 
Reply
#5

Quote:
Originally Posted by Gammix
Посмотреть сообщение
For some reasons you cannot get the size of 2D+ arrays;
The correct would be that we cannot use sizeof for taking the size of an array inside an enumerator.

You can still get the size though with a different (tricky) way:
pawn Код:
enum _e
{
    _integer,
    _string[24],
    Float: _float
};
new _array[15][_e];
pawn Код:
printf("size of _string is %i", _e: _float - _e: _string);
and you can also get the size for 2D+ normal arrays:
pawn Код:
new _array2[10][20][30];
pawn Код:
printf("%i %i %i", sizeof _array2, sizeof _array2[], sizeof _array2[][]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)