Help with dini to y_ini (******, read please)
#1

Okay I've been at this for a long time but can't figure out what to do. The compiler used to crash but I've managed to narrow down the problem to this piece of code, which is called for a player when he logs in. I use LuxAdmin.

pawn Код:
forward Load_User_Data(playerid, name[], value[]);  // not sure if this is needed; it wasn't there in the tutorial for y_ini
public Load_User_Data[](playerid, name[], value[])
{
    if(ServerInfo[GiveMoney] == 1)
    {
    new money;
    INI_Int("Money", money);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money);
    }
    new wlevel;
    INI_Int("WantedLevel",wlevel);
    SetPlayerWantedLevel(playerid,wlevel);
    #if SaveScore == true
    new score; INI_Int("Score",score);
    SetPlayerScore(playerid,score);
    #endif
    INI_Int("Deaths",AccInfo[playerid][Deaths]);
    INI_Int("Kills",AccInfo[playerid][Kills]);
    INI_Int("Level",AccInfo[playerid][Level]);
    INI_Int("AccountType",AccInfo[playerid][pVip]);
    INI_Int("Hours",AccInfo[playerid][hours]);
    INI_Int("Minutes",AccInfo[playerid][mins]);
    INI_Int("Seconds",AccInfo[playerid][secs]);
    INI_Int("Bet",DBet[playerid]);
    INI_Int("InDuel",InDuel[playerid]);
}
LoginPlayer(playerid)
{
    new file[80];
    format(file, sizeof file, "LuxAdmin/Accounts/%s.ini", udb_encode(pName(playerid)));
    new INI:pfile=INI_Open(file);
    INI_WriteInt(pfile,"Loggedin",1);
    INI_Close(pfile);
    INI_ParseFile(file, "Load_User_Data_%s", .bExtra=true, .extra=playerid);
    AccInfo[playerid][Registered]   = 1;
    AccInfo[playerid][LoggedIn]     = 1;
 //the rest is not related to the error
I'm getting this error on the header of Load_User_Data:

Код:
LuxAdmin.pwn(7433) : error 056: arrays, local variables and function arguments cannot be public (variable "Load_User_Data")
I'm getting this error on ALL "INI_Int" lines:

Код:
LuxAdmin.pwn(7435) : error 010: invalid function or declaration
I also get

Код:
LuxAdmin_COD.pwn(11889) : warning 203: symbol is never used: "Load_User_Data"
LuxAdmin_COD.pwn(11889) : warning 203: symbol is never used: "money"
LuxAdmin_COD.pwn(11889) : warning 203: symbol is never used: "wlevel"
Also, I've just started to learn about y_ini and other YSI includes and how to use them. So, please tell me if anything could have been done in a better way.
Reply
#2

Do you have this?
pawn Код:
#pragma tabsize 0
Reply
#3

pawn Код:
forward Load_User_Data(playerid, name[], value[]);
public Load_User_Data(playerid, name[], value[])
pawn Код:
INI_ParseFile(file, "Load_User_Data", .bExtra=true, .extra=playerid);
Try these.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)