[SOLVED]error 047: array sizes do not match, or destination array is too small
#1

The error line is on: PlayerInfo[playerid][pCodename] = result;

Code:
C:\Program Files\Rockstar Games\GTA San Andreas\samp\gamemodes\cwrp.pwn(27216) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Code:
if(strcmp(cmd, "/codename", true) == 0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 4)
  		{
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /codename [newname]");
				return 1;
			}
			format(string, sizeof(string), "%s", result);
	        PlayerInfo[playerid][pCodename] = result;       <------- THE ERROR IS HERE.
	        format(string, sizeof(string), "Codename changed to %s.", PlayerInfo[playerid][pCodename]);
			SendClientMessage(playerid, COLOR_GREY, string);
			return 1;
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
			return 1;
	 	}
	}
Reply
#2

Mark the line of error because i don't know where the error shows to
Reply
#3

Marked the error.
Reply
#4

Find:
new result[64];
and replace it with
new result[128];

all done
Reply
#5

problem solved, thanks eazy e.
Reply
#6

No Problemo
Reply
#7

I changed that 64 to 128 but still...


Code:
C:\Users\Villez\Desktop\Ultralightrp\gamemodes\HC-RP3.pwn(12676) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

Thanks Solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)