ID:160602
 
turf
tile3
icon = 'General.dmi'
icon_state = "tile3"
density = 1
verb
Access_Computer()


How do you code a passcode so when someone accesses the comp they need to input the password. For the example just use the password 2233. Lol thanks
Is this a password the user can set, or one that you'd like to be constant?
In response to Stephen001
constant
In response to Monti
obj/bloop
var/const/password = "SUPERPASS123!@#"
verb/Access()
if((input("Password") as password) == password)
usr << "You gain access."
In response to Monti
Just generate a random number.

proc/Gen_Pass(l=5) // l = the length of the pass
var/pass = "" //set the pass as "" so text can be added
for(l,l>0,l--) pass = "[pass][rand(0,9)]" //while l is greater than 0, generate
//a number from 0 to 9 and add it to
//the password
return pass //set the value of this proc to the password. Then subtract 1
//from l


You should get it.
In response to Popisfizzy
could you put that in the code I submitted? Because when I do it it doesnt work. I must be putting it with my code wrong
In response to Monti
You're supposed to learn from his example, not copy and paste. Of course he wouldn't put it in your code!