Help, error 047
#1

Good evening everyone , well ... my mistake is this:

Код:
C:\Users\Crouse\Documents\ZZ\ZZ\gamemodes\ZZ-RP.pwn(11570) : error 047: array sizes do not match, or destination array is too small
C:\Users\Crouse\Documents\ZZ\ZZ\gamemodes\ZZ-RP.pwn(11573) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Line:
Код:
      			else if(cuenta[i][cAdministrador] == 2013){ admtext = "{FA8258}Encargado de Staff"; }
	        	else if(cuenta[i][cAdministrador] == 2012){ admtext = "{FF0000}Administrador"; }
				else if(cuenta[i][cAdministrador] == 6){ admtext = "{FE2E2E}Co-Admin"; }
				else if(cuenta[i][cAdministrador] == 5)	{ admtext = "{0000FF}Moderador Global"; }
What I try to change in these lines are the colors of the Administrative Names, since they are blank, and I add the colors {}, but when compiling I skip that error.

Complete code:
Код:
    command(admins, playerid, params[]){

        Mensaje(playerid, COLOR_GRIS2, "| Staff de PlazeWorld |");
		for(new i=0, t=GetMaxPlayers();i<t;i++){
		    if(IsPlayerConnected(i)){
		        if(cuenta[i][cAdministrador] >= 1 && cuenta[i][cAdministrador] <= 2014){
      			new string[128], admtext[24];
      			if(cuenta[i][cAdministrador] == 2014){ admtext = "{AC58FA}Dueсo"; }
      			else if(cuenta[i][cAdministrador] == 2013){ admtext = "{FA8258}Encargado de Staff"; }
	        	else if(cuenta[i][cAdministrador] == 2012){ admtext = "{FF0000}Administrador"; }
				else if(cuenta[i][cAdministrador] == 6){ admtext = "{FE2E2E}Co-Admin"; }
				else if(cuenta[i][cAdministrador] == 5)	{ admtext = "{0000FF}Moderador Global"; }
				else if(cuenta[i][cAdministrador] == 4)	{ admtext = "Administrador"; }
				else if(cuenta[i][cAdministrador] == 3)	{ admtext = "Admin Junior"; }
				else if(cuenta[i][cAdministrador] == 2)	{ admtext = "Moderador"; }
				else if(cuenta[i][cAdministrador] == 1)	{ admtext = "Ayudante"; }
				if(!booleano[AdminDuty]{i}){
					format(string, sizeof(string), "  %s - %s", admtext, PlayerName(i));
					Mensaje(playerid, COLOR_BLANCO, string);
				}
					else{
						format(string, sizeof(string), "{008B00}(En servicio){FFFFFF} %s - %s [%d]", admtext, PlayerName(i), i);
						Mensaje(playerid, COLOR_BLANCO, string);
					}
				}
			}
		}
	    return 1;
    }
Reply
#2

PHP код:
new admtext[28]; 
Reply
#3

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
new admtext[128]; 
The size of that array at most needs to be 26 long, and I'm including the colour formatting length. There is no necessity for the other 106 allocated, however unused.
Reply
#4

Hahaha. Big mistake, I was going to put a length of 28, and I put the 1 unintentionally. Sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)