vector1 = 83.237251
vector2 = -414.578888
vector3 = -12223.580078
angle1 = 1.759990
angle2 = 150.339874
angle3 = 0.000000
function ulx.sit( calling_ply, target_ply )
--local vector = "2199.119385, -1950.238281, -12735.968750" --this is where you put the vector
--local angle = "12.319997, -40.999668, 0.000000" --this is where you put the angle
if not calling_ply:IsValid() then
Msg( "You are the console, you can't teleport or teleport others since you can't see the world!\n" )
return
end
if ulx.getExclusive( target_ply, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
return
end
if not target_ply:Alive() then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
return
end
local t = {}
-- t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
t.filter = target_ply
if target_ply ~= calling_ply then
t.filter = { target_ply, calling_ply }
end
local tr = util.TraceEntity( t, target_ply )
--[[
if target_ply == calling_ply and pos:Distance( target_ply:GetPos() ) < 64 then -- Laughable distance
return
end
]]
if target_ply:InVehicle() then
target_ply:ExitVehicle()
end
target_ply:SetPos( Vector( vector1, vector2, vector3 ) )
target_ply:SetPos( Angle( angle1, angle2, angle3 ) )
target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
if target_ply ~= calling_ply then
ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply ) -- We don't want to log otherwise
end
end
local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit"} )
sitc:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
sitc:defaultAccess( ULib.ACCESS_ADMIN )
sitc:help( "Teleports target to a sit." )