Jump to content

تصحيح خطأ


Recommended Posts

السلام عليكم

  
    addEventHandler("onClientGUIClick",resourceRoot, 
        function() 
        if  source == GUIEditor.button[6]  then 
        triggerServerEvent("yasTeam",localPlayer) 
        elseif  source == GUIEditor.button[7]  then 
        triggerServerEvent("noTeam",localPlayer) 
        end 
        end) 
      
      
     addEventHandler("onClientGUIClick",resourceRoot, 
        function() 
        if  source == GUIEditor.button[8] then 
        triggerServerEvent("AD",localPlayer) 
        elseif  source == GUIEditor.button[8] then 
        triggerServerEvent("noAD",localPlayer) 
        end 
        end) 

   
    addEvent("yasTeam",true) 
    addEventHandler("yesTeam", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            unbindKey(player, "y", "down", "chatbox", "Teamsay") 
      
    end 
    end ) 
      
    addEvent("noTeam",true) 
    addEventHandler("noTeam", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            bindKey(player, "y", "down", "chatbox", "Teamsay") 
      
    end 
    end ) 
      
    ------------------------------------------ 
      
      
    groups = { 
        "Console", 
        "Admin", 
        "SuperModerator", 
        "Moderator", 
        "Level 1", 
        "Level 2", 
        "Level 3", 
        "Level 4", 
        "Level 5", 
        "Level 6", 
        "Head.Admin", 
        "Owner", 
        "Leve16Plus", 
        "Level5Plus", 
        "Level4Plus", 
        "Level3Plus", 
        "Level2Plus", 
        "Level1Plus", 
        "AdminChat" 
    } 
      
    addCommandHandler("AdminChat", 
        function(player,cmd,...) 
            for theKey,theGroup in ipairs(groups) do 
                if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup(theGroup)) then 
                    for theKey,theGroup in ipairs(groups) do 
                        for theKey,thePlayer in ipairs(getElementsByType("player")) do 
                            if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup(theGroup)) then 
                                outputChatBox("(ADMIN) "..getPlayerName(player)..": #ffffff"..table.concat({...}," "),thePlayer,255,0,0,true) 
                            end 
                        end 
                        return 
                    end 
                end 
            end 
        end 
    ) 
      
    addEventHandler("onResourceStart",root, 
        function() 
            for theKey,thePlayer in ipairs(getElementsByType("player")) do 
                bindKey(thePlayer,"[","down","chatbox","AdminChat") 
            end 
        end 
    ) 
      
      
      
      
      
    --------------------------------------------------------------- 
      
    addEvent("AD",true) 
    addEventHandler("AD", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            unbindKey(player, "[", "down", "chatbox", "AdminChat") 
      
    end 
    end ) 
      
    addEvent("noAD",true) 
    addEventHandler("noAD", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            bindKey(player, "[", "down", "chatbox", "AdminChat") 
      
    end 
    end ) 
      

Link to comment
1464371312481.png

جرب هذا :

# Client side :

Cplayer = getLocalPlayer() 
  
addEventHandler( "onClientGUIClick", root, function(   ) 
    if  source == GUIEditor.button[6]  then 
    for i, player in pairs( getElementsByType( "player" ) ) do 
        unbindKey( "y", "down", "chatbox", "Teamsay" ) 
    end 
        elseif  source == GUIEditor.button[7]  then 
    for i, player in pairs(getElementsByType("player")) do 
        bindKey( "y", "down", "chatbox", "Teamsay" ) 
        end 
    end 
end ) 
      
      
addEventHandler( "onClientGUIClick", root, function(   ) 
    if  source == GUIEditor.button[8] then 
        triggerServerEvent( "AD", Cplayer ) 
        elseif  source == GUIEditor.button[8] then 
    triggerServerEvent( "noAD", Cplayer ) 
    end 
end ) 

# Server side :

