Rockyz Posted August 9, 2015 Author Share Posted August 9, 2015 Client side # local pass = 000000 win = guiCreateWindow (...) btn = guiCreateButton (...) edit = guiCreateEdit (...) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == btn) then local text = guiGetText (edit) if getElementData (localPlayer, "open") ~= true then if (text ~= "") then if (text == pass) then guiSetVisible (win, true) showCursor (true) triggerServerEvent ("SavePassword", localPlayer) else outputChatBox ("Wrong password.", 255, 0, 0) end end else guiSetVisible (win, true) showCursor (true) end end end ) Server side # addEvent ("SavePassword", true) addEventHandler ("SavePassword", root, function () local acc = getPlayerAccount (source) if not isGuestAccount (acc) then setAccountData (acc, "Pass", true) end end ) addEventHandler ("onPlayerLogin", root, function (_, acc) if getAccountData (acc, "Pass") == true then setElementData (source, "open", true) end end ) مشكور ماتقصر Link to comment
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