Jump to content

استفسار بخصوص كود كلنت


Recommended Posts

هذا هو الكود

 

local client = {
    oldTick = getTickCount(),
    mouseKeys = {
        "mouse1",
        "mouse2",
        "mouse3",
        "mouse4",
        "mouse5",
        "mouse_wheel_up",
        "mouse_wheel_down"
    }
}

local isMouseKey = function(key)
	for k, v in pairs(client.mouseKeys) do
		if (key == k) then
			return true
		end
	end
	return false
end

local isFireKey = function(key)
	for k, v in pairs(getBoundKeys("fire")) do
		if (k == key) then
			return true
		end
	end
	return false
end

addEventHandler("onClientKey", root,
	function(key, state)

	local tick = getTickCount()

	if (isFireKey(key) and state) then
		if (isMouseKey(key) or tick - client.oldTick >= 100) then
			client.oldTick = tick
		else
			cancelEvent()
		end
	end
end)

 

ايش يسوي هذا الكود ووش وظيفة عمله ؟

Link to comment
5 hours ago, ALBANDER said:

وضح اكثر

مثل ما قال نكست ، هذا الكود يمنع السبام

فيه جزء من الكود يشوف هل  الوقت مابين الظغطة الأولى والثانية أكبر من 100 ms

ثم بعدها يكنسل الظغطة لو الوقت أقل

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