djharbi2 Posted April 2, 2018 Share Posted April 2, 2018 Client-Side addEventHandler("onClientKey",getRootElement(), function(button,press) if press then if (button == "lalt" and getKeyState("k")) or (button == "k" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"up") elseif (button == "lalt" and getKeyState("o")) or (button == "o" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"sit") end end end) Server-Side addEvent("command:execute",true) addEventHandler("command:execute",resourceRoot, function(position) if position=="sit" then animationCommand() elseif position=="up" then animationCommand2() end end) function animationCommand ( source ) setPedAnimation ( source, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( source ) setPedAnimation ( source ) end your bass is not working, so I did not help pls Link to comment
Moderators IIYAMA Posted April 2, 2018 Moderators Share Posted April 2, 2018 animationCommand(client) animationCommand2(client) function animationCommand ( player ) setPedAnimation ( player, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( player ) setPedAnimation ( player ) end Do not abuse the source variable. 1 Link to comment
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