Y_Ini problem:
#1

pawn Code:
CMD:register(playerid, params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"mAdmin/Users/%s.txt",n);
    if(fexist(file))
        return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1)
        return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1)
        return SendClientMessage(playerid,ORANGE,"You are already registered, and logged in!");
    new INI:PlayerAcc = INI_Open(file);
    if(!isnull(params))
    {
        if(!fexist(file))
        {
            INI_WriteString(PlayerAcc,"Password",params);
            INI_WriteInt(PlayerAcc,"Regged",1);
            INI_WriteInt(PlayerAcc,"Logged",0);
            INI_WriteInt(PlayerAcc,"Level",0);
            INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
            INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
            INI_WriteInt(PlayerAcc,"Deaths",0);
            INI_WriteInt(PlayerAcc,"Kills",0);
            SendClientMessage(playerid,ORANGE,"You have just registered, Please use /login [password] to login!");
            PInfo[playerid][Regged] = 1;
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
        return 1;
    }
    return 1;
}
The problem is that, it doesn't create a file. No file gets created in my mAdmin/Users.
Reply


Messages In This Thread
Y_Ini problem: - by Mean - 23.01.2011, 17:10
Re: Y_Ini problem: - by Zh3r0 - 23.01.2011, 17:18
Re: Y_Ini problem: - by Mean - 23.01.2011, 17:22
Re: Y_Ini problem: - by Zh3r0 - 23.01.2011, 17:33
Re: Y_Ini problem: - by Mean - 23.01.2011, 17:34

Forum Jump:


Users browsing this thread: 2 Guest(s)