Castillo Posted December 29, 2009 Posted December 29, 2009 hi, i made a door with a gui control with 3 buttons to open and close and i wanted to know if its posible to add a password if u know the password u can open door, if its posible can someone tell me how i should make it? thanks in advance San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Gamesnert Posted December 29, 2009 Posted December 29, 2009 It's possible, yes. Just do something like this server-side: password[door element here] = "password here" (or just use a non-synced setElementData, just try not to send it to the clients ) And client-side, you have an empty string. And each time a button is pressed, you add a character to the string. Then when the key is hit to send it, send the password to the server and use moveObject to move the door. Don't forget to send the door element too though, or it would be pretty useless. Probably not the best way, but as long as it's a way, it's a way. Projects: Slothbot | Maximap
Castillo Posted December 29, 2009 Author Posted December 29, 2009 thanks, i will try San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted December 30, 2009 Author Posted December 30, 2009 i dont understand this a litle more info? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
DakiLLa Posted December 30, 2009 Posted December 30, 2009 uhm, as i have undestood your first post, you could make an edit field on your gui window and then, when you click on the 'open' button, you check, what's written in this edit field, if it's correct, then your door is opening, if not - then nothing.. something like this: addEventHandler( 'onClientGUIClick', button_Open, function() if guiGetText( passwordEditField ) == 'somePassword' then triggerServerEvent( 'openDoor', getLocalPlayer() ); --open your door if password is correct else outputChatBox( 'Incorrect password' ); end; end , false );
Castillo Posted January 4, 2010 Author Posted January 4, 2010 i have made the door with password San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now