------------------------------------------ 
      
      
    groups = { 
        "Console", 
        "Admin", 
        "SuperModerator", 
        "Moderator", 
        "Level 1", 
        "Level 2", 
        "Level 3", 
        "Level 4", 
        "Level 5", 
        "Level 6", 
        "Head.Admin", 
        "Owner", 
        "Leve16Plus", 
        "Level5Plus", 
        "Level4Plus", 
        "Level3Plus", 
        "Level2Plus", 
        "Level1Plus", 
        "AdminChat" 
    } 
      
    addCommandHandler("AdminChat", 
        function(player,cmd,...) 
            for theKey,theGroup in ipairs(groups) do 
                if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup(theGroup)) then 
                    for theKey,theGroup in ipairs(groups) do 
                        for theKey,thePlayer in ipairs(getElementsByType("player")) do 
                            if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup(theGroup)) then 
                                outputChatBox("(ADMIN) "..getPlayerName(player)..": #ffffff"..table.concat({...}," "),thePlayer,255,0,0,true) 
                            end 
                        end 
                        return 
                    end 
                end 
            end 
        end 
    ) 
      
    addEventHandler("onResourceStart",root, 
        function() 
            for theKey,thePlayer in ipairs(getElementsByType("player")) do 
                bindKey(thePlayer,"[","down","chatbox","AdminChat") 
            end 
        end 
    ) 
      
      
      
      
      
    --------------------------------------------------------------- 
      
    addEvent("AD",true) 
    addEventHandler("AD", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            unbindKey(player, "[", "down", "chatbox", "AdminChat") 
      
    end 
    end ) 
      
    addEvent("noAD",true) 
    addEventHandler("noAD", root, 
    function() 
        for i, player in pairs(getElementsByType("player")) do 
            bindKey(player, "[", "down", "chatbox", "AdminChat") 
      
    end 
    end ) 
      
Link to comment
  
--Client 
LPlayer = getLocalPlayer () 
  
function Fun( btn ,press )  
if btn == "y" and press then return cancelEvent ( ) end 
end 
function NotFun ( btn, press ) 
if btn == "]" and press then return cancelEvent ( ) end 
end 
addEventHandler("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[6]  then 
triggerServerEvent("All1",LPlayer) 
elseif source == GUIEditor.button[7] then  
triggerServerEvent("All3",LPlayer) 
end 
end 
) 
addEvent("All2",true) 
addEventHandler("All2",root, 
function () 
addEventHandler("onClientKey",root,Fun) 
end 
) 
addEvent("All4",true) 
addEventHandler("All4",root, 
function () 
removeEventHandler("onClientKey",root,Fun) 
end 
) 
Sedon = true; 
addEventHandler("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[8] and Sedon == true then 
  triggerServerEvent( "Dont", LPlayer ) 
  Sedon = false; 
elseif source == GUIEditor.button[8] and Sedon == false then 
    triggerServerEvent("See", LPlayer) 
    Sedon = true; 
end 
end 
) 
addEvent("Ok",true) 
addEventHandler("Ok",root, 
function () 
addEventHandler("onClientKey",root,NotFun) 
end 
) 
addEvent("Ok2",true) 
addEventHandler("Ok2",root, 
function () 
removeEventHandler("onClientKey",root,NotFun) 
end 
) 
-- Server 
  
addEvent("All1",true) 
addEventHandler("All1",root, 
function () 
for _,v in ipairs ( getElementsByType("player") ) do 
triggerClientEvent(v,"All2",v) 
end 
end 
) 
addEvent("All3",true) 
addEventHandler("All3",root, 
function () 
for _,i in ipairs ( getElementsByType("player") ) do 
triggerClientEvent(i,"All4",i) 
end 
end) 
addEvent("Dont",true) 
addEventHandler("Dont",root, 
function () 
for _,S in ipairs ( getElementsByType("player") ) do 
triggerClientEvent(S,"Ok",S) 
end 
end 
) 
addEvent("See",true) 
addEventHandler("See",root, 
function () 
for _,d in ipairs ( getElementsByType("player") ) do 
triggerClientEvent(d,"Ok2",d) 
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...