LucasBaker Posted October 22, 2014 Share Posted October 22, 2014 Hello because SetTimer not working? is to stop the animation after 2 seconds dMarker = createMarker(2251.50732, 2489.24927, 10.99080, 'cylinder', 2.0, 255, 0, 0, 150) function cDrogas(source) if isElementWithinMarker(source, dMarker) then outputChatBox("[sERVER] Você usou drogas ", source) setPedAnimation ( source, "CRACK", "Bbalt_Idle_02") setElementHealth ( source, getElementHealth(source) - 1 ) setPedArmor ( source, getPedArmor(source)+4 ) setTimer ( function() setPedAnimation(source) outputChatBox("[sERVER] Efeito das drogas passou", source) end, 5000, 1 ) else outputChatBox("[sERVER] Você não está no marker", source) end end addCommandHandler("usardrogas", cDrogas) Link to comment
Moderators IIYAMA Posted October 22, 2014 Moderators Share Posted October 22, 2014 setPedAnimation(source,false) 2 seconds is 2000 ms not 5000 ms. Link to comment
LucasBaker Posted October 22, 2014 Author Share Posted October 22, 2014 setPedAnimation(source,false) 2 seconds is 2000 ms not 5000 ms. the animation is not going to enter / usardrogas Link to comment
TAPL Posted October 22, 2014 Share Posted October 22, 2014 You need to pass the source into the timer. Link to comment
LucasBaker Posted October 22, 2014 Author Share Posted October 22, 2014 You need to pass the source into the timer. animation not to setTimer ( function(source) setPedAnimation( source, false) outputChatBox("[sERVER] Efeito das drogas passou", source) end, 2000, 1 ) Link to comment
Saml1er Posted October 22, 2014 Share Posted October 22, 2014 setTimer ( function(source) setPedAnimation( source, false) outputChatBox("[sERVER] Efeito das drogas passou", source) end, 2000, 1 ,source ) Link to comment
LucasBaker Posted October 23, 2014 Author Share Posted October 23, 2014 setTimer ( function(source) setPedAnimation( source, false) outputChatBox("[sERVER] Efeito das drogas passou", source) end, 2000, 1 ,source ) worked ... 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