Problem with INI_String
#1

Hello, i've been added business system from this thread in my GM http://forum.sa-mp.com/showthread.ph...light=business
i found 2 errors..
Код:
 : error 047: array sizes do not match, or destination array is too small
 : error 047: array sizes do not match, or destination array is too small
this is my code :

pawn Код:
//enums
enum bInfo
{
    bOwned,
    bPrice,
    bOwner[MAX_PLAYER_NAME],
    bType,
    bLocked,
    bMoney,
    Float:bEntranceX,
    Float:bEntranceY,
    Float:bEntranceZ,
    Float:bEntranceA,
    Float:bExitX,
    Float:bExitY,
    Float:bExitZ,
    Float:bExitA,
    bInt,
    bWorld,
    bInsideInt,
    bInsideWorld,
    bInsideIcon,
    bOutsideIcon,
    bName[128]
}
new BusinessInfo[200][bInfo];
//loading
forward loadbiz_data(idx, name[], value[]);
public loadbiz_data(idx, name[], value[])
{
    INI_Int("bOwned", BusinessInfo[idx][bOwned]);
    INI_Int("bPrice", BusinessInfo[idx][bPrice]);
    INI_String("bOwner", BusinessInfo[idx][bOwner], 24); // this is error 1
    INI_Int("bType", BusinessInfo[idx][bType]);
    INI_Int("bLocked", BusinessInfo[idx][bLocked]);
    INI_Int("bMoney", BusinessInfo[idx][bMoney]);
    INI_Float("bEntranceX", BusinessInfo[idx][bEntranceX]);
    INI_Float("bEntranceY", BusinessInfo[idx][bEntranceY]);
    INI_Float("bEntranceZ", BusinessInfo[idx][bEntranceZ]);
    INI_Float("bEntranceA", BusinessInfo[idx][bEntranceA]);
    INI_Float("bExitX", BusinessInfo[idx][bExitX]);
    INI_Float("bExitY", BusinessInfo[idx][bExitY]);
    INI_Float("bExitZ", BusinessInfo[idx][bExitZ]);
    INI_Float("bExitA", BusinessInfo[idx][bExitA]);
    INI_Int("bInt", BusinessInfo[idx][bInt]);
    INI_Int("bWorld", BusinessInfo[idx][bWorld]);
    INI_Int("bInsideInt", BusinessInfo[idx][bInsideInt]);
    INI_Int("bInsideWorld", BusinessInfo[idx][bInsideWorld]);
    INI_String("bName", BusinessInfo[idx][bName], 128); // this is error 2
    return 1;
}
how to fix it?
the MAX_PLAYER_NAME string is 24 as the Tutorial do..

thank you..

PS: sorry for my bad english.
Reply
#2

You use Y_Ini parser?
Reply
#3

This is?

pawn Код:
INI_ParseFile(str, "loadbiz_%s", .bExtra = true, .extra = idx );
Reply
#4

As it states, your string arrays are to small.
Reply
#5

Quote:
Originally Posted by GODEX
Посмотреть сообщение
As it states, your string arrays are to small.
can you show me example for bad array and good array?
Reply
#6

Anyone help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)