Jump to content

طلب كود بسرعه


Adham

Recommended Posts

كذا؟
groupAdmins = {"Console","Admin"} -- حط القروبات اللي تمسح و يكون البوتون عندها مفتوح 
  
function isPlayerAdmin(  player  ) 
    local aPlayerAccount = getPlayerAccount( player ) 
    if ( not aPlayerAccount or isGuestAccount( aPlayerAccount ) ) then return false end 
    local aPlayerAccountName=getAccountName(aPlayerAccount) 
    for _ , Group in ipairs (   groupAdmins   ) do 
        if isObjectInACLGroup("user."..aPlayerAccountName, aclGetGroup(Group)) then 
            return true 
        end 
    end 
end 
  
addEventHandler("onPlayerLogin",root, 
function () 
if isPlayerAdmin(source)  
setElementData ( source ) 
end   
   end 
   ) 
    
if getElementData(source)  
guiSetEnabled(button, true)  
  
  
addEventHandler("onResourceStart",root, 
function () 
for _ , players in ipairs(getElementsByType("player")) do -- جيب كل اللاعبين 
if isPlayerAdmin(v) - 
 setElementData(v)  
end 
end) 

انت نسخت الشرح بس وحطيته

سيرفر

groupAdmins = {"Console","Admin"} -- حط القروبات اللي تمسح و يكون البوتون عندها مفتوح 
  
function isPlayerAdmin(  player  ) 
    local aPlayerAccount = getPlayerAccount( player ) 
    if ( not aPlayerAccount or isGuestAccount( aPlayerAccount ) ) then return false end 
    local aPlayerAccountName=getAccountName(aPlayerAccount) 
    for _ , Group in ipairs (   groupAdmins   ) do 
        if isObjectInACLGroup("user."..aPlayerAccountName, aclGetGroup(Group)) then 
            return true 
        end 
    end 
end 
  
addEventHandler("onPlayerLogin",root, 
    function () 
        if isPlayerAdmin(source)  then 
            setElementData ( source, "isAdmin", true ) 
        end   
   end 
) 
  
  
addEventHandler("onPlayerLogout",root, 
    function () 
        if isPlayerAdmin(source)  then 
            setElementData ( source, "isAdmin", false ) 
        end   
   end 
) 
  
  
  
addEventHandler("onResourceStart",root, 
    function () 
        for _ , v in ipairs(getElementsByType("player")) do -- جيب كل اللاعبين 
            if isPlayerAdmin(v) then 
               setElementData(v, "isAdmin", true)  
            end 
        end 
    end 
) 
  
function clearChat() 
    local name = getPlayerName(source) 
    for _ , v in ipairs(getElementsByType("player")) do 
        triggerClientEvent(v, "clearrows", v, name) 
    end 
end 
  
addEvent("clearChat", true) 
addEventHandler("clearChat", root, clearChat) 
  

كلنت

دور بالكلنت على كلمة

GridList

و استبدلها بإسم القريد لست حق الشات

  
addEventHandler("onClientGUIClick", root, 
    function() 
        if source == GUIEditor.button[1] then 
            local text = guiGetText(GUIEditor.edit[1]) 
            if getElementData(localPlayer, "isAdmin") then 
                if text == "clr" then 
                    triggerServerEvent("clearChat", localPlayer) 
                end 
            end 
        end 
    end 
) 
  
function clearChat(name) 
    if guiGridListClear(GridList) then 
        local row = guiGridListAddRow(GridList) 
        local text = name:gsub("#%x%x%x%x%x%x","").." Cleared Chat " 
        local t=guiGridListSetItemText(GridList, row, 1, text, false, false) 
        guiGridListSetItemColor(GridList, row, 1, 255, 0, 0) 
    end 
end 
  
addEvent("clearrows", true) 
addEventHandler("clearrows", root, clearChat) 

Link to comment
اشتغلت

بس ابي تعملي

البيتون

يتقفل

ويتفتح ل النا محدد القروبات

اي بوتون ؟

سوي كذا يوم يفتح اللوحه

يوم تحط للوحة كذا

guiSetVisible(اسم اللوحة,true)

يوم تسوي ذي ^

حط ذا ال3 اسطر تحتها

if getElementData(localPlayer, "isAdmin") then 
     guiSetEnabled(اسم الزر الي تبي تفتحه للادمن,true) 
end 

طبعا لازم تسوي

guiSetEnabled(اسم الزر,false)

بالحدث ذا

onClientResourceStart

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

Link to comment
كذا؟

وملحوظه ذا سرفر

addEventHandler("onClientResourceStart",root, 
fuction () 
if getElementData(localPlayer, "isAdmin") then 
     guiSetEnabled(button,true) 
end 
end 
) 

سلامات اسم الحدث كلنت :lol: !!

تحطه سيرفر ليه , حطه بكلنت و عدل

fuction > function

وعدل ذا

guiSetEnabled(button,true) > guiSetEnabled(button,false)

Link to comment
ول

حطيطه قفل للكل

addEventHandler("onClientResourceStart",root, 
function () 
if getElementData(localPlayer, "isAdmin") then 
guiSetEnabled(GUIEditor.button[3],false) 
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...