26.10.2014, 10:39
If i typed /changepass oldpass12 newpass12 its showed me Server:Unkown Command.
Code:
CMD:changepass( playerid, params[]) { if ( !BUD::IsNameRegistered( PlayerName2( playerid ) ) ) return SendError( playerid, "You must be registered to change your pass.~n~Use ~b~~h~/register~w~."); if ( P_DATA[ playerid ][ P_Logged ] == 0 ) return SendError( playerid, "Please ~b~~h~/login ~w~to change your password."); BUD::JSCHash( NewPass, pPassHash ); BUD::MultiSet( iUID, "sss", "passhash", pPassHash, "Password", NewPass, "Old_Password", OldPass ); format( String, sizeof String, "Password has been changed!~n~~n~~r~~h~Old:~w~%s~n~~b~~h~New: ~w~%s", OldPass,NewPass ); Info( playerid, String,9000 ); new NewPass[ 21 ], OldPass[ 129 ]; if ( sscanf( params, "s[21]s[129]", OldPass, NewPass )) return SendUsage( playerid, "/changepass [OLD] [NEW]"); new Password[ 20 ], String[ 129 ], pPassHash[ (64) + 1 ] ; new iUID = BUD::GetNameUID( PlayerName2( playerid ) ); BUD::GetStringEntry( iUID, "Password", Password, 20 ); if ( strcmp( Password, OldPass, false ) ) return SendError( playerid, "Old password didn't match the one you inserted!"); if ( strlen( NewPass ) < 3 || strlen( NewPass ) > 20 ) return SendError( playerid, "New password may contain:~n~ Min. 3 Char. and Max. 20 Char."); BUD::JSCHash( NewPass, pPassHash ); BUD::MultiSet( iUID, "sss", "passhash", pPassHash, "Password", NewPass, "Old_Password", OldPass ); format( String, sizeof String, "Password has been changed!~n~~n~~r~~h~Old:~w~%s~n~~b~~h~New: ~w~%s", OldPass,NewPass ); Info( playerid, String,9000 ); return 1; }