SA-MP Forums Archive
users/.ini - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: users/.ini (/showthread.php?tid=264319)



users/.ini - 0_o - 25.06.2011

my server saves players account that are written in users folder and %s.ini, But the problem is, it saves all players account, but only few players stats are saved, and other stats are not saved, can anyone help me pls?


Re: users/.ini - GangsTa_ - 25.06.2011

There should be a length problem within the string, I had the same thing before. Check your string length, which is written in '[]'
For example where's

pawn Код:
new string[128];
You change the [128] to [256] or more.


Re: users/.ini - Willow - 25.06.2011

Please, post you code here so we can help!


Re: users/.ini - 0_o - 25.06.2011

Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
There should be a length problem within the string, I had the same thing before. Check your string length, which is written in '[]'
For example where's

pawn Код:
new string[128];
You change the [128] to [256] or more.
Not Working. It saves all peoples account, but saves only few players stats, for some people it asks to register even when player is registered and account saved.


Re: users/.ini - Markx - 25.06.2011

Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
There should be a length problem within the string, I had the same thing before. Check your string length, which is written in '[]'
For example where's

pawn Код:
new string[128];
You change the [128] to [256] or more.
Click this

OT:

Could you show us the code?


Re: users/.ini - 0_o - 25.06.2011

pawn Код:
GetPlayerName(playerid, plname, sizeof(plname));
    format(string, sizeof(string), "users/%s.ini", plname);
if(fexist(string))
    {
        gPlayerAccount[playerid] = 1;
    }
    else
    {
        gPlayerAccount[playerid] = 0;
    }
    return 1;
}
pawn Код:
new string3[256];
            new playername3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername3, sizeof(playername3));
            format(string3, sizeof(string3), "users/%s.ini", playername3);
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
pawn Код:
new string3[256];
            new playername3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername3, sizeof(playername3));
            format(string3, sizeof(string3), "users/%s.ini", playername3);
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
pawn Код:
new tmp2[256];
    new string2[256];
    new playername2[MAX_PLAYER_NAME];
    new playernamesplit[3][MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    split(playername2, playernamesplit, '_');
    format(string2, sizeof(string2), "users/%s.ini", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
        new PassData[256];
        new keytmp[256], valtmp[256];
        fread( UserFile , PassData , sizeof( PassData ) );
        keytmp = ini_GetKey( PassData );
        if( strcmp( keytmp , "Key" , true ) == 0 )
        {
            valtmp = ini_GetValue( PassData );
            strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
        }
        if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
        {
                new key[ 256 ] , val[ 256 ];
                new Data[ 256 ];
                while ( fread( UserFile , Data , sizeof( Data ) ) )
                {



Re: users/.ini - 0_o - 25.06.2011

help me please.


Re: users/.ini - Markx - 25.06.2011

The problem is in 256 string cells! Read this: https://sampforum.blast.hk/showthread.php?tid=55261