Jump to content

تم الأفادة مشكور تابل + عاشق الشرق > زر فتح لوحة خاص للأدمن


Recommended Posts

السلام عليكم

وش الخطأ في الكود

جربته على اكثر من لوحة ماضبط

Client Side

bindKey("f3","down", 
    function() 
        triggerServerEvent("checkAdmin",localPlayer) 
    end 
) 
  
addEvent("showingWindow",true) 
addEventHandler("showingWindow",localPlayer, 
    function() 
        if(guiGetVisible(GUIEditor_Window[1])==false)then 
            guiSetVisible(GUIEditor_Window[1],true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1],false) 
            showCursor(true) 
        end 
    end 
) 
  

Server Side

addEvent("checkAdmin",true) 
addEventHandler("checkAdmin",root, 
    function() 
        local acc=getPlayerAccount(client) 
        if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Admin")) 
            triggerClientEvent(client,"showingWindow",client) 
        end 
    end 
) 

Meta Xml

    

debugscript 3

[2012-12-23 23:36:27] ERROR: Client triggered serverside event checkAdmin, but event is not added serverside 
  
[2012-12-23 23:35:42] SCRIPT ERROR: Police_panel\Server.lua:6: ')' expected (to close '(' at line 5) near 'triggerClientEvent' 
  
[2012-12-23 23:35:42] WARNING: Loading script failed: Police_panel\Server.lua:6: ')' expected (to close '(' at line 5) near 'triggerClientEvent' 

Edited by Guest
Link to comment

في ملف السيرفر سطر 5

وقوس then ناقص كلمة

if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Admin")) 

التعديل

if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Admin"))) then 

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...