Posts: 13
Threads: 5
Joined: Oct 2012
Reputation:
0
Hi.. I was wondering how to make random passwords.. For example.. Every time you go to rob bank.. You have to guess password among 100 codes.. If someone knows and tell me I will be grateful.. Thank you in advance!
Posts: 109
Threads: 19
Joined: Jun 2015
Reputation:
0
the password is a string or an integer?
If it's a string then u have to make a list with the Alphabet and using "random(sizeof(urlist))" to select a random letter from that list
if it's an integer then use "random(10)" to generate a random number (0 to 9). if the pass lenth is 5 so use it 5 times and u got it)
if u already have a list of passwords, then the same way as a string, a list that contain ur passwords and a random num.
Posts: 46
Threads: 0
Joined: May 2017
Quote:
Originally Posted by mongi
the password is a string or an integer?
If it's a string then u have to make a list with the Alphabet and using "random(sizeof(urlist))" to select a random letter from that list
if it's an integer then use "random(10)" to generate a random number (0 to 9). if the pass lenth is 5 so use it 5 times and u got it)
if u already have a list of passwords, then the same way as a string, a list that contain ur passwords and a random num.
|
Like what mongi said
Posts: 13
Threads: 5
Joined: Oct 2012
Reputation:
0
Okay thanks.. I can understand some parts of your reply.. I'll be more specific.. I want to use this at bank robbery.. So when someone goes to bank and tries to rob it.. He will get messages like SendClientMessage(playerid, COLOR, "1234 5678 9101); and number of this messages will be more than 10.. So if he misses this 5678 he could not rob bank
And he needs to type in 5678 to successfully rob bank or open some doors.. I know how to create opening doors.. But i dont know how to make 5678 as a password
Posts: 175
Threads: 1
Joined: Apr 2017
Reputation:
0
Just generate a random number, save it to a variable and compare it when the user guesses the number.
Posts: 13
Threads: 5
Joined: Oct 2012
Reputation:
0
Can anyone show me any code? Pleasee