Guest Posted July 28, 2018 Posted July 28, 2018 Guys i wan't to disable using animation while driving a car i tried this code function restricAnimation (thePlayer, seat) cancelEvent() outputChatBox ("You can't use animations in vehicles ",seat) end addCommandHandler("anim", restricAnimation) addEventHandler ( "onVehicleEnter", getRootElement(), restricAnimation )
xMKHx Posted July 28, 2018 Posted July 28, 2018 function restricAnimation () local theVehicle = getPlayerOccupiedVehicle ( source ) if ( theVehicle ) then cancelEvent() outputChatBox ("You can't use animations in vehicles ",source) end end addCommandHandler("anim", restricAnimation) UDC:RPG Owner 13 Years Experience ______________________________________ Spoiler - ATM Robbery Script. - Police Shield Script - Army Animations Script - Criminal Skills Script - Drop Weapons Script
SycroX Posted July 28, 2018 Posted July 28, 2018 (edited) there's no event to cancel it so simply use return instead off cancelEvent addCommandHandler("anim", function(player) if isPlayerInVehicle(player) then outputChatBox("u can't use any animation while in vehicle", player, 255, 0, 0) return end --#your code end ) or try this way addEventHandler("onPlayerCommand", root, function(cmd) if cmd == "anim" then if isPedInVehicle(source) then outputChatBox("u can't use animations while in vehicle", source, 255, 0, 0) cancelEvent() end end end ) Edited July 28, 2018 by #َxLysandeR Chillin' with some demons, satans and vamps
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now