Guest User

Untitled

a guest
Jul 18th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local Jail = createObject(974, 1019.4799804688,-314.10998535156, 65.069999694824, 0, 0, 180)
  2. local Keyrb1 = createObject(2886, 1016.3699951172,-315.26, 74.379997253418, 0, 0, 360)
  3. local Jailstatus = 0
  4. local Jailtime = 0
  5.  
  6. function resetJailRedbrothers()
  7. Jailtime = 0
  8. Jailstatus = 0
  9. end
  10.  
  11. addEventHandler("onElementClicked", Keyrb1, function(theButton, theState, thePlayer)
  12. if (theState == "down") and (theButton == "left") then
  13. if (getDistanceBetweenElements(thePlayer, source) > 15) then return end
  14. if(getPlayerFraktion(thePlayer) ~= 6) then return end
  15. if(Jailtime == 1) then return end
  16. if(Jailstatus == 0) then
  17. Jailtime = 1
  18. Jailstatus = 1
  19. local X, Y, Z = getElementPosition(Jail)
  20. moveObject(Jail, 1000, X, Y, Z-3, 0, 0, 0, "InOutQuad")
  21. setTimer(resetJailRedbrothers, 1100, 1)
  22. else
  23. Jailtime = 1
  24. Jailstatus = 0
  25. local X, Y, Z = getElementPosition(Jail)
  26. moveObject(Jail, 1000, X, Y, Z+3, 0, 0, 0, "InOutQuad")
  27. setTimer(resetJailRedbrothers, 1100, 1)
  28. end
  29. end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment