IntensePyjamas

https://forum.mtasa.com/topic/91243-simple-gate-script-accou

Dec 5th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. Open = false
  2.  
  3. function toggleFRWindow(thePlayer)
  4.     if isElement(thePlayer) then
  5.         local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
  6.         if isObjectinACL("user."..accName, "Admin") then
  7.             if Open == true then
  8.                 Open = false
  9.                 showCursor(thePlayer,false)
  10.                 triggerClientEvent ( thePlayer, "OpenOrClose", thePlayer,false)
  11.                 colorPicker.closeSelect()
  12.             elseif Open == false then
  13.                 Open = true
  14.                 showCursor(thePlayer,true)
  15.                 triggerClientEvent ( thePlayer, "OpenOrClose", thePlayer,true)
  16.             end
  17.         end
  18.     end
  19. end
  20. addCommandHandler('fr', toggleFRWindow)
  21.  
  22. function OpenOrCloseClient(Open)
  23.     if Open == true then
  24.         showAllWindows()
  25.     elseif Open == false then
  26.         hideAllWindows()
  27.         colorPicker.closeSelect()
  28.     end
  29. end
  30.  
  31. addEvent( "OpenOrClose", true )
  32. addEventHandler( "OpenOrClose", localPlayer, OpenOrCloseClient )
Add Comment
Please, Sign In to add comment