Jump to content

طلب كودد


Recommended Posts

السلام وعليكم شبااب ان شاء الله بخير

ابي كود اسويه لي لوحة تطلع للادمنية و بس

يعني لي ياخذ رتبة لما مثلا يضغط ف2 تفتح له لوحة

و لي ماعندو رتبة ما تفتح له اللوحة

Link to comment

---ClientSide

function toggleGUI() 
    if guiGetVisible(Name) == true then 
        guiSetVisible(Name,false) 
        showCursor(false) 
    else 
        guiSetVisible(Name,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 

---ServerSide

addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"F3","down",showGUI) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
        bindKey(player,"F3","down",showGUI) 
    end 
end) 
  
function showGUI(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then 
        triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
    else 
    outputChatBox(" You Dont Have Access to This Panel",thePlayer,255,0,0) 
    end 
end 

Name -- غيرها لاسم النافذة اللي عندك

F3 --- ذا زر الفتح . .

Link to comment

المشكلة الان انا لوحة تفتح عندي بدون ما اضغط على رمز لي مسوي انا و ما تكسر تبقا معلقة

GUIEditor_Button = {} 
  
a = guiCreateWindow(175,97,529,430,".....",false) 
guiSetAlpha(a,1) 
a = guiCreateMemo(10,22,510,297,"......",false,a) 
a = guiCreateMemo(11,321,507,69,".........",false,a) 
a = guiCreateButton(12,392,493,29,".......",false,a) 
  
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
  
  
        guiSetVisible (a, false) 
  
  
  
function OpenWin() 
    if guiGetVisible ( a ) then    
       guiSetVisible ( a, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( a, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("F7", "down", OpenWin) 

ممكن مساعدة

Link to comment

كلنت

  
a = guiCreateWindow(175,97,529,430,".....",false) 
memo = guiCreateMemo(10,22,510,297,"......",false,a) 
button = guiCreateButton(12,392,493,29,".......",false,a) 
  
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"...",false) 
guiSetVisible (a, false) 
  
function toggleGUI() 
    if guiGetVisible(Name) == true then 
        guiSetVisible(Name,false) 
        showCursor(false) 
    else 
        guiSetVisible(Name,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 

سيرفر

addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"F7","down",showGUI) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
        bindKey(player,"F7","down",showGUI) 
    end 
end) 
  
function showGUI(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then 
        triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
    else 
    outputChatBox(" You Dont Have Access to This Panel",thePlayer,255,0,0) 
    end 
end 

#تم التحديث

Link to comment

آسف نسيت أعدل شي

جرب ذا

كلنت

window = guiCreateWindow(175,97,529,430,".....",false) 
guiWindowSetSizable(window, false) 
memo = guiCreateMemo(10,22,510,297,"......",false,window) 
button = guiCreateButton(12,392,493,29,".......",false,window) 
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"...",false, window) 
guiSetVisible (window, false) 
  
function toggleGUI() 
    if guiGetVisible (window ) then   
        guiSetVisible(window,false) 
        showCursor(false) 
    else 
        guiSetVisible(window,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 

السيرفر نفسه اللي أول

Link to comment
آسف نسيت أعدل شي

جرب ذا

كلنت

window = guiCreateWindow(175,97,529,430,".....",false) 
guiWindowSetSizable(window, false) 
memo = guiCreateMemo(10,22,510,297,"......",false,window) 
button = guiCreateButton(12,392,493,29,".......",false,window) 
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"...",false, window) 
guiSetVisible (window, false) 
  
function toggleGUI() 
    if guiGetVisible (window ) then   
        guiSetVisible(window,false) 
        showCursor(false) 
    else 
        guiSetVisible(window,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 

السيرفر نفسه اللي أول

و الله العضيم تبقا مفتوحة على طول

و بخرج من سيرفر و بدخل تفتح لوحدها -_-

Link to comment
المشكلة الان انا لوحة تفتح عندي بدون ما اضغط على رمز لي مسوي انا و ما تكسر تبقا معلقة

ممكن مساعدة

اخوي جرب حط الكلنت كذا :

GUIEditor_Button = {} 
addEventHandler("onClientResourceStart", root,  
   function() 
a = guiCreateWindow(175,97,529,430,".....",false) 
guiSetAlpha(a,1) 
guiSetVisible( a, false ) 
a = guiCreateMemo(10,22,510,297,"......",false,a) 
a = guiCreateMemo(11,321,507,69,".........",false,a) 
a = guiCreateButton(12,392,493,29,".......",false,a) 
  
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
end 
) 
  
function OpenWin() 
    if guiGetVisible ( a ) then    
       guiSetVisible ( a, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( a, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("F7", "down", OpenWin) 

والسيرفر حطه زي الكود الاول حق ماكس

Link to comment
المشكلة الان انا لوحة تفتح عندي بدون ما اضغط على رمز لي مسوي انا و ما تكسر تبقا معلقة

ممكن مساعدة

اخوي جرب حط الكلنت كذا :

GUIEditor_Button = {} 
addEventHandler("onClientResourceStart", root,  
   function() 
a = guiCreateWindow(175,97,529,430,".....",false) 
guiSetAlpha(a,1) 
guiSetVisible( a, false ) 
a = guiCreateMemo(10,22,510,297,"......",false,a) 
a = guiCreateMemo(11,321,507,69,".........",false,a) 
a = guiCreateButton(12,392,493,29,".......",false,a) 
  
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
end 
) 
  
  
  

والسيرفر حطه زي الكود الاول حق ماكس

؟؟؟؟؟؟؟

كله خطأ

الأخطاء هي

a = guiCreateWindow(175,97,529,430,".....",false) 
guiSetAlpha(a,1) 
guiSetVisible( a, false ) 
a = guiCreateMemo(10,22,510,297,"......",false,a) 
a = guiCreateMemo(11,321,507,69,".........",false,a) 
a = guiCreateButton(12,392,493,29,".......",false,a) 
كلها بأسم 
A 
???? 
  
function OpenWin() 
    if guiGetVisible ( a ) then    
       guiSetVisible ( a, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( a, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("F7", "down", OpenWin) 
  
لايوجد إيفنت علشان نسوي في ملف السيرفر تريقر 

Link to comment
آسف نسيت أعدل شي

جرب ذا

كلنت

window = guiCreateWindow(175,97,529,430,".....",false) 
guiWindowSetSizable(window, false) 
memo = guiCreateMemo(10,22,510,297,"......",false,window) 
button = guiCreateButton(12,392,493,29,".......",false,window) 
GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"...",false, window) 
guiSetVisible (window, false) 
  
function toggleGUI() 
    if guiGetVisible (window ) then   
        guiSetVisible(window,false) 
        showCursor(false) 
    else 
        guiSetVisible(window,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 

السيرفر نفسه اللي أول

و الله العضيم تبقا مفتوحة على طول

و بخرج من سيرفر و بدخل تفتح لوحدها -_-

أطرح الكلنت كامل

Link to comment

-- Client

    GUIEditor_Button = {} 
    addEventHandler("onClientResourceStart", root, 
       function() 
    a = guiCreateWindow(175,97,529,430,".....",false) 
    guiSetAlpha(a,1) 
    guiSetVisible( a, false ) 
    a = guiCreateMemo(10,22,510,297,"......",false,a) 
    a = guiCreateMemo(11,321,507,69,".........",false,a) 
    a = guiCreateButton(12,392,493,29,".......",false,a) 
      
    GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
    end 
    ) 
      
    function OpenWin() 
        if guiGetVisible ( a ) then   
           guiSetVisible ( a, false ) 
           showCursor(false) 
           guiSetInputEnabled(false) 
        else 
            guiSetVisible ( a, true ) 
            showCursor(true) 
            guiSetInputEnabled(true) 
      
        end 
    end 
    bindKey("F7", "down", OpenWin) 

--server

    addEventHandler("onPlayerJoin",root, 
    function () 
        bindKey(source,"F7","down",showGUI) 
    end) 
      
    addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for index, player in ipairs(getElementsByType("player")) do 
            bindKey(player,"F7","down",showGUI) 
        end 
    end) 
      
    function showGUI(thePlayer) 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Console")) then 
            triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
        else 
        outputChatBox(" You Dont Have Access to This Panel",thePlayer,255,0,0) 
        end 
    end 

اللوحة ما تضهر تماما

Link to comment
  
   GUIEditor_Button = {} 
    addEventHandler("onClientResourceStart", root, 
       function() 
    a = guiCreateWindow(175,97,529,430,".....",false) 
    guiSetAlpha(a,1) 
    guiSetVisible( a, false ) 
    a1 = guiCreateMemo(10,22,510,297,"......",false,a) 
    a2 = guiCreateMemo(11,321,507,69,".........",false,a) 
    a3 = guiCreateButton(12,392,493,29,".......",false,a) 
      
    GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
    end 
    ) 
  
function OpenWin() 
triggerServerEvent("OpenWin",getLocalPlayer()) 
end 
bindKey("F7", "down", OpenWin) 
  
addEvent("OpenWin", true) 
addEventHandler("OpenWin",root, 
function () 
if guiGetVisible(a) == false then 
guiSetVisible(a,true) 
showCursor(true) 
else 
guiSetVisible(a,false) 
showCursor(false) 
end 
end 
) 
  

  
addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Console")) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 
  

Link to comment
  
   GUIEditor_Button = {} 
    addEventHandler("onClientResourceStart", root, 
       function() 
    a = guiCreateWindow(175,97,529,430,".....",false) 
    guiSetAlpha(a,1) 
    guiSetVisible( a, false ) 
    a1 = guiCreateMemo(10,22,510,297,"......",false,a) 
    a2 = guiCreateMemo(11,321,507,69,".........",false,a) 
    a3 = guiCreateButton(12,392,493,29,".......",false,a) 
      
    GUIEditor_Button[1] = guiCreateButton(260,151,5,5,"",false) 
    end 
    ) 
  
function OpenWin() 
triggerServerEvent("OpenWin",getLocalPlayer()) 
end 
bindKey("F7", "down", OpenWin) 
  
addEvent("OpenWin", true) 
addEventHandler("OpenWin",root, 
function () 
if guiGetVisible(a) == false then 
guiSetVisible(a,true) 
showCursor(true) 
else 
guiSetVisible(a,false) 
showCursor(false) 
end 
end 
) 
  

  
addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Console")) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 
  

بس باقي اانو لما ااخش سيرفر و انا لسة ما سجلت اللوحة تضهر و ما تسكر

Link to comment

بس مقدر اسوي كل رتب ?

    addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin","Console",'LVL1','LVL2','LVL3','LVL4','LVL5','Ownar','Manger','Support','Leader')) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 

سويتو كدا و ما زبط رتبة ادمن + كونسل لي بيعملو

ممكن حل

Link to comment
    addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
  if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Admin' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Console' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL'1' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL2' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( ''LVL3' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL4' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL5' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Ownar' ) ) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 

Link to comment
    addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
  if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Admin' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Console' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL'1' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL2' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( ''LVL3' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL4' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL5' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Ownar' ) ) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 

كان بعض الاخطا فكودك صلحتهم بس ما زبط

  addEvent("OpenWin",true) 
    addEventHandler("OpenWin",getRootElement(), 
    function() 
      if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Admin' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Console' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL1' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL2' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL3' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL4' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL5' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Ownar' ) ) then 
    triggerClientEvent(source,"OpenWin",source) 
    end 
    end 
    ) 

Link to comment

:shock::shock::shock::shock:

نسيت أضيف

player

   addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function(player) 
  if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Admin' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Console' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL'1' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL2' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( ''LVL3' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL4' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'LVL5' ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Ownar' ) ) then 
triggerClientEvent(source,"OpenWin",source) 
end 
end 
) 

Link to comment
  
acl = {"Admin","Console","LVL1","LVL2","LVL3","LVL4","LVL5","Ownar","Manger","Support","Leader"} 
  
addEvent("OpenWin",true) 
addEventHandler("OpenWin",getRootElement(), 
function() 
for _, acl_ in ipairs (acl) do 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup(acl_)) then 
triggerClientEvent(source,"OpenWin",source) 
end 
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...