Jump to content
  • 0

/Setpassword offline


Sle|D

Question

Nick: Sle|d

Problema: am sters  cand nu este conecta palyerul dar nu pot i-mi zice ca sa salvat la contul "S" parola care  pun..comanda era pentru player id si sa fie online

Erori / warnings: nu da

Lini/script: mai jos

Ai incercat sa rezolvi singur ?:Da dar nu pre i-mi dau seama:-?

CMD:setpassword( playerid, params[ ] )

{

    LevelCheck( playerid, 6 );

    new Player, NewPass[ 25 ];

    if ( sscanf( params, "us[25]", Player, NewPass ) )

return SendClientMessage( playerid, COLOR_BLUE, "Foloseste: {33CCFF}/setpassword [Numele jucatorului] [Parola noua]" );

if ( strlen( NewPass ) < 6 || strlen( NewPass ) > 24 )

return SendError( playerid, "Lungimea parolei invalida!" );

if ( !IsPlayerConnected( Player ) )

return SendError( playerid, "Playerul nu este conectat!" );

mysql_real_escape_string( NewPass, NewPass );

new Buf[ 129 ];

WP_Hash( Buf, 129, NewPass );

    format( gsQuery, 512, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, PlayerName( Player ) );

    mysql_function_query( g_Handle, gsQuery, false, "", "" );

    FormatLog( "Set_PasswordLog", "%s have set the %s password to %s (Hash: %s)", PlayerName( playerid ), PlayerName( Player ), NewPass, Buf );

    PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );

    FormatMSG( playerid, COLOR_RED, "ACCOUNT: Ai reusit cu succes sa setezi {FFFFFF}\"%s's\" {FF0000}ca parola la contul {FFFFFF}\"%s\"", PlayerName( Player ), NewPass );

    return ( 1 );

}

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Invata limba romana, iar apoi vino sa ne explici ce problema ai.

@Gireada daca vrei sa ma ajuti si poti, fao, daca nu taci si nu te mai baga in seama;)

Sterge asta ma :

   if ( !IsPlayerConnected( Player ) )
      return SendError( playerid, "Playerul nu este conectat!" );

Am incercat dar cred ca daca acolo era facut sa introduc o cifra nu cred ca daca sterg eroare v-a merge:D

Link to comment
Share on other sites

Incearca asta :

CMD:setpassword( playerid, params[ ] )
{
    LevelCheck( playerid, 6 );

    new Player[ 24 ], NewPass[ 25 ];
    if ( sscanf( params, "s[24]s[25]", Player, NewPass ) )
      return SendClientMessage( playerid, COLOR_BLUE, "Foloseste: {33CCFF}/setpassword [Numele jucatorului] [Parola noua]" );

   if ( strlen( NewPass ) < 6 || strlen( NewPass ) > 24 )
      return SendError( playerid, "Lungimea parolei invalida!" );

   if ( strlen( Player ) < 6 || strlen( Player ) > 24 )
      return SendError( playerid, "Lungimea numelui invalida!" );

   mysql_real_escape_string( NewPass, NewPass );

   new Buf[ 129 ];
   WP_Hash( Buf, 129, NewPass );

    format( gsQuery, 512, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Player );
    mysql_function_query( g_Handle, gsQuery, false, "", "" );

    FormatLog( "Set_PasswordLog", "%s have set the %s password to %s (Hash: %s)", PlayerName( playerid ), Player, NewPass, Buf );

    PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
    FormatMSG( playerid, COLOR_RED, "I-ai setat lui %s parola %s ( Hash: %s ) !", Player, NewPass, Buf );
    return ( 1 );
}

Link to comment
Share on other sites

Incearca asta :

CMD:setpassword( playerid, params[ ] )
{
    LevelCheck( playerid, 6 );

    new Player[ 24 ], NewPass[ 25 ];
    if ( sscanf( params, "s[24]s[25]", Player, NewPass ) )
      return SendClientMessage( playerid, COLOR_BLUE, "Foloseste: {33CCFF}/setpassword [Numele jucatorului] [Parola noua]" );

   if ( strlen( NewPass ) < 6 || strlen( NewPass ) > 24 )
      return SendError( playerid, "Lungimea parolei invalida!" );

   if ( strlen( Player ) < 6 || strlen( Player ) > 24 )
      return SendError( playerid, "Lungimea numelui invalida!" );

   mysql_real_escape_string( NewPass, NewPass );

   new Buf[ 129 ];
   WP_Hash( Buf, 129, NewPass );

    format( gsQuery, 512, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Player );
    mysql_function_query( g_Handle, gsQuery, false, "", "" );

    FormatLog( "Set_PasswordLog", "%s have set the %s password to %s (Hash: %s)", PlayerName( playerid ), Player, NewPass, Buf );

    PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
    FormatMSG( playerid, COLOR_RED, "I-ai setat lui %s parola %s ( Hash: %s ) !", Player, NewPass, Buf );
    return ( 1 );
}

Nu merge.. uite ce apare

YZo9xho.png

Asta ia din baza de date dar acolo intra si sunt criptate parolele..si am incercat si nu merge nu s-a schimbat

Link to comment
Share on other sites

Incearca asta :

CMD:setpass( playerid, params[ ] )
{
    LevelCheck( playerid, 6 );

    new Player[ 24 ], NewPass[ 25 ];
    if ( sscanf( params, "s[24]s[25]", Player, NewPass ) )
      return SendClientMessage( playerid, COLOR_RED, "Foloseste: {33CCFF}/setpassword [Numele jucatorului] [Parola noua]" );

   if ( strlen( NewPass ) < 6 || strlen( NewPass ) > 24 )
      return SendError( playerid, "Lungimea parolei invalida!" );

   if ( strlen( Player ) < 6 || strlen( Player ) > 24 )
      return SendError( playerid, "Lungimea numelui invalida!" );

   mysql_real_escape_string( NewPass, NewPass );

   new Buf[ 129 ];
   WP_Hash( Buf, 129, NewPass );

    format( gsQuery, 512, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Player );
    mysql_function_query( g_Handle, gsQuery, false, "", "" );

    FormatLog( "Set_PasswordLog", "%s have set the %s password to %s (Hash: %s)", PlayerName( playerid ), Player, NewPass, Buf );

    PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
    FormatMSG( playerid, COLOR_RED, "I-ai setat lui %s parola %s ( Hash: %s ) !", Player, NewPass, Buf );
    return ( 1 );
}

Defapt merge era o problema la baza de date mersi:D

Ma omule comanda e buna, updateaza in db.

Dar daca tu ai parola 123456 si o pui tot 123456 vrei sa fie alt hash?

Sti ca nu are legatura? hash e ce aparre in coloana passsword din daza de date:D

Am rezolvat, va multumesc! t/c

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.