PDA

View Full Version : array sizes do not match


SukMathcuck
10/12/2016, 10:46 PM
I am irritated by this error, I do not know what else to do, why does this error persist in showing?


C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(284) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(286) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(287) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(288) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(289) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(294) : error 047: array sizes do not match, or destination array is too small



stock SpawnPersonagem(playerid, id)
{
new
nome[MAX_PLAYERS],
arquivo[74],
arquivo2[74];

for(new i = 0; i < 9; i++) PlayerTextDrawHide(playerid, pTextDraw[i]);
TextDrawHideForPlayer(playerid, TextDrawWorldReality);
TextDrawHideForPlayer(playerid, TextdrawRoleplay);

if(id == 1) SetPlayerName(playerid, Account[playerid][pPersonagem1]);
if(id == 2) SetPlayerName(playerid, Account[playerid][pPersonagem2]);
if(id == 3) SetPlayerName(playerid, Account[playerid][pPersonagem3]);

CancelSelectTextDraw(playerid);
SetPlayerColor(playerid, -1);
SpawnPlayer(playerid);

//Conta de Usuário
format(arquivo, sizeof(arquivo), "/Contas de Usuários/%s.ini", PlayerData[playerid][pConta]);
Account[playerid][pSenha] = DOF2_GetString(arquivo, "Senha"); //Error 284
Account[playerid][pAdmin] = DOF2_GetInt(arquivo, "Admin");
Account[playerid][pPersonagem1] = DOF2_GetString(arquivo, "Personagem1"); //Error 286
Account[playerid][pPersonagem2] = DOF2_GetString(arquivo, "Personagem2"); //Error 287
Account[playerid][pPersonagem3] = DOF2_GetString(arquivo, "Personagem3"); //Error 288
Account[playerid][pEmail] = DOF2_GetString(arquivo, "Email"); //Error 289

//Conta de Personagem
GetPlayerName(playerid, nome, sizeof(nome));
format(arquivo2, sizeof(arquivo2), "/Personagens/%s.ini", nome);
PlayerData[playerid][pConta] = DOF2_GetString(arquivo2, "Conta"); //Error 294
PlayerData[playerid][pNivel] = DOF2_GetInt(arquivo2, "Nivel");
PlayerData[playerid][pTutorial] = DOF2_GetInt(arquivo2, "Tutorial");
return 1;
}

GoldenLion
10/12/2016, 10:51 PM
Use format or strcpy/strcat.

Sew_Sumi
10/12/2016, 11:47 PM
Use format or strcpy/strcat.

It's not that...


It's to do with the way he's addressing the arrays.

GoldenLion
10/12/2016, 11:54 PM
It's not that...


It's to do with the way he's addressing the arrays.
But that will work.

Sew_Sumi
11/12/2016, 02:00 AM
For some reason now I look at the code more, it really looks different to what I read.

SukMathcuck
11/12/2016, 02:47 AM
Use format or strcpy/strcat.

Beauty, I'll try to unravel the problem, do you have a base to use one? Strcpy / strcat?

OneDay
11/12/2016, 07:35 AM
Account[playerid][pPersonagem1] = DOF2_GetString(arquivo, "Personagem1");

pPersonagem1 is not array so can not have a string

GoldenLion
11/12/2016, 11:15 AM
Beauty, I'll try to unravel the problem, do you have a base to use one? Strcpy / strcat?
What?

SukMathcuck
11/12/2016, 01:20 PM
Topic closed, resolved!

Sew_Sumi
11/12/2016, 10:07 PM
Should say how you fixed it, so the next person who has this and searches may find your thread and find a definitive answer.