Jump to content

Help me macro script


Recommended Posts

This gives an error. I want the macro to kick automatically as soon as it is pressed, but it doesn't work. Can you help me?

codes;

function handleOnPlayerACInfo( detectedACList, d3d9Size, d3d9MD5, d3d9SHA256 )
    for _,acCode in ipairs( detectedACList ) do
        if acCode == 31 or acCode == 32 or acCode == 1 or acCode == 4 or acCode == 5 or acCode == 6 or acCode == 7 or acCode == 11 or acCode == 17 or acCode == 21 then
        	kickPlayer( source, "Macro não é permitido no servidor." )
        end
    end
end

local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"}
function enableGlitches ()
   for _,glitch in ipairs(glitches) do)
   end 
end
addEventHandler ( "onResourceStart", getResourceRootElement ( ),enableGlitches)


function source ( source, command )
		local reload = aclReload() -- Reload the ACL
			if ( reload ) then -- Check it was reloaded successfully
			else -- If not, output it (line below)
				outputChatBox ( "An unknown error occured. Please check the ACL file exists.", source, 255, 0, 0 )
			end
	else -- If they're not an admin, output it (below)
		outputChatBox ( "You must be an admin to use this command!", source, 255, 0, 0 )
	end
end
addCommandHandler ( "reload", source )

 

Link to post

Hello and welcome to the forum!

I think that the event handler for "handleOnPlayerACInfo" is missing (which could be the cause) or maybe you didn't paste it here.

addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo)


Could you show what the error you get is?

Edited by SpecT
Link to post
14 minutes ago, SpecT said:

Merhaba ve foruma hoş geldiniz!

"HandleOnPlayerACInfo" için olay işleyicisinin eksik olduğunu düşünüyorum (nedeni bu olabilir) veya belki de buraya yapıştırmadınız.



Aldığınız hatanın ne olduğunu gösterebilir misiniz?

Here is the picture that gives this error
 
 
 
 
 
Link to post

The error says it all. You have useless/unexpected symbol that stops the code to load.
 

local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"}
function enableGlitches ()
   for _,glitch in ipairs(glitches) do
   end 
end
addEventHandler ( "onResourceStart", resourceRoot,enableGlitches)

 

Edited by SpecT
Link to post
3 minutes ago, mrkey82 said:



 
 
 
 
 

Can you remake the code for me? Please :(

4 minutes ago, SpecT said:

The error says it all. You have useless/unexpected symbol that stops the code to load.
 


local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"}
function enableGlitches ()
   for _,glitch in ipairs(glitches) do
   end 
end
addEventHandler ( "onResourceStart", resourceRoot,enableGlitches)

 

Can you remake the code for me? Please :(

Link to post
1 minute ago, SpecT said:


Size sabit bir tane gönderdim.

But the function doesn't work. Can you help me with this? I want the macro to kick automatically when it is used.

Link to post
2 minutes ago, mrkey82 said:

But the function doesn't work. Can you help me with this? I want the macro to kick automatically when it is used.

Did you try what I suggested at first ?


Add:

addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo)

 

Link to post

Try this:
 

function handleOnPlayerACInfo( detectedACList, d3d9Size, d3d9MD5, d3d9SHA256 )
	for _,acCode in ipairs( detectedACList ) do
		if acCode == 31 or acCode == 32 or acCode == 1 or acCode == 4 or acCode == 5 or acCode == 6 or acCode == 7 or acCode == 11 or acCode == 17 or acCode == 21 then
			kickPlayer( source, "Macro não é permitido no servidor." )
		end
	end
end
addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo)


local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"}
function enableGlitches ()
	for _,glitch in ipairs(glitches) do
		-- something
	end 
end
addEventHandler ( "onResourceStart", resourceRoot, enableGlitches)


function source ( source, command )
	local reload = aclReload() -- Reload the ACL
	if ( reload ) then -- Check it was reloaded successfully
		-- something
	else -- If not, output it (line below)
		outputChatBox ( "An unknown error occured. Please check the ACL file exists.", source, 255, 0, 0 )
	end
	--else -- If they're not an admin, output it (below)
		--outputChatBox ( "You must be an admin to use this command!", source, 255, 0, 0 )
	--end
end
addCommandHandler ( "reload", source )


 

Edited by SpecT
Link to post

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