Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 )
blip = createBlip (-302.21, 1507.3, 75, 56)
window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false)
guiSetVisible (window , false )
edit = guiCreateEdit(82, 70, 150, 34, "", false, window )
button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window )
label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window )
local Pass = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
Pass = Pass[math.random(#Pass)]
addEventHandler("onClientMarkerHit",Marker,
function (player)
if player ~= localPlayer then return end
guiSetVisible(window, true)
showCursor(true)
end)
addEventHandler("onClientMarkerLeave", Marker,
function (player)
Pass = Pass[math.random(#Pass)]
end
)
addEventHandler('onClientGUIClick', button,
function ()
if guiGetText ( edit ) == Pass then
triggerServerEvent('open', localPlayer)
guiSetVisible ( window , false )
showCursor ( false )
outputChatBox('Welcome!',255,0,0,true)
else
--guiSetVisible ( window , false )
--showCursor ( false )
outputChatBox('Error!',255,0,0,true)
end
end, false )