[HELP] How to make random passwords -
Charly123 - 27.05.2017
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!
Re: [HELP] How to make random passwords -
mongi - 27.05.2017
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.
Re: [HELP] How to make random passwords -
Wary - 27.05.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
Re: [HELP] How to make random passwords -
Charly123 - 27.05.2017
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
Re: [HELP] How to make random passwords -
Beckett - 28.05.2017
https://sampwiki.blast.hk/wiki/Random
Use that function in order to get a pseudo-random number and work your way around from that.
Re: [HELP] How to make random passwords -
CheezIt - 28.05.2017
Just generate a random number, save it to a variable and compare it when the user guesses the number.
Re: [HELP] How to make random passwords -
Charly123 - 28.05.2017
Can anyone show me any code? Pleasee
Re: [HELP] How to make random passwords -
StrikerZ - 28.05.2017
PHP код:
new password = random(9999);
Then use the password variable to compare it with the user's input text.
Re: [HELP] How to make random passwords -
Charly123 - 28.05.2017
Quote:
Originally Posted by Sunehildeep
PHP код:
new password = random(9999);
Then use the password variable to compare it with the user's input text.
|
Okay thank you very much! Now can you just give me information how to make random client messages like SendClientMessage(playerid, COLOR, "1234 5678 9101"); and that random password is 5678.. So that in message 5678 is red colour
Re: [HELP] How to make random passwords -
ratxrat - 28.05.2017
Код:
new a = random (9);
new b = random (9);
new c = random (9);
new d = random (9);
new e = random (9);
// use string
new result = ""+a+b+c+d+e;
// result can show 00130
// if use random(9999)
// result 1 to 9999