• Spectating Script?
    11 replies, posted
Been looking for a while, can't seem to find any good, working first person spectate mods, not which can actually select which player you wan't to spectate. Maybe I haven't looked hard enough, but hopefully somebody can give me a link. =)
try gew gull
Anyone?
I also need one-bump
This is from falcos small scripts that he made Is this what you are talking about? If the player or props that are not in render view it will not show [QUOTE]local IsSpectating = false local holding = {} local SpectatePosition = Vector(0,0,0) local CanMove = true // for if you're in an object you mustn't be able to move local SaveAngles = Angle(0,0,0) // Only used when spectating an object local SpecEnt = LocalPlayer() local speed = 15 local SpecEntSaveAngle = Angle(0,0,0) local camsdata = {} local camsize = CreateClientConVar("Falco_SpecScreenSize", 5, true, false) local LockMouse = CreateClientConVar("Falco_SpecLockMouse", 0, true, false) local SpecSpeed = CreateClientConVar("Falco_SpecSpeed", 50, true, false) local ThPDist = 100 local SpecAng = Angle(0,0,0) local IsPlayer = false local function SelectSomeone()//DONT SAY IT'S STOLEN FROM THE GODDAMN PLAYER POSSESSOR SWEP! I GODDAMN MAAAAADE THE PLAYER POSSESSOR SWEP! holding = {} if table.Count(player.GetAll()) <= 1 then fnotify("You're the only one in the server") return end local frame = vgui.Create("DFrame") local button = {} local PosSize = {} frame:SetSize( 200, 500 ) frame:Center() frame:SetVisible(true) frame:MakePopup() frame:SetTitle("Choose a player") PosSize[0] = 5 local sorted = player.GetAll() table.sort(sorted, function(a, b) return a:Nick() < b:Nick() end ) for k,v in pairs(sorted) do if v == LocalPlayer() then PosSize[k] = PosSize[k-1] elseif v!= LocalPlayer() then PosSize[k] = PosSize[k-1] + 30 frame:SetSize(200, PosSize[k] + 40) button[k] = vgui.Create("DButton", frame) button[k]:SetPos( 20, PosSize[k]) button[k]:SetSize( 160, 20 ) button[k]:SetText( v:Nick()) frame:Center() button[k]["DoClick"] = function() if not ValidEntity(v) then fnotify("Can't spectate him at the moment") return end if ValidEntity(SpecEnt) then SpecEnt:SetNoDraw(false) end CanMove = false SpecEnt = v IsPlayer = true end end end end local function OptionsDerma() local frame = vgui.Create( "DFrame" ) frame:SetTitle( "Spectate config" ) frame:SetSize( 300, 300 ) frame:Center() frame:SetVisible( true ) frame:MakePopup( ) local Panel = vgui.Create( "DPanelList", frame ) Panel:SetPos(20,30) Panel:SetSize(260, 260) Panel:SetSpacing(5) Panel:EnableHorizontal( false ) Panel:EnableVerticalScrollbar( true ) local SelectPerson = vgui.Create( "DButton", frame) SelectPerson:SetText( "Select someone to spectate" ) SelectPerson:SetSize(220, 20) function SelectPerson:DoClick() frame:Close() SelectSomeone() end Panel:AddItem(SelectPerson) local makescreen = vgui.Create( "DButton", frame) makescreen:SetText( "Make a screen" ) makescreen:SetSize(220, 20) function makescreen:DoClick() if CanMove then table.insert(camsdata, {pos = SpectatePosition, ang = LocalPlayer():EyeAngles(), obj = false}) elseif not CanMove then table.insert(camsdata, {obj = SpecEnt, dist = ThPDist, ang = SaveAngles, entang = SpecEntSaveAngle}) end fnotify("Screen made") frame:Close() end Panel:AddItem(makescreen) local RemoveScreen = vgui.Create( "DButton", frame) RemoveScreen:SetText( "Remove last screen" ) RemoveScreen:SetSize(220, 20) function RemoveScreen:DoClick() if #camsdata > 0 then table.remove(camsdata, #camsdata) // remove the last one in the table fnotify("Last screen removed") end end Panel:AddItem(RemoveScreen) if not CanMove and SpecEnt:IsValid() then local AddFESP = vgui.Create( "DButton", frame) AddFESP:SetText( "Add to FESP" ) AddFESP:SetSize(220, 20) function AddFESP:DoClick() FESPAddEnt(SpecEnt, SpecEnt:EntIndex()) end Panel:AddItem(AddFESP) local RemoveFESP = vgui.Create( "DButton", frame) RemoveFESP:SetText( "Remove from FESP" ) RemoveFESP:SetSize(220, 20) function RemoveFESP:DoClick() FESPRemoveEnt(SpecEnt:EntIndex()) end Panel:AddItem(RemoveFESP) end local ScreenSize = vgui.Create( "DNumSlider", frame ) ScreenSize:SetValue(camsize:GetInt()) ScreenSize:SetConVar("Falco_SpecScreenSize") ScreenSize:SetMin(1) ScreenSize:SetMax(20) ScreenSize:SetText("Set the screensize") ScreenSize:SetDecimals(2) Panel:AddItem(ScreenSize) local specspeedsldr = vgui.Create( "DNumSlider", frame ) specspeedsldr:SetValue(SpecSpeed:GetInt()) specspeedsldr:SetConVar("Falco_SpecSpeed") specspeedsldr:SetMin(1) specspeedsldr:SetMax(200) specspeedsldr:SetText("Set the spectate speed") specspeedsldr:SetDecimals(0) Panel:AddItem(specspeedsldr) local LockMousechkbx = vgui.Create( "DCheckBoxLabel", frame ) LockMousechkbx:SetText("Lock mouse when spectating non-player") LockMousechkbx:SetConVar("Falco_SpecLockMouse") Panel:AddItem(LockMousechkbx) end local function BindPresses(ply, bind, pressed) local use = LocalPlayer():KeyDown(IN_USE) if (string.find(bind, "forward") or string.find(bind, "moveleft") or string.find(bind, "moveright") or string.find(bind, "back") or string.find(bind, "jump") or string.find(bind, "duck")) and not use then holding[string.sub(bind, 2)] = pressed return true elseif string.find(bind, "speed") and pressed and not use then if speed <= 15 then speed = 50 elseif speed == 50 then speed = 15 end return true elseif string.find(bind, "walk") and pressed and not use then if speed ~= 2 then speed = 2 elseif speed == 2 then speed = 15 end return true elseif string.find(bind, "invprev") and pressed and not use then ThPDist = ThPDist - 10 return true elseif string.find(bind, "invnext") and pressed and not use then ThPDist = ThPDist + 10 return true elseif string.find(bind, "menu") and not string.find(bind, "context") and pressed then if not use then OptionsDerma() fnotify("Hold use + Q to open the spawnmenu while spectating") return true end elseif string.find(bind, "attack2") and pressed and not use then if SpecEnt and SpecEnt:IsPlayer() then IsPlayer = not IsPlayer return true end elseif string.find(bind, "reload") and pressed and not use then if CanMove then local Tracey = {} Tracey.start = SpectatePosition Tracey.endpos = SpectatePosition + SpecAng:Forward() * 100000000 Tracey.filter = LocalPlayer() // in case you're aiming at yourself... IF that's even possible but I can't be arsed to test that local trace = util.TraceLine(Tracey) if trace.Hit and trace.Entity and ValidEntity(trace.Entity) and not trace.Entity:IsPlayer() then CanMove = false SpectatePosition = trace.Entity:LocalToWorld(trace.Entity:OBBCenter()) SaveAngles = SpecAng//LocalPlayer():GetAimVector():Angle() SpecEntSaveAngle = trace.Entity:EyeAngles() SpecEnt = trace.Entity fnotify("Now spectating an entity") print("-----------------------------SPECTATING ENT INFO: -----------------------------------------------") print("Classname: ", trace.Entity:GetClass()) print("Model: ", trace.Entity:GetModel()) print("Owner: ", trace.Entity:GetNWString("Owner")) print("Distance to self: ", math.floor(trace.Entity:GetPos():Distance(LocalPlayer():GetPos()))) print("Colour: ", trace.Entity:GetColor()) print("ENT Index: ", trace.Entity:EntIndex()) print("-----------------------------END OF ENT INFO: -----------------------------------------------") elseif trace.Hit and trace.Entity and ValidEntity(trace.Entity) and trace.Entity:IsPlayer() then print("-----------------------------SPECTATING ENT INFO: -----------------------------------------------") print("name: ", trace.Entity:Nick()) print("Model: ", trace.Entity:GetModel()) print("Money: ", "$"..trace.Entity:GetNWInt("Money")) print("UserID: ", trace.Entity:UserID()) print("Distance to self: ", math.floor(trace.Entity:GetPos():Distance(LocalPlayer():GetPos()))) print("Colour: ", trace.Entity:GetColor()) print("ENT Index: ", trace.Entity:EntIndex()) print("-----------------------------END OF ENT INFO: ---------
[QUOTE=Mingebags;34372033]This is from falcos small scripts that he made Is this what you are talking about? If the player or props that are not in render view it will not show[/QUOTE] your code is the ugliest piece of shit i've ever seen. idc how well it works god why don't you like, indent and shit?
[QUOTE=LauScript;34375387]your code is the ugliest piece of shit i've ever seen. idc how well it works god why don't you like, indent and shit?[/QUOTE] Please actually read posts before commenting. That was a script included in "Falco's Small Scripts", created by FPtje ages ago. The retard decided to use a quote instead of a code tag, so there's not even appropriate indentation. I guess you didn't realize that the background was fucking blue and not numbered, because code tags look exactly like that. [highlight](User was banned for this post ("flaming" - postal))[/highlight]
[QUOTE=LauScript;34375387]your code is the ugliest piece of shit i've ever seen. idc how well it works god why don't you like, indent and shit?[/QUOTE] I think the quote messed up the indentation. I always indent my code.
[QUOTE=Mingebags;34372033]This is from falcos small scripts that he made Is this what you are talking about? If the player or props that are not in render view it will not show[/QUOTE] No sorry, please one where you could choose who you wish to spectate, would be very appeciated, doesn't seem like there is one of thoose, except the one in ULX, but it doesn't work with the gamemode i'm running.
Bump
Bump on your bump
How about using [b][url=http://wiki.garrysmod.com/?title=Player.Spectate]Player.Spectate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url] ([url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index3304.html?title=Player.Spectate]mirror[/url])[/b] and [b][url=http://wiki.garrysmod.com/?title=Player.SpectateEntity]Player.SpectateEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url] ([url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexaeb4.html?title=Player.SpectateEntity]mirror[/url])[/b]? A little Derma menu, a concommand and you're done.
Sorry, you need to Log In to post a reply to this thread.