Array too small or w/e :P
#1

Can someone help me with this?

pawn Код:
new faction = PlayerInfo[FactionOffer[playerid]][pLeader], ftext[256];
                            if(faction == 1) { ftext = FactionInfo[1][FactionName]; }
                            else if(faction == 2) { ftext = FactionInfo[2][FactionName]; }
                            else if(faction == 3) { ftext = FactionInfo[3][FactionName]; }
                            else if(faction == 4) { ftext = FactionInfo[4][FactionName]; }
                            else if(faction == 5) { ftext = FactionInfo[5][FactionName]; }
                            else if(faction == 6) { ftext = FactionInfo[6][FactionName]; }
                            else if(faction == 7) { ftext = FactionInfo[7][FactionName]; }
                            else if(faction == 8) { ftext = FactionInfo[8][FactionName]; }
                            else if(faction == 9) { ftext = FactionInfo[9][FactionName]; }
                            else if(faction == 10) { ftext = FactionInfo[10][FactionName]; }

format(string, sizeof(string), "* You have accepted %s's request to join the %s, you are now a Member of it.", giveplayer, ftext);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            //format(ftext,sizeof(ftext),"* %s has accepted your request and is now a Member of the %s.", sendername, GetPlayerFactionName(giveplayer));
                            format(string, sizeof(string), "* %s has accepted your request and is now a Member of the %s.", sendername, ftext);
                            SendClientMessage(FactionOffer[playerid], COLOR_LIGHTBLUE, ftext);
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110153) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110154) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110155) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110156) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110157) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(11015 : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110159) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110160) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110161) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jordan\Desktop\UG-RP\gamemodes\UG-RP.pwn(110162) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.

them above are all lines in that area.
Reply
#2

try like this format(ftext, sizeof(ftext), "%s", FactionInfo[2][FactionName]);
and so on for others
Reply
#3

Replace
Код:
ftext = FactionInfo[2][FactionName];
to
Код:
strmid(ftext,FactionInfo[2][FactionName],0,strlen(FactionInfo[2][FactionName]),256);
OR

Replace your code with this:

pawn Код:
new faction = PlayerInfo[FactionOffer[playerid]][pLeader];
format(string, sizeof(string), "* You have accepted %s's request to join the %s, you are now a Member of it.", giveplayer,  FactionInfo[faction][FactionName]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//format(ftext,sizeof(ftext),"* %s has accepted your request and is now a Member of the %s.", sendername, GetPlayerFactionName(giveplayer));
format(string, sizeof(string), "* %s has accepted your request and is now a Member of the %s.", sendername, FactionInfo[faction][FactionName]);
SendClientMessage(FactionOffer[playerid], COLOR_LIGHTBLUE, FactionInfo[faction][FactionName]);
Reply
#4

Quote:
Originally Posted by ikey07
Посмотреть сообщение
Replace
Код:
ftext = FactionInfo[2][FactionName];
to
Код:
strmid(ftext,FactionInfo[2][FactionName],0,strlen(FactionInfo[2][FactionName]),256);
OR

Replace your code with this:

pawn Код:
new faction = PlayerInfo[FactionOffer[playerid]][pLeader];
format(string, sizeof(string), "* You have accepted %s's request to join the %s, you are now a Member of it.", giveplayer,  FactionInfo[faction][FactionName]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//format(ftext,sizeof(ftext),"* %s has accepted your request and is now a Member of the %s.", sendername, GetPlayerFactionName(giveplayer));
format(string, sizeof(string), "* %s has accepted your request and is now a Member of the %s.", sendername, FactionInfo[faction][FactionName]);
SendClientMessage(FactionOffer[playerid], COLOR_LIGHTBLUE, FactionInfo[faction][FactionName]);
Thanks !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)