Odd problem concerning writing an integer while playing
#1

I've attempted to create a changepassword command which works perfectly, except for one thing..

Quote:

Passcode = 43057480
[data]
Passcode = 20644050
RegisteredIP = 127.0.0.1
Funds = 0
BankFunds = 0
SkinModel = 0
Kills = 0
Deaths = 0
EventsWon = 0
X_Pos = 149.641220
Y_Pos = -140.928146
Z_Pos = 2.172309
Ang_Pos = 179.944030

Here's the code.. What's the problem?

pawn Код:
CMD:changepassword(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, -1, ""#LIME"<CMD USAGE> "#WHITE"/changepassword <new password>");
       
    accInfo[playerid][Passcode] = udb_hash(params);
   
    new
        INI:accFile = INI_Open(find_accPath(playerid) );
       
    INI_WriteInt(accFile,   "Passcode",     udb_hash(params) );
       
    INI_Close(accFile);
    return true;
}
Reply
#2

Whats wrong with it??

Ah i know, you've put two " instead of 1

Should be
Код:
CMD:changepassword(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, -1, "#LIME"<CMD USAGE> "#WHITE"/changepassword <new password>");
        
    accInfo[playerid][Passcode] = udb_hash(params);
    
    new
        INI:accFile = INI_Open(find_accPath(playerid) );
        
    INI_WriteInt(accFile,   "Passcode",     udb_hash(params) ); 
        
    INI_Close(accFile);
    return true;
}
Instead Of
Код:
CMD:changepassword(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, -1, ""#LIME"<CMD USAGE> "#WHITE"/changepassword <new password>");
        
    accInfo[playerid][Passcode] = udb_hash(params);
    
    new
        INI:accFile = INI_Open(find_accPath(playerid) );
        
    INI_WriteInt(accFile,   "Passcode",     udb_hash(params) ); 
        
    INI_Close(accFile);
    return true;
}
Reply
#3

Passcode = 43057480
[data]
Passcode = 20644050
RegisteredIP = 127.0.0.1
Funds = 0
BankFunds = 0
SkinModel = 0
Kills = 0
Deaths = 0
EventsWon = 0
X_Pos = 149.641220
Y_Pos = -140.928146
Z_Pos = 2.172309
Ang_Pos = 179.944030

-- It should just overwrite the existing variable.
Reply
#4

Your missing the ini section key. "data"

Look at the other ini code you already have
Reply
#5

Quote:
Originally Posted by Madd Kat
Посмотреть сообщение
Your missing the ini section key. "data"

Look at the other ini code you already have
You are VERY helpful. Thank you! I'd +rep you but I already have.
Reply
#6

All i ask is you help someone else when you can


Welcome, mk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)