|***|Need Help|***|
#1

Hi all,I need help with this I make new house system in my server and now I get that error can someone help me?

Error:

Код:
data/houseDB.txt(61) : error 047: array sizes do not match, or destination array is too small
Reply
#2

First of all your title for this topic does not help
Second, I dnot know why you put it as a .txt not .inc
Thirdly you need to count how many arrays there are or put into the array Sizeof([arraynamehere])

Jack_Rocker

EDIT: Sorry, I know why it is txt now :L
Reply
#3

Quote:
Originally Posted by Serifukas
Посмотреть сообщение
Hi all,I need help with this I make new house system in my server and now I get that error can someone help me?

Error:

Код:
data/houseDB.txt(61) : error 047: array sizes do not match, or destination array is too small
post the code here
Reply
#4

The error is self-explanatory, the error occurs when the array size is too small for the string. Here's an example:

pawn Код:
public OnGameModeInit( )
{
     static
          s_string[4]
     ;
     s_string = "Hello";          
     return true;
}
The error will show up because Hello doesn't match the size of _string.
Reply
#5

This is the code:

Код:
new text[512];	
        new file[128]; print("Kraunami namai");
        for(new house=0; house<pickups[1][namai]+1; house++)
        {
	format(file,sizeof(file),"saves/house/%i",house);
        houseDB[house][nkaina]=150000+random(1000000);
        if(!fexist(file))
        {
        houseDB[house][housetext] = Create3DTextLabel("",0xFFFFFFFF,PickupIDs[house][0],PickupIDs[house][1],PickupIDs[house][2],25, 0, 1);
        format(text,sizeof(text),"Namo {00FF00}%i{FFFFFF} Numeris\n{FFFFFF} Namas parduodamas!\nKaina: {00FF00}%i Lt",house,houseDB[house][nkaina],houseDB[house][setting]);
        Update3DTextLabelText(houseDB[house][housetext],0xFFFFFFFF,text);
        strmid(houseDB[house][owner_name],"no",0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
        continue;
        }
        new uber[MAX_PLAYER_NAME];
        uber = dini_Get(file,"owner_name");
        strcat(houseDB[house][owner_name], dini_Get(file,"owner_name"));
        strmid(houseDB[house][owner_name],dini_Get(file,"owner_name"),0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
        houseDB[house][namehash]=dini_Int(file,"hash");
        houseDB[house][setting]=dini_Int(file,"setting");
        houseDB[house][housetext] = Create3DTextLabel("",0xFFFFFFFF,PickupIDs[house][0],PickupIDs[house][1],PickupIDs[house][2],25, 0, 1);
        format(file,sizeof(file),"Namo {00FF00}%i{FFFFFF} Numeris\nNamas nupirktas!\nSavininkas:{FF0000} %s",house,houseDB[house][owner_name]);
        Update3DTextLabelText(houseDB[house][housetext],0xFFFFFFFF,file);
        printf("Namas %i priklauso %s (vidaus ID: %i)",house,houseDB[house][owner_name],houseDB[house][setting]);
        }
Reply
#6

Please help me.
Reply
#7

Which one is line 61 ?
Reply
#8

In the houseDB's enum, make everything that is a STRING, the size of 255, else it won't work.
Reply
#9

That is 61:

Код:
 strcat(houseDB[house][owner_name], dini_Get(file,"owner_name"));
Reply
#10

Change the size of houseDB[house][owner_name] to 255
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)