Y_ini Problem
#1

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME],str[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),"{FF9900}%s Has joined {FF66FF}Drife 4 Life {ffffff}Server",name);
    SendClientMessageToAll(COLOR_BLUE,str);
    if(IsPlayerNPC(playerid))
    {
        if(!strcmp(GetPlayersName(playerid),"Dragdriver"))
        {
            PutPlayerInVehicle(playerid,Carn,0);
        }
    }
    LoadAcc(playerid);
    return 1;
}
stock LoadAcc(playerid)
{
    new str[100];
    if(IsPlayerNPC(playerid))
    {
        return 0;
    }
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
        return 1;
    }
    if(pInfo[playerid][Banned] == 1)
    {
        format(str,sizeof(str),"This Name %s Is banned make unban apply on the forums",GetPlayersName(playerid));
        SendClientMessage(playerid,COLOR_LIGHTBLUE,str);
        format(str,sizeof(str),"Player %s Has been Banned Reason: Attempt to Ban evading ",GetPlayersName(playerid));
        SendClientMessageToAll(COLOR_LIGHTBLUE,str);
        Ban(playerid);

    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    if(fexist(Path(playerid)))
    {
        new INI:file = INI_Open(Path(playerid));
        INI_SetTag(file,"Player's Data");
        INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
        INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
        INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
        INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
        INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
        INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
        INI_WriteInt(file,"Banned",pInfo[playerid][Banned]);
        INI_WriteInt(file,"Leader",pInfo[playerid][Leader]);
        INI_WriteInt(file,"Member",pInfo[playerid][Member]);
        INI_WriteInt(file,"Rank",pInfo[playerid][Rank]);
        INI_Close(file);
        return 1;
    }
    return 1;
}
Its not writing at all.
Reply
#2

BUMB!#@
Reply
#3

Sorry for this bumb but i really need help
Reply
#4

Show your loadaccount function which you use in INI_ParseFile.
Reply
#5

pawn Код:
public loadaccount_user(playerid, name[], value[])
{
    INI_String("Password", pInfo[playerid][Pass],129);
    INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);
    INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);
    INI_Int("Money",pInfo[playerid][Money]);
    INI_Int("Scores",pInfo[playerid][Scores]);
    INI_Int("Kills",pInfo[playerid][Kills]);
    INI_Int("Deaths",pInfo[playerid][Deaths]);
    INI_Int("Banned",pInfo[playerid][Banned]);
    INI_Int("Leader",pInfo[playerid][Leader]);
    INI_Int("Member",pInfo[playerid][Member]);
    INI_Int("Rank",pInfo[playerid][Rank]);
    return 1;
}
Please help
Reply
#6

hmmm?
Reply
#7

Well first off, you are saving with a tag named 'Player's Data', so really, you should be loading the data with the same tag as well...
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Well first off, you are saving with a tag named 'Player's Data', so really, you should be loading the data with the same tag as well...
it works befor
Reply
#9

You should post the part of OnDialogResponse relating to the registration system .



I hope that I have helped .
Reply
#10

You don't get me guys it was working fine but when i uploaded the script to the host it stoped writing But in my local host its writing fine with no problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)