INI ParseFile, arguement type mismatch
#1

Brief: I'm confused on how to make this work. The mismatch is on the 3 lines under the LoadBiz function. I have been studying the y_ini tutorial, but it doesn't explain this specific situation. If you make an attempt to fix, explain what you are doing, and why you are doing it please.

pawn Код:
forward Load_Biz(BizID,line[],value[]);
public Load_Biz(BizID,line[],value[])
{
    INI_Int("EnterX",bInfo[BizID][EnX]);
    INI_Int("EnterY",bInfo[BizID][EnY]);
    INI_Int("EnterZ",bInfo[BizID][EnZ]);
    return 1;
}

main() print("\n  Hello World! \n");

public OnGameModeInit()
{
    for (new i=0; i<MAX_BIZ; i++)
    {
        new filename[64];
        format(filename,sizeof(filename),"Biz/%i.ini",i);
        if(fexist(filename)){INI_ParseFile(filename, "Load_Biz", .bExtra = true, .extra = i);}
    }
    return 1;
}
Reply
#2

pawn Код:
forward Load_Biz(BizID,line[],value[]);
public Load_Biz(BizID,line[],value[])
{
    INI_Float("EnterX",bInfo[BizID][EnX]);
    INI_Float("EnterY",bInfo[BizID][EnY]);
    INI_Float("EnterZ",bInfo[BizID][EnZ]);
    return 1;
}

edit: i'm sure the bInfo variables are floats, if they are - this will fix it
Reply
#3

Quote:
Originally Posted by Mionee
Посмотреть сообщение
pawn Код:
forward Load_Biz(BizID,line[],value[]);
public Load_Biz(BizID,line[],value[])
{
    INI_Float("EnterX",bInfo[BizID][EnX]);
    INI_Float("EnterY",bInfo[BizID][EnY]);
    INI_Float("EnterZ",bInfo[BizID][EnZ]);
    return 1;
}

edit: i'm sure the bInfo variables are floats, if they are - this will fix it
While I forgot to add that -- thanks btw -- it didn't resolve the errors.
Reply
#4

pawn Код:
forward Load_Biz(BizID, name[], value[]);
public Load_Biz(BizID, name[], value[]);
Maybe this?
Reply
#5

Quote:
Originally Posted by Mionee
Посмотреть сообщение
pawn Код:
forward Load_Biz(BizID, name[], value[]);
public Load_Biz(BizID, name[], value[]);
Maybe this?
The error is in the second arguement "value," also I had to rename it from "name" because I already have it in an enum. I can change it though.

EDIT: that was it, thanks Mionee
Reply
#6

because the error occurs at the second param doesn't necessarily mean the second param is incorrect.

nevertheless, yw.
Reply
#7

Show your Enum code ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)