Raised This Month: $ Target: $400
 0% 

random password generator ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
card
Member
Join Date: Jun 2008
Old 02-24-2009 , 10:49   random password generator ?
Reply With Quote #1

i need a code for auto password generator, for my server. everytime i type /pass, i get other random password (not only numbers) for the server. if someone can do this, i apreciate
card is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-24-2009 , 11:58   Re: random password generator ?
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #define PASSWORD_LENGTH 16 new sv_password; public plugin_init() {     register_plugin("Password Generator", "0.1", "Exolent");         register_clcmd("say /pass", "CmdPass");         sv_password = get_cvar_pointer("sv_password"); } public CmdPass(client) {     if( !access(client, ADMIN_CVAR) )     {         client_print(client, print_chat, "You have no access to that command!");         return PLUGIN_HANDLED;     }         new password[PASSWORD_LENGTH];     for( new i = 0; i < sizeof(password) - 1; i++ )     {         switch( i % 3 )         {             case 0: password[i] = random_num('0', '9');             case 1: password[i] = random_num('a', 'z');             case 2: password[i] = random_num('A', 'Z');         }     }         client_print(client, print_chat, "Password has been printed to your console.");     console_print(client, "^"sv_password^" is ^"%s^"", password);         set_pcvar_string(sv_password, password);         new name[32];     get_user_name(client, name, sizeof(name) - 1);         client_print(0, print_chat, "ADMIN %s :  set a random server password.", name);         return PLUGIN_HANDLED; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
card
Member
Join Date: Jun 2008
Old 02-24-2009 , 13:03   Re: random password generator ?
Reply With Quote #3

thank you exolent
card is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-25-2009 , 12:07   Re: random password generator ?
Reply With Quote #4

PHP Code:
random_num('A''Z'); 
its not num, how does it work o_O ?
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-25-2009 , 12:17   Re: random password generator ?
Reply With Quote #5

It works like nums. A character is basically a num. 'A' = 65 . ( see ascii table )
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-25-2009 , 12:54   Re: random password generator ?
Reply With Quote #6

ok thanks
__________________
xPaw is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode