Jump to content

استفسار في كود


Recommended Posts

اخي صحيح
التاج م يظهر زي م قولت 
+
انا مسوي مود قفل الشات لما اقفله م يرضي يقفل
الاكواد

التاج + غلق الشات

function chatbox( text, type)
	local acc = getPlayerAccount(source)
	if ChatDisabled then
		if not isGuestAccount ( acc ) then
			if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
				outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", source, 255, 0, 0, true )
				cancelEvent ( ) 
				return 
			end
		else
			outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", source, 255, 0, 0, true )
			cancelEvent()
			return
		end
	end	
	if isGuestAccount ( acc ) then return end
	local customTag = getAccountData ( acc, "customTag" )
	if customTag then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox(customTag.." " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( source ) .. ": " .. text)
		
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( source ) .. ":#a00000 " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( source ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( source ) .. ": " .. text)

 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( source ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( source ) .. ":#ffffff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( source ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( source ) .. ": " .. text)


       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( source ) .. ":#0099cc " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( source ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) .. ":#0099cc " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( source ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( source ) .. ":#ffffff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( source ) .. ": " .. text)

	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( source ) .. ": " .. text)


	elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox("" .. getPlayerName ( source ) .. ":#ffFFff " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( source ) .. ": " .. text)


   end
end
addEventHandler("onPlayerChat", getRootElement(), chatbox)

اخي

customTag

ذا تاج 

احطه انا من داخل السرفر

يعني بلوحه

احط فيها

الحساب

والتاج

فهمني

 

Edited by MA[S]RIY
Link to comment
addCommandHandler( "عام", function  ( plr, cmd, ... )
    local text = table.concat ( { ... }, " " )
        if not ( text or text == "" ) then return end
            local acc = getPlayerAccount(plr)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
                cancelEvent ( ) 
                return 
            end
        else
            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
            cancelEvent()
            return
        end
    end    
    if isGuestAccount ( acc ) then return end
    local customTag = getAccountData ( acc, "customTag" )
    if customTag then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)
        
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text)

 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)


       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)


    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)
   end
end )

addEventHandler ( "onResourceStart", resourceRoot, function (    )
    for k, v in ipairs ( getElementsByType ( "player" ) ) do
        unbindKey ( v, "t", "down", "chatbox", "say" )
        bindKey ( v, "t", "down", "chatbox", "عام" )
    end
end )

addEventHandler ( "onPlayerJoin", root, function (    )
        unbindKey ( plr, "t", "down", "chatbox", "say" )
    bindKey ( plr, "t", "down", "chatbox", "عام" )
end )

 

 

#Edit:

 

اعتذر انسخ هالكود :

addCommandHandler( "عام", function  ( plr, cmd, ... )
    local text = table.concat ( { ... }, " " )
        if not ( text or text == "" ) then return end
            local acc = getPlayerAccount(plr)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
                cancelEvent ( ) 
                return 
            end
        else
            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
            cancelEvent()
            return
        end
    end    
    if isGuestAccount ( acc ) then return end
    local customTag = getAccountData ( acc, "customTag" )
    if customTag then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)
        
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text)

 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)


       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)


    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)
   end
end )

addEventHandler ( "onResourceStart", resourceRoot, function (    )
    for k, v in ipairs ( getElementsByType ( "player" ) ) do
        unbindKey ( v, "t", "down", "chatbox", "say" )
        bindKey ( v, "t", "down", "chatbox", "عام" )
    end
end )

addEventHandler ( "onPlayerJoin", root, function (    )
        unbindKey ( source, "t", "down", "chatbox", "say" )
    bindKey ( source, "t", "down", "chatbox", "عام" )
end )
  1.  
Link to comment
4 hours ago, #,+( _xiRoc[K]; > said:

addCommandHandler( "عام", function  ( plr, cmd, ... )    local text = table.concat ( { ... }, " " )        if not ( text or text == "" ) then return end            local acc = getPlayerAccount(plr)    if ChatDisabled then        if not isGuestAccount ( acc ) then            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then                 outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )                cancelEvent ( )                 return             end        else            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )            cancelEvent()            return        end    end        if isGuestAccount ( acc ) then return end    local customTag = getAccountData ( acc, "customTag" )    if customTag then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)            elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)   endend )addEventHandler ( "onResourceStart", resourceRoot, function (    )    for k, v in ipairs ( getElementsByType ( "player" ) ) do        unbindKey ( v, "t", "down", "chatbox", "say" )        bindKey ( v, "t", "down", "chatbox", "عام" )    endend )addEventHandler ( "onPlayerJoin", root, function (    )        unbindKey ( plr, "t", "down", "chatbox", "say" )    bindKey ( plr, "t", "down", "chatbox", "عام" )end )

 

 

