Need Help [ compilation error ]
#1

Hey guys i got a problem in here

i get this error when i complile

Код:
C:\Users\Daniel.Daniel-PC\samp\server\gamemodes\ricaniel.pwn(103) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
By the way here is the code

pawn Код:
enum sfiles
{
    botname[129]
}
new sdata[sfiles];

if(!fexist(SERVER_DATA))
    {
        file_Create(SERVER_DATA);
        if(file_Open(SERVER_DATA))
        {
            file_SetStr("bot_name","RicaNiel");
            file_Save(SERVER_DATA);
            file_Close();
        }
    }
    else
    {
        if(file_Open(SERVER_DATA))
        {
            sdata[botname] = file_GetStr("bot_name");
            file_Save(SERVER_DATA);
            file_Close();
        }
    }
Reply
#2

I think you can't use file_open with if()
Reply
#3

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
I think you can't use file_open with if()
I'd done it but it is still same error that i get when i compile


pawn Код:
else
    {
        file_Open(SERVER_DATA);
        sdata[botname] = file_GetStr("bot_name");
        file_Save(SERVER_DATA);
        file_Close();
    }
Reply
#4

file_Close(SERVER_DATA);
Reply
#5

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
file_Close(SERVER_DATA);
its unknown directive

i use Southclaw's INI File Script

as my INI Writer
and i use Y_ini for the player data
Reply
#6

which line is it?
Reply
#7

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
which line is it?
The file_Close();
Reply
#8

Hm if i understand this right the line is unfixable їїї
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
Given that you didn't bother to tell us which line the error is on, I'd guess this is the problem:

pawn Код:
sdata[botname] = file_GetStr("bot_name");
I don't know what size array that function returns so you'll have to check the include's documentation or source.
Oh thanks ****** i found it its 256
Thank you so much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)