Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gate = createObject(3606 ,2227.6999511719,1247.9000244141,13.10000038147, 0, 0,5, 178.5 )
- function open(thePlayer)
- local x, y, z = getElementPosition(thePlayer)
- local x2, y2, z2 = getElementPosition(gate)
- if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 20) then
- moveObject(gate, 2000, 2227.6999511719,1247.9000244141,5.6999998092651, 0, 0.5 , 178.5 )
- else
- outputChatBox("Du bist nicht nahe genug am Tor!", thePlayer, 255, 0, 0)
- end
- end
- addCommandHandler("move", open)
- function close(thePlayer)
- local x, y, z = getElementPosition(thePlayer)
- local x2, y2, z2 = getElementPosition(gate)
- if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 20) then
- moveObject(gate, 2000,2227.6999511719,1247.9000244141,13.10000038147, 0, 0,5, 178.5 )
- else
- outputChatBox("Du bist nicht nahe genug am Tor!", thePlayer, 255, 0, 0)
- end
- end
- addCommandHandler("close", close)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement