kevenvz Posted November 24, 2010 Posted November 24, 2010 Hello, I am back again Maybe you know me from my other tazer(I hated that one) I got now a new one. I got 1 problem. I thinkj it is in the serverside system. I wanted a timer of the player animation. You know that he is laying down on the floor for 2 seconds. The problem is he don't do the animation. WHat is wrong whit this code??? Client side: function tazer ( attacker, weapon ) if (attacker) and (weapon == 24) then triggerServerEvent ( "setAnim", source ) cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getRootElement(), tazer ) server side: function theAnim ( ) setPedAnimation( source, "ped", "FLOOR_hit_f") end function setAnim ( ) if not isPedInVehicle( player ) then setTimer(theAnim, source, 2000, 1 ) end end addEvent ( "setAnim", true ) addEventHandler ( "setAnim", getRootElement(), setAnim ) Thank you,
Static-X Posted November 24, 2010 Posted November 24, 2010 function tazer ( attacker, weapon ) if (attacker) and (weapon == 24) then local source = getLocalPlayer() triggerServerEvent ( "setAnim", source,source ) cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getRootElement(), tazer ) server side: function setAnim ( player ) if not isPedInVehicle( player ) then setTimer(setPedAnimation,2000,1, player,"ped", "FLOOR_hit_f") end end addEvent ( "setAnim", true ) addEventHandler ( "setAnim", getRootElement(), setAnim )
kevenvz Posted December 11, 2010 Author Posted December 11, 2010 Sorry for dubbel post. Don't work. I want it that if you shoot whit the tazer on somebody that he will do that animation for 3 seconds. Not that if I shoot him that he do that animation over 3 seconds.
Static-X Posted December 11, 2010 Posted December 11, 2010 I want it that if you shoot whit the tazer on somebody that he will do that animation for 3 seconds. Not that if I shoot him that he do that animation over 3 seconds. I don't get you. you mean if you shoot some one he will play the animation for 3 seconds?
Thehookerkiller01 Posted December 15, 2010 Posted December 15, 2010 He wants that if you shoot somebody, that it haves to begin at 0 sec, and the duration must be 3 seconds. And he says that it begins after 3 sec.
Discord Moderators Zango Posted December 15, 2010 Discord Moderators Posted December 15, 2010 yes but isn't that because he extends the function with setTimer? setTimer(theAnim, source, 2000, 1 ) secondly, he doesn't transfer any argument as player in the client>server trigger? The argument player in setAnim is void then use source instead addEvent ('setAnim', true) addEventHandler ('setAnim', root, function () setPedAnimation (source, 'ped', 'FLOOR_hit_f') end )
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