#Edit:

 

اعتذر انسخ هالكود :


addCommandHandler( "عام", function  ( plr, cmd, ... )    local text = table.concat ( { ... }, " " )        if not ( text or text == "" ) then return end            local acc = getPlayerAccount(plr)    if ChatDisabled then        if not isGuestAccount ( acc ) then            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then                 outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )                cancelEvent ( )                 return             end        else            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )            cancelEvent()            return        end    end        if isGuestAccount ( acc ) then return end    local customTag = getAccountData ( acc, "customTag" )    if customTag then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)            elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then cancelEvent()        local r, g, b = getPlayerNametagColor(plr)        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)   endend )addEventHandler ( "onResourceStart", resourceRoot, function (    )    for k, v in ipairs ( getElementsByType ( "player" ) ) do        unbindKey ( v, "t", "down", "chatbox", "say" )        bindKey ( v, "t", "down", "chatbox", "عام" )    endend )addEventHandler ( "onPlayerJoin", root, function (    )        unbindKey ( source, "t", "down", "chatbox", "say" )    bindKey ( source, "t", "down", "chatbox", "عام" )end )
  1.  

اخي 

اولا غلق الشات

يطلع لي النص حق تم غلق الشات ويطلع النص

p_559hvpr91.png

 

ثانيا التاج م رضي يظهر

وطلع لي بالدي بق

p_55929a8h1.png

هو ذا السكر

        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )

 

Edited by MA[S]RIY
Link to comment
12 minutes ago, MARIY said:

اخي 

اولا غلق الشات

يطلع لي النص حق تم غلق الشات ويطلع النص

p_559hvpr91.png

 

ثانيا التاج م رضي يظهر

وطلع لي بالدي بق

p_55929a8h1.png

هو ذا السكر


        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true )

 

 

اوه اعذرني نسيت احذف الاقواس حقت الروت لاني كنت مستبدل getRootElement ب root

 

جرب :

addCommandHandler( "عام", function  ( plr, cmd, ... )
    local text = table.concat ( { ... }, " " )
        if not ( text or text == "" ) then return end
            local acc = getPlayerAccount(plr)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
                cancelEvent ( ) 
                return 
            end
        else
            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
            cancelEvent()
            return
        end
    end    
    if isGuestAccount ( acc ) then return end
    local customTag = getAccountData ( acc, "customTag" )
    if customTag then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)
        
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text)

 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)


       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)


    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)
   end
end )

addEventHandler ( "onResourceStart", resourceRoot, function (    )
    for k, v in ipairs ( getElementsByType ( "player" ) ) do
        unbindKey ( v, "t", "down", "chatbox", "say" )
        bindKey ( v, "t", "down", "chatbox", "عام" )
    end
end )

addEventHandler ( "onPlayerJoin", root, function (    )
        unbindKey ( source, "t", "down", "chatbox", "say" )
    bindKey ( source, "t", "down", "chatbox", "عام" )
end )

 

Edited by #,+( _xiRoc[K]; >
Link to comment

جرب :
 

function rmv ( plr )
	for k, v in ipairs ( getEventHandlers ( "onPlayerChat", root ) ) do
		removeEventHandler ( "onPlayerChat", plr, v )
	end
end

addCommandHandler( "عام", function  ( plr, cmd, ... )
    local text = table.concat ( { ... }, " " )
        if not ( text or text == "" ) then return end
	rmv ( plr )
            local acc = getPlayerAccount(plr)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
                 cancelEvent ()
				rmv ( plr )
                return 
            end
        else
            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
            cancelEvent ()
		rmv ( plr )
            return
        end
    end    
    if isGuestAccount ( acc ) then return end
    local customTag = getAccountData ( acc, "customTag" )
    if customTag then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)
        
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text)

 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)


       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)


    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)
   end
end )

