Y_INI , Do I on the right ?
#1


Hi guys
i make register/login system, but there are things that stuck in my mind

Okey !!

this " WriteInt " will give player his stat or Write Pinfo in the file.ini
( Ini ===> Pinfo or Pinfo ===> Ini )
pawn Код:
forward SaveAccountout(playerid);
public SaveAccountout(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    INI_Close(File);
    return 1;    
}
and where can i post it ?

EX: when player " OnPlayerDisconnect " or " OnPlayerConnect "


and what about
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{

    INI_Int("Cash",PlayerInfo[playerid][pCash]);

    return 1;
}
Reply
#2

"INI_WriteInt" will write "Cash = PlayerInfo[playerid][pCash]", of course it will replace "PlayerInfo[playerid][pCash] with his integer value.

So if the player has $500 registered in "pCash", it will write "Cash = 500" in the player's file.

You should create a per-player timer when the player connects which will save all the player data each time the function is called.

And about "INI_Int("Cash", ...)", it just takes what's after the "Cash =" in the player's file and put it as an integer value in the variable which was passed where the "..." are in my example.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)