09.07.2015, 19:54
Hello, I have a little problem here with the division names. Here's the whole code.
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:
So, the question is - how to make the divisions " name " longer? Everyone who atleast tries to help will be +Repped, thanks in advance.
Код:
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; }
Код:
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;