Sjoerdva97

Untitled

Jan 8th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. function teleportToMarker( thePlayer, commandName )
  2.     houseID = getElementDimension(thePlayer)
  3.     if not houseID or houseID == 0 then
  4.         outputChatBox( "This command only works inside an interior.", thePlayer, 255, 194, 14 )
  5.     else
  6.         local dbid, entrance, exit, type, interiorElement = findProperty( thePlayer, houseID )
  7.         local x, y, z = getElementPosition(thePlayer)
  8.         local difference = exit[INTERIOR_Z] - z
  9.         if exit and difference >= 2 then
  10.             setPlayerInsideInterior(interiorElement, thePlayer, exit)
  11.                    
  12.             exports["interior-manager"]:addInteriorLogs(dbid, commandName, thePlayer)
  13.                
  14.             outputChatBox( "Teleported to interior entrance.", thePlayer, 0, 255, 0 )
  15.             return true
  16.                
  17.         else
  18.             outputChatBox( "You are not bugged.", thePlayer, 255, 0, 0 )
  19.         end
  20.     end
  21. end
  22. addCommandHandler( "fallint", teleportToMarker )
Advertisement
Add Comment
Please, Sign In to add comment