Cronoss Posted February 7, 2022 Posted February 7, 2022 I don't know what I'm missing, the console keeps sending to me a "[Expected player at argument 1, got nil" (bindkey part) function pararAnim(thePlayer, key, keyState) setPedAnimation(thePlayer) end bindKey( thePlayer, "space", "down", pararAnim ) server side
Cronoss Posted February 7, 2022 Author Posted February 7, 2022 I want the bindkey stops the animations I'm going to add function prueba(thePlayer) setPedAnimation(thePlayer, "finale", "fin_let_go", -1, false, false, false, false) end addCommandHandler("prueba", prueba) function pararAnim(thePlayer, key, keyState) setPedAnimation(thePlayer) end bindKey( thePlayer, "space", "down", pararAnim )
βurak Posted February 7, 2022 Posted February 7, 2022 2 minutes ago, Cronoss said: I want the bindkey stops the animations I'm going to add function prueba(thePlayer) setPedAnimation(thePlayer, "finale", "fin_let_go", -1, false, false, false, false) end addCommandHandler("prueba", prueba) function pararAnim(thePlayer, key, keyState) setPedAnimation(thePlayer) end bindKey( thePlayer, "space", "down", pararAnim ) here thePlayer argument is invalid use for loop to add all players addEventHandler("onResourceStart", resourceRoot, function() for _,thePlayer in ipairs(getElementsByType("player")) do bindKey(thePlayer, "space", "down", pararAnim) end end ) function prueba(thePlayer) setPedAnimation(thePlayer, "finale", "fin_let_go", -1, false, false, false, false) end addCommandHandler("prueba", prueba) function pararAnim(thePlayer, key, keyState) setPedAnimation(thePlayer) end if you want to add for single player you can put it inside prueba command i don't know how to use it 1
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