Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stopAnim(player)
- if (getElementData(player, "tazered") == true) then return end -- ( ) around getelementdata not necessary, just easier to read and -sometimes- prevent errors
- --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
- setPedAnimation(player)
- end
- -- then you gotta bind the key. in normal servers they do it when you join the server and/or login.
- addEventHandler("onPlayerJoin", getRootElement(), function()
- bindKey(source, "space", "down", stopAnim)
- end)
- addCommandHandler("bindnow", function(thePlayer)
- bindKey(source, "space", "down", stopAnim)
- end)
- function idk (atacker, attackerweapon, bodypart, loss)
- if attackerweapon == 23 then -- not sure if right tho
- attacked = source
- setElementFrozen (attacked, true)
- setPedAnimation (attacked, "crack", "crckidle1")
- setElementData(source, "tazered", true)
- outputChatBox("pt 1 works")
- setTimer (function ()
- setElementData(attacked, "tazered", false)
- setElementFrozen (attacked, false)
- outputChatBox("pt 2 works")
- end, 5000, 1)
- end
- end
- addEventaHandler( "onPlayerDamage", getRootElement (), idk )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement