Jump to content

Help me macro script


mrkey82

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 comment

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 comment

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

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