ok so this is what i have so far
function ulx.ggoto( calling_ply, target_ply )
if not calling_ply:IsValid() then
Msg( "You may not step down into the mortal world from console.\n" )
return
end
if ulx.getExclusive( calling_ply, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( calling_ply, calling_ply ), true )
return
end
if not target_ply:Alive() then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
return
end
if target_ply:Alive() then
Player:GodEnable()
return
end
if not calling_ply:Alive() then
ULib.tsayError( calling_ply, "You are dead!", true )
return
end
if target_ply:InVehicle() and calling_ply:GetMoveType() ~= MOVETYPE_NOCLIP then
ULib.tsayError( calling_ply, "Target is in a vehicle! Noclip and use this command to force a goto.", true )
return
end
local newpos = playerSend( calling_ply, target_ply, calling_ply:GetMoveType() == MOVETYPE_NOCLIP )
if not newpos then
ULib.tsayError( calling_ply, "Can't find a place to put you! Noclip and use this command to force a goto.", true )
return
end
if calling_ply:InVehicle() then
calling_ply:ExitVehicle()
end
local newang = (target_ply:GetPos() - newpos):Angle()
calling_ply:SetPos( newpos )
calling_ply:SetEyeAngles( newang )
calling_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
ulx.fancyLogAdmin( calling_ply, "#A godded and teleported to #T", target_ply )
end
local goto = ulx.command( CATEGORY_NAME, "ulx ggoto", ulx.ggoto, "!ggoto" )
ggoto:addParam{ type=ULib.cmds.PlayerArg, target="!^", ULib.cmds.ignoreCanTarget }
ggoto:defaultAccess( ULib.ACCESS_ADMIN )
ggoto:help( "God and Goto target." )
it is not working. I added this:
if target_ply:Alive() then
Player:GodEnable()
return
end