Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1.  
  2. function stopAnim(player)
  3. if (getElementData(player, "tazered") == true) then return end -- ( ) around getelementdata not necessary, just easier to read and -sometimes- prevent errors
  4. --if getElementData(player, "tazered" ~= true then -- this does the same thing as what the above line does. You can choose yourself what you wanna do
  5. setPedAnimation(player)
  6. end
  7. -- then you gotta bind the key. in normal servers they do it when you join the server and/or login.
  8. addEventHandler("onPlayerJoin", getRootElement(), function()
  9. bindKey(source, "space", "down", stopAnim)
  10. end)
  11.  
  12. addCommandHandler("bindnow", function(thePlayer)
  13. bindKey(source, "space", "down", stopAnim)
  14. end)
  15.  
  16.  
  17.  
  18.  
  19. function idk (atacker, attackerweapon, bodypart, loss)
  20. if attackerweapon == 23 then -- not sure if right tho
  21. attacked = source
  22. setElementFrozen (attacked, true)
  23. setPedAnimation (attacked, "crack", "crckidle1")
  24. setElementData(source, "tazered", true)
  25. outputChatBox("pt 1 works")
  26. setTimer (function ()
  27. setElementData(attacked, "tazered", false)
  28. setElementFrozen (attacked, false)
  29. outputChatBox("pt 2 works")
  30. end, 5000, 1)
  31. end
  32. end
  33.  
  34.  
  35. addEventaHandler( "onPlayerDamage", getRootElement (), idk )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement