[HELP] dini + yini lol
#1

Before i said anything... i post a code first!

pawn Код:
YCMD:login(playerid, params[], help) {
    if(help) {
        new
            str[MAX_STRINGS];
        format(str, sizeof(str), "YCMD: This Command Allowed Player To Loging In In Specify Account");
        SendClientMessage(playerid, COLOR_ORANGE, str);
    }
    else {
        if(isnull(params)) {
            if(_Player_Logged[playerid] >= 1) {
                SendClientMessage(playerid, COLOR_RED, "ERROR: You Are Already Logged In");
            }
            else {
                new
                    str2[MAX_STRINGS];
                format(str2, sizeof(str2), "USAGE: /%s [password]", Command_GetDisplayNamed("login", playerid));
                SendClientMessage(playerid, COLOR_ORANGE, str2);
            }
        }
        else {
            new
                pName[MAX_NAMES],
                filepath[MAX_STRINGS];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(filepath, sizeof(filepath), "\\SMAdmin\\Users\\%s.ini", pName);
            new
                RPass = dini_Int(filepath, "Password");
            if(INI_Hash(params) != RPass) {
                _Player_Logged[playerid] = 1;
                Account[playerid][Level] = dini_Int(filepath, "Level");
                GivePlayerMoney(playerid, dini_Int(filepath, "Money"));
                SetPlayerScore(playerid, dini_Int(filepath, "Score"));
                if(Account[playerid][Level] >= 1) {
                    new
                        str3[MAX_STRINGS];
                    format(str3, sizeof(str3), "Account: Welcome Administrator %s", pName);
                    SendClientMessage(playerid, COLOR_LIGHTGREEN, str3);
                }
                else {
                    new
                        str4[MAX_STRINGS];
                    format(str4, sizeof(str4), "Account: You have successfully logged in");
                    SendClientMessage(playerid, COLOR_LIGHTGREEN, str4);
                }
            }
            else {
                new
                    str5[MAX_STRINGS];
                format(str5, sizeof(str5), "ERROR: You enter a wrong password");
                SendClientMessage(playerid, COLOR_RED, str5);
            }
        }
    }
    return 1;
}
at those cmds... the dini_Int thingy to get the player lvl doesnt work..
pawn Код:
Account[playerid][Level] = dini_Int(filepath, "Level");
any solution?
Reply
#2

You mean YCMD
Reply
#3

thats cmd i meant the level variable...
Reply
#4

pawn Код:
forward ParsePass( pid, name[ ] , value[ ] );
public  ParsePass( pid, name[ ] , value[ ] );
{
    if ( !strcmp( name, "Password" ) ) SetPVarString( playerid, "pPass", valu );
}

///This goes before your login check.
INI_ParseFile( "file.ini", "ParsePass", .bExtra = true, .extra = playerid );
Reply
#5

thats for check the pass..? omg i meant the
pawn Код:
Account[playerid][Level] = dini_Int(filepath, "Level");
to get the player level after login :O but it doesnt work!!!
Reply
#6

Why you're using YINI and DINI? And not just DINI or YINI
Reply
#7

this is really weird.. i cant even get those level.. then how come do i gonna get the level?
Reply
#8

Are you even gonna respond my question?
Reply
#9

ok fine... i use y_ini for save the file.. and dini for getting lvl or some stuff... because i looked my old script to define the player lvl using dini... anyway.. i always using yini and never seen this problem b4... not always..
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
dini and y_ini are not quite compatible - I think dini expects no spaces around the equals sign whereas y_ini puts one there by default (and is also less picky when reading files so can read dini files). Basically dini doesn't match the ini file specification very well, y_ini is much better at matching it but as a result y_ini writes valid files that dini can't read.
so what im gonna do..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)