Array sizes do not match
#1

Hi, I'm making a gamemode right now, but I stumbled across two errors right now.
They are:
Код:
(158) : error 047: array sizes do not match, or destination array is too small
(159) : error 047: array sizes do not match, or destination array is too small
Lines 158 and 159:
Код:
PlayerInfo[playerid][pBannedBy] = "None";
PlayerInfo[playerid][pBanReason] = "None";
This is what I got in the enum:
Код:
pBannedBy[MAX_PLAYER_NAME],
pBanReason[32],
What's wrong with it?
Reply
#2

try

format(PlayerInfo[playerid][pBannedBy],MAX_PLAYER_NAME,"None");
format(PlayerInfo[playerid][pBanReason],MAX_PLAYER_NAME,"None");
Reply
#3

Use format:

PHP код:
format(PlayerInfo[playerid][pBannedBy],MAX_PLAYER_NAME,"None");
format(PlayerInfo[playerid][pBanReason],32,"None"); 
Reply
#4

Thanks, I knew that before, but I thought that there's something wrong with my code because sometimes the way I did first worked with other strings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)