Advertisement
Noneatme

Untitled

Aug 29th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local gate = createObject(3606 ,2227.6999511719,1247.9000244141,13.10000038147, 0, 0,5, 178.5 )
  2.  
  3. function open(thePlayer)
  4.     local x, y, z = getElementPosition(thePlayer)
  5.     local x2, y2, z2 = getElementPosition(gate)
  6.     if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 20) then
  7.         moveObject(gate, 2000, 2227.6999511719,1247.9000244141,5.6999998092651, 0, 0.5 , 178.5 )
  8.     else
  9.         outputChatBox("Du bist nicht nahe genug am Tor!", thePlayer, 255, 0, 0)
  10.     end
  11. end
  12. addCommandHandler("move", open)
  13.  
  14. function close(thePlayer)
  15.     local x, y, z = getElementPosition(thePlayer)
  16.     local x2, y2, z2 = getElementPosition(gate)
  17.     if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 20) then
  18.         moveObject(gate, 2000,2227.6999511719,1247.9000244141,13.10000038147, 0, 0,5, 178.5 )
  19.     else
  20.         outputChatBox("Du bist nicht nahe genug am Tor!", thePlayer, 255, 0, 0)
  21.     end
  22. end
  23. addCommandHandler("close", close)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement