Jump to content

طلب مساعدة


w7sH

Recommended Posts

السلام عليكم ورحمة الله وبركاتة 

كيف حالكم

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

عندي مود التاقات اذا كان واحد يحمل أو ماسجل مايظهر له تاق ما أدري وش المشكله

+ أبي اذا كان واحد يحمل يظهر له تاق خاص به

واذا كان محمل ومخلص يظهر له تاق حق رتبت Everyone

والمشكله الثانية ابي أضيف له منع التكرار يعني يكون فيه سبام اذا احد رسل يقول له أنتظر 5 ثواني عشان يرسل رسالة ثانيه

بس رتبت الكونسل ما أبي عليها أنتظار وباقي الرتب يكون فيها أنتظار

 

أبي مساعدكم لاهنتم هذا كود كلنكت.

 


function chatbox( text, type)
    if type == 2 then return end
    local acc = getPlayerAccount(source)
    if ChatDisabled then
        if not isGuestAccount ( acc ) then
            if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then 
                outputChatBox ( "No.", source, 255, 150, 0, true )
                cancelEvent ( ) 
                return 
            end
        else
            outputChatBox ( "No.", source, 255, 150, 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((getElementData(source,"teamColor") or "#ff0000").."* #FF0000[ Console#FF0000 ] " .. getPlayerName ( source ) .. ":#cccccc " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Console ] " .. getPlayerName ( source ) .. ": " .. text)

       elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Big.Admin")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox((getElementData(source,"teamColor") or "#CC0000").."*#CC0000 [ Big.Admin ] " .. getPlayerName ( source ) .. ":#FFCC00 " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Big.Admin ] " .. getPlayerName ( source ) .. ": " .. text)

    elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then
 cancelEvent()
        local r, g, b = getPlayerNametagColor(source)
        outputChatBox((getElementData(source,"teamColor") or "#cccccc").."*#cccccc [ #ffffff" .. getPlayerName ( source ) .. " #cccccc]:#FFFFFF " .. text, getRootElement(), r, g, b, true )
        outputServerLog("CHAT: [ Everyone ] " .. getPlayerName ( source ) .. ": " .. text)


end
end
)

 

Edited by w7sH
Link to comment

عندي , فكره لك

هذا الكود انا مسويه :

سرفر:

function Download ( msg,color)
    local Data = getElementData ( source, "Download" )
        if Data then
            outputChatBox('#666666(Downloading..) '.. getPlayerName(source) .. '#ffffff : '.. msg,root, r, g, b, true) 
            return cancelEvent() 
    end
end
addEventHandler ( "onPlayerChat",root, Download )



addEventHandler ( "onPlayerJoin", root,
    function ( )
        setElementData ( source, "Download", true )
    end
)

addEventHandler ( "onPlayerLogin", root,
    function ( )
        setElementData ( source, "Download", false )
    end
)

اذا الاعب دخل السرفر

تعطيه تاق داونلود

ولما يسجل الدخول

يشيل منه التاق 

بالتوفيق .

  • Like 2
Link to comment

جرب هالكود حصلته عندي

local antiSpam = {}

function Download ( msg,color)
    local Data = getElementData ( source, "Download" )
    if ( Data ) then
		if isElement(antiSpam[source]) then 
			outputChatBox("Stop spamming.",source, 255, 0, 0, true)
			return 
			cancelEvent() 
		end
		createAntiSpam(source, 10000)
		outputChatBox('#666666(Downloading..) '.. getPlayerName(source) .. '#ffffff : '.. msg,root, r, g, b, true) 
        return 
		cancelEvent() 
    end
end
addEventHandler ( "onPlayerChat",root, Download )



addEventHandler ( "onPlayerJoin", root,
    function ( )
        setElementData ( source, "Download", true )
    end
)

addEventHandler ( "onPlayerLogin", root,
    function ( )
        setElementData ( source, "Download", false )
    end
)

function createAntiSpam ( element, antiTime )
	if ( element ) and ( getElementType(element) == "player" ) then
		if isElement(antiSpam[element]) then return end
		antiSpam[element] = true
		setTimer ( function()
			if isElement(antiSpam[element]) then
				antiSpam[element] = false
				destroyElement(antiSpam[element])
			end
		end, tonumber(antiTime), 1 )
	end
end

 

Link to comment
local aTimer = {	}

function onPlayerChat_ ( aMsg , aType )

    local isPlayerLogin = isGuestAccount ( getPlayerAccount ( source ) )
	
    if ( isPlayerLogin ) then

	if ( isTimerPlayer ( source ) ) then
	
	outputChatBox("Stop spamming.",source, 255, 0, 0, true)
	
		return cancelEvent (	)
	end
	
	setTimerPlayer ( source , 10000 )
	
	outputChatBox('#666666(Downloading..) '.. getPlayerName(source) .. '#ffffff : '.. aMsg,root, r, g, b, true) 
			return cancelEvent (	) 
		end
	end
	
addEventHandler ( "onPlayerChat",root, onPlayerChat_ )

	function isTimerPlayer ( player )
	
		return isTimer ( aTimer [ player ] )
	end

	function setTimerPlayer ( element , aTimer_ )

	if ( getElementType( element ) ~= "player" ) then
	
		return
	end

	if ( isTimerPlayer ( element ) ) then
		
		return
	end
	
	aTimer [ element ] = setTimer( function (	) end , aTimer_ , 1 )
	
	end

addEventHandler ( "onPlayerQuit" , root , 

	function (	)
	
	if ( aTimer [ source ] ) then

	aTimer [ source ] = nil 
	
		end
	end
	)

 

  • Like 2
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...