Jump to content

Disable animations


Recommended Posts

Hello community

i wan't to disable using animations while driving how ??

i tried this code 

function restricanim (thePlayer)
if ( isPedInVehicle (thePlayer) )  then
	cancelEvent()
outputChatBox ("You can't use animations while driving", 255,0,0)
	end
end
addCommandHandler ( "animation", restricanim )
addEventHandler( "OnPlayerVehicleEnter", root, restricanim )

i changed alot but nothing happened 

Link to comment
function onPreFunction(sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ...)
    local args = {...}
    if functionName == "setPedAnimation" and isElement(args[1]) then
        if isPedInVehicle(args[1]) then
            return 'skip'
        end
    end
end
addDebugHook("preFunction", onPreFunction, {"setPedAnimation"})

 

  • Thanks 1
Link to comment
  • MTA Anti-Cheat Team

You could also check if the

23 hours ago, Snakegold said:

 


function restricanim (thePlayer)
if ( isPedInVehicle (thePlayer) )  then
	cancelEvent()
outputChatBox ("You can't use animations while driving", 255,0,0)
	end
end
addCommandHandler ( "animation", restricanim )
addEventHandler( "OnPlayerVehicleEnter", root, restricanim )

 

This code doesn't make sense at all.. please post the part of your gamemode's code that allows players to play animations, rather than writing something that tries to intercept it externally. You should simply add some checks to the code that allows setting animations.

Link to comment
5 minutes ago, Dutchman101 said:

You could also check if the

This code doesn't make sense at all.. please post the part of your gamemode's code that allows players to play animations, rather than writing something that tries to intercept it externally. You should simply add some checks to the code that allows setting animations.

well we can simply use addDebugHook

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