delete me - 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)
+--- Thread: delete me (
/showthread.php?tid=615874)
delete me -
DarrenReeder - 28.08.2016
delete
Re: Formatting an enum string? -
Luis- - 28.08.2016
Код:
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.
Re: delete me -
Gammix - 28.08.2016
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);
Re: delete me -
DeeadPool - 28.08.2016
Create a string for it.
Ex:-
PHP код:
new String[128];
format(String, sizeof(String), "%s", FactionInfo[1][fName]);
SendClientMessage(playerid, -1, String); //whatever
Re: delete me -
Konstantinos - 28.08.2016
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 Код:
printf("%i %i %i", sizeof _array2, sizeof _array2[], sizeof _array2[][]);