Jump to content

Question

Posted

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 );

}

10 answers to this question

Recommended Posts

Posted

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

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Sterge asta ma :

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

Posted

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

Posted

Sscanf verifica daca ai scris text sau cifre . Acea functie verifica daca cel care vrei tu sa-i schimbi parola este connectat si cum tu vrei offline sterge-o .

Posted

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

Daca intelegeam ceva te ajutam

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Aia am facut si eu din prima dar uite:

KGOnaVn.png

Cand am vrut sa ma conectez cu contul ala nu o mers parola "123456"...(contul chiar exista in baza de date)

Posted

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 );
}

Posted

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

Posted

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

Guest
This topic is now closed to further replies.
×
×
  • 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.