Jump to content

طلب كود :) ارجوا المساعدة


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...