SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 17/03/2011, 06:15 AM   #1
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 250
Reputation: 8
Default [HELP] dini + yini lol

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

pawn Code:
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 Code:
Account[playerid][Level] = dini_Int(filepath, "Level");
any solution?
AK47317 is offline  
Old 17/03/2011, 06:33 AM   #2
Marricio
Gangsta
 
Join Date: Dec 2010
Posts: 591
Reputation: 53
Default Re: [HELP] dini + yini lol

You mean YCMD
Marricio is offline  
Old 17/03/2011, 06:33 AM   #3
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 250
Reputation: 8
Default Re: [HELP] dini + yini lol

thats cmd i meant the level variable...
AK47317 is offline  
Old 17/03/2011, 06:34 AM   #4
Zh3r0
Godfather
 
Join Date: Mar 2008
Posts: 5,597
Reputation: 380
Default Re: [HELP] dini + yini lol

pawn Code:
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 );
__________________
Zh3r0 is offline  
Old 17/03/2011, 06:40 AM   #5
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 250
Reputation: 8
Default Re: [HELP] dini + yini lol

thats for check the pass..? omg i meant the
pawn Code:
Account[playerid][Level] = dini_Int(filepath, "Level");
to get the player level after login :O but it doesnt work!!!
AK47317 is offline  
Old 17/03/2011, 06:54 AM   #6
Marricio
Gangsta
 
Join Date: Dec 2010
Posts: 591
Reputation: 53
Default Re: [HELP] dini + yini lol

Why you're using YINI and DINI? And not just DINI or YINI
Marricio is offline  
Old 17/03/2011, 07:04 AM   #7
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 250
Reputation: 8
Default Re: [HELP] dini + yini lol

this is really weird.. i cant even get those level.. then how come do i gonna get the level?
AK47317 is offline  
Old 17/03/2011, 07:06 AM   #8
Marricio
Gangsta
 
Join Date: Dec 2010
Posts: 591
Reputation: 53
Default Re: [HELP] dini + yini lol

Are you even gonna respond my question?
Marricio is offline  
Old 17/03/2011, 07:14 AM   #9
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 250
Reputation: 8
Default Re: [HELP] dini + yini lol

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..
AK47317 is offline  
Old 17/03/2011, 11:13 AM   #10
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 16,102
Reputation: 2283
Default Re: [HELP] dini + yini lol

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.
__________________
Y_Less is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dini Rock18 Help Archive 0 05/03/2011 10:39 AM
Yini reading Example [SOB]Chris Help Archive 11 22/10/2010 10:47 AM
dini get Seven. Help Archive 8 27/09/2010 02:29 PM
sa-mp 0.3 bug (dini) chormi Help Archive 15 06/10/2009 06:44 AM


All times are GMT. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.