Little help here ?
#1

Hello, I have a little problem here with the division names. Here's the whole code.

Код:
CMD:adjustdivisionname(playerid, params[])
{
	new division, name[8], string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) || !PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD faction leader.");
	if(sscanf(params, "is[32]", division, name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustdivisionname [division] [name]");
	switch(division)
	{
	    case 1:
	    {
	        FacInfo[1][fDiv1] = name;
	        format(string, sizeof(string), "You have set division 1's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 2:
	    {
	        FacInfo[1][fDiv2] = name;
	        format(string, sizeof(string), "You have set division 2's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 3:
	    {
	        FacInfo[1][fDiv3] = name;
	        format(string, sizeof(string), "You have set division 3's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 4:
	    {
	        FacInfo[1][fDiv4] = name;
	        format(string, sizeof(string), "You have set division 4's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	}
	return 1;
}
I want to make the division names lenght longer than 8 characters, but everytime I try to make the "name" longer, or shorter (ex: new division, name[32], string[128]; ), I get this error:

Код:
 error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Error lines: FacInfo[1][fDiv1] = name; , FacInfo[1][fDiv2] = name; FacInfo[1][fDiv3] = name; FacInfo[1][fDiv4] = name;
So, the question is - how to make the divisions " name " longer? Everyone who atleast tries to help will be +Repped, thanks in advance.
Reply


Messages In This Thread
Little help here ? - by Dizzle - 09.07.2015, 19:54
Re: Little help here ? - by liquor - 09.07.2015, 19:59
Re: Little help here ? - by Dizzle - 09.07.2015, 20:10
Re: Little help here ? - by liquor - 09.07.2015, 20:17
Re: Little help here ? - by Dizzle - 09.07.2015, 20:26
Re: Little help here ? - by liquor - 09.07.2015, 20:31

Forum Jump:


Users browsing this thread: 1 Guest(s)