addEventHandler ( "onResourceStart", resourceRoot, function (    )
    for k, v in ipairs ( getElementsByType ( "player" ) ) do
        unbindKey ( v, "t", "down", "chatbox", "say" )
        bindKey ( v, "t", "down", "chatbox", "عام" )
    end
end )

addEventHandler ( "onPlayerJoin", root, function (    )
        unbindKey ( source, "t", "down", "chatbox", "say" )
    bindKey ( source, "t", "down", "chatbox", "عام" )
end )

 

Edited by #,+( _xiRoc[K]; >
Link to comment
12 hours ago, #,+( _xiRoc[K]; > said:

جرب :
 


function rmv ( plr )	for k, v in ipairs ( getEventHandlers ( "onPlayerChat", root ) ) do		removeEventHandler ( "onPlayerChat", plr, v )	endendaddCommandHandler( "عام", function  ( plr, cmd, ... )    local text = table.concat ( { ... }, " " )        if not ( text or text == "" ) then return end	rmv ( plr )            local acc = getPlayerAccount(plr)    if ChatDisabled then        if not isGuestAccount ( acc ) then            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then                 outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )                 cancelEvent ()				rmv ( plr )                return             end        else            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )            cancelEvent ()		rmv ( plr )            return        end    end        if isGuestAccount ( acc ) then return end    local customTag = getAccountData ( acc, "customTag" )    if customTag then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)            elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)   endend )addEventHandler ( "onResourceStart", resourceRoot, function (    )    for k, v in ipairs ( getElementsByType ( "player" ) ) do        unbindKey ( v, "t", "down", "chatbox", "say" )        bindKey ( v, "t", "down", "chatbox", "عام" )    endend )addEventHandler ( "onPlayerJoin", root, function (    )        unbindKey ( source, "t", "down", "chatbox", "say" )    bindKey ( source, "t", "down", "chatbox", "عام" )end )

 

لقيت اخي الكود 

كنت مكرر انا كود

تشكر اخي تعبتك معي

ويشكر الجميع 

تسلمو

Link to comment
addCommandHandler( "عام", function  ( plr, cmd, ... )
    local text = table.concat ( { ... }, " " )
        if not ( text or text == "" ) then return end
    cancelEvent ()
            local acc = getPlayerAccount(plr)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
                 cancelEvent ()
                return 
            end
        else
            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )
            cancelEvent ()
            return
        end
    end    
    if isGuestAccount ( acc ) then return end
    local customTag = getAccountData ( acc, "customTag" )
    if customTag then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)
        
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text)
 elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)
       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)
       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)
       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text)
 
elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)
    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 
        local r, g, b = getPlayerNametagColor(plr)
        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )
        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)
   end
end )

addEventHandler ( "onResourceStart", resourceRoot, function (    )
    for k, v in ipairs ( getElementsByType ( "player" ) ) do
        unbindKey ( v, "t", "down", "chatbox", "say" )
        bindKey ( v, "t", "down", "chatbox", "عام" )
    end
end )
addEventHandler ( "onPlayerJoin", root, function (    )
        unbindKey ( source, "t", "down", "chatbox", "say" )
    bindKey ( source, "t", "down", "chatbox", "عام" )
end )

 

Edited by #,+( _xiRoc[K]; >
Link to comment
20 hours ago, #,+( _xiRoc[K]; > said:

addCommandHandler( "عام", function  ( plr, cmd, ... )    local text = table.concat ( { ... }, " " )        if not ( text or text == "" ) then return end    cancelEvent ()            local acc = getPlayerAccount(plr)    if ChatDisabled then        if not isGuestAccount ( acc ) then            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then                 outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )                 cancelEvent ()                return             end        else            outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true )            cancelEvent ()            return        end    end        if isGuestAccount ( acc ) then return end    local customTag = getAccountData ( acc, "customTag" )    if customTag then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text)            elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text)       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text)    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then         local r, g, b = getPlayerNametagColor(plr)        outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true )        outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text)   endend )addEventHandler ( "onResourceStart", resourceRoot, function (    )    for k, v in ipairs ( getElementsByType ( "player" ) ) do        unbindKey ( v, "t", "down", "chatbox", "say" )        bindKey ( v, "t", "down", "chatbox", "عام" )    endend )addEventHandler ( "onPlayerJoin", root, function (    )        unbindKey ( source, "t", "down", "chatbox", "say" )    bindKey ( source, "t", "down", "chatbox", "عام" )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...