SA-MP Forums Archive
array sizes do not match - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: array sizes do not match (/showthread.php?tid=624099)



array sizes do not match - SukMathcuck - 10.12.2016

I am irritated by this error, I do not know what else to do, why does this error persist in showing?

Quote:

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(28 : 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

PHP код:
 stock SpawnPersonagem(playeridid)
{
    new
        
nome[MAX_PLAYERS],
        
arquivo[74],
        
arquivo2[74];
            
    for(new 
09i++) PlayerTextDrawHide(playeridpTextDraw[i]);
    
TextDrawHideForPlayer(playeridTextDrawWorldReality);
    
TextDrawHideForPlayer(playeridTextdrawRoleplay);
    if(
id == 1SetPlayerName(playeridAccount[playerid][pPersonagem1]);
    if(
id == 2SetPlayerName(playeridAccount[playerid][pPersonagem2]);
    if(
id == 3SetPlayerName(playeridAccount[playerid][pPersonagem3]);
    
CancelSelectTextDraw(playerid);
    
SetPlayerColor(playerid, -1);
    
SpawnPlayer(playerid);
    
    
//Conta de Usuбrio
    
format(arquivosizeof(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(playeridnomesizeof(nome));
    
format(arquivo2sizeof(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;




Re: array sizes do not match - GoldenLion - 10.12.2016

Use format or strcpy/strcat.


Re: array sizes do not match - Sew_Sumi - 10.12.2016

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Use format or strcpy/strcat.
It's not that...


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


Re: array sizes do not match - GoldenLion - 10.12.2016

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
It's not that...


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


Re: array sizes do not match - Sew_Sumi - 11.12.2016

For some reason now I look at the code more, it really looks different to what I read.


Re: array sizes do not match - SukMathcuck - 11.12.2016

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Use format or strcpy/strcat.
Beauty, I'll try to unravel the problem, do you have a base to use one? Strcpy / strcat?


Re: array sizes do not match - OneDay - 11.12.2016

Account[playerid][pPersonagem1] = DOF2_GetString(arquivo, "Personagem1");

pPersonagem1 is not array so can not have a string


Re: array sizes do not match - GoldenLion - 11.12.2016

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
Beauty, I'll try to unravel the problem, do you have a base to use one? Strcpy / strcat?
What?


Re: array sizes do not match - SukMathcuck - 11.12.2016

Topic closed, resolved!


Re: array sizes do not match - Sew_Sumi - 11.12.2016

Should say how you fixed it, so the next person who has this and searches may find your thread and find a definitive answer.