SA-MP Forums Archive
Y_ini Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Y_ini Problem (/showthread.php?tid=403904)



Y_ini Problem - Gangster-rocks - 01.01.2013

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.


Re: Y_ini Problem - Gangster-rocks - 01.01.2013

BUMB!#@


Re: Y_ini Problem - Gangster-rocks - 01.01.2013

Sorry for this bumb but i really need help


Re: Y_ini Problem - Threshold - 01.01.2013

Show your loadaccount function which you use in INI_ParseFile.


Re: Y_ini Problem - Gangster-rocks - 01.01.2013

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


Re: Y_ini Problem - Gangster-rocks - 02.01.2013

hmmm?


Re: Y_ini Problem - Threshold - 02.01.2013

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...


Re: Y_ini Problem - Gangster-rocks - 02.01.2013

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


Re: Y_ini Problem - rjjj - 02.01.2013

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



I hope that I have helped .


Re: Y_ini Problem - Gangster-rocks - 02.01.2013

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