SA-MP Forums Archive
1 Error. Error 047: 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: 1 Error. Error 047: array sizes do not match (/showthread.php?tid=310391)



1 Error. Error 047: array sizes do not match - iGetty - 12.01.2012

I know I might sound a bit of a newbie here, but all help is appreciated.

Код:
C:\Documents and Settings\dell\Desktop\SERVER1\gamemodes\sl-rp.pwn(3540) : error 047: array sizes do not match, or destination array is too small
That is the error.

This is the line.

Line 3540
pawn Код:
Owned[i][CarOwner] = dini_Get(FileName, "CarOwner");
What's the problem?

+rep


Re: 1 Error. Error 047: array sizes do not match - Jefff - 12.01.2012

strcat((Owned[i][CarOwner][0] = '\0',Owned[i][CarOwner]),dini_Get(FileName, "CarOwner"));

but I think You must add a size

strcat((Owned[i][CarOwner][0] = '\0',Owned[i][CarOwner]),dini_Get(FileName, "CarOwner"),size_of_Owned);


Re: 1 Error. Error 047: array sizes do not match - iGetty - 12.01.2012

Thanks, I got it fixed. But now I have a problem:

I have a "Vehicles" thing too. It's like this:

I have a dynamic vehicle system (Faction, FactionRank, Colour, Colour2, CarModel and all this stuff). It's just that when I come to OnPlayerStateChange, I do:

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(gPlayerData[playerid][Faction] == Vehicles[vehicleid][Faction])
    {
        return 1;
    }
    else
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
With that, it just removes me from the vehicle. Even if the players faction is the same as the vehicles Faction. Please help me here, would be grateful.


Re: 1 Error. Error 047: array sizes do not match - Steven82 - 12.01.2012

Maybe try flipping it.

pawn Код:
if(Vehicles[vehicleid][Faction] == gPlayerData[playerid][Faction])



Re: 1 Error. Error 047: array sizes do not match - iGetty - 12.01.2012

It's not working, I've put it both ways around. I don't know what's up with it? Could anybody at all help me?

Thank you.


Re: 1 Error. Error 047: array sizes do not match - Vince - 12.01.2012

Debug it (i.e. add print messages with information all over).


Re: 1 Error. Error 047: array sizes do not match - iGetty - 12.01.2012

I did and it worked fine with the debug, although; I've tried to use a different saving method. I've gone to SQL.

Let's hope this works.