Advertisement
Sjoerdva97

Untitled

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