1 Error. Error 047: array sizes do not match
#1

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
Reply
#2

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);
Reply
#3

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.
Reply
#4

Maybe try flipping it.

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

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.
Reply
#6

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

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)