CMD:changepass( playerid, params[ ] )
{
new
Name[ MAX_PLAYER_NAME ];
if( isnull( params ) ) return SendClientMessage( playerid, -1, "Usage: /changepass <New Password>" );
GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
format( Path, sizeof( Path ),/* Your File Location Path Here! */ "Users\%s.ini", Name );
new INI:File = INI_Open( Path );
INI_SetTag( File, "data" /* Change it to the tag's name you are using */);
INI_WriteString( File, "Password", params ); // If you are using for hashed_password like Whirlpool then change params to the variable you will make "new buf[ 129 ];" etc..
INI_Close( File );
return 1;
}
CMD:changepassword(playerid, params[])
{
if(sscanf(params, "s[128]", new_password))
return 0; //You can also return a usage message here.
new
INI:File = INI_Open(YOUR_ACCOUNT_DIRECTORY);
INI_SetTag(File,"data");
INI_WriteInt(File,"Password", udb_hash(new_password));
INI_Close(File);
return true;
}
Not tested:
pawn Код:
|
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(179) : warning 217: loose indentation C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(199) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(199) : error 017: undefined symbol "cmd_changepassword" C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(199) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(199) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:changepassword(playerid, params[])
{
if(sscanf(params, "s[128]", new_password))
return 0; //You can also return a usage message here.
new
INI:File = INI_Open(YOUR_ACCOUNT_DIRECTORY);
INI_SetTag(File,"data");
INI_WriteInt(File,"Password", udb_hash(new_password));
INI_Close(File);
return true;
}
return 1;
}
#include < a_samp >
#include < zcmd >
// At The Top
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
return 0;
}
// Somewhere in your script "Note: Not inside any Callback!"
CMD:changepass( playerid, params[ ] )
{
// Code Here!
return 1;
}
// Rest