Odd problem concerning writing an integer while playing - 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: Odd problem concerning writing an integer while playing (
/showthread.php?tid=317843)
Odd problem concerning writing an integer while playing -
2KY - 12.02.2012
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;
}
Re: Odd problem concerning writing an integer while playing -
SomeGuy#1 - 12.02.2012
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;
}
Re: Odd problem concerning writing an integer while playing -
2KY - 12.02.2012
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.
Re: Odd problem concerning writing an integer while playing -
Madd Kat - 12.02.2012
Your missing the ini section key. "data"
Look at the other ini code you already have
Re: Odd problem concerning writing an integer while playing -
2KY - 12.02.2012
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.
Re: Odd problem concerning writing an integer while playing -
Madd Kat - 12.02.2012
All i ask is you help someone else when you can
Welcome, mk