Advertisement
Guest User

Untitled

a guest
Aug 15th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. function enterExitInterior(source, key, state)
  2.     local x,y,z = getElementPosition(source)
  3.     for i=1, intCount,1 do
  4.         if(intData[i] ~= nil)then
  5.             outputChatBox("Du willst "..intData[i]["Name"].." betreten",source)
  6.             if(intData[i]["Erstellt"] == true) then
  7.                 if(getDistanceBetweenPoints3D (x,y,z, intData[i]["X"], intData[i]["Y"], intData[i]["Z"]) < 5)then
  8.                     setElementPosition(source, intData[i]["toX"], intData[i]["toY"], intData[i]["toZ"])
  9.                     setElementInterior(source, intData[i]["intID"])
  10.                     break
  11.                 end
  12.                
  13.                 if(getDistanceBetweenPoints3D (x,y,z, intData[i]["toX"], intData[i]["toY"], intData[i]["toZ"]) < 5)then
  14.                     setElementPosition(source, intData[i]["X"], intData[i]["Y"], intData[i]["Z"])
  15.                     setElementInterior(source, 0)
  16.                     break
  17.                 end
  18.             end
  19.         end
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement