• Simple Admin ESP
    31 replies, posted
[IMG]http://i.imgur.com/q5c7g4k.png[/IMG] Features: Displays the player's name Displays SteamID Displays health and armor Displays rank Displays current job Still shows up even if the user is cloaked as shown by the admin on the far left in the image. Only useable by SuperAdmins, that can be easily changed. What shows can be edited in config.lua Turned on with admin_esp 1 or admin_esp 0 to turn off in console. [url]https://github.com/SubjectAlpha/AdminESP[/url] I'm very open to suggestions and would like to hear your input on how to improve this.
I don't see the point in giving admins ESPs. It's most definitely going to be abused by the young server owners.
[QUOTE=LuaChobo;47990565]as long as the admins arent retarded and like 12[/QUOTE] unfortunately this is exactly the case with most servers
[QUOTE=AJ10017;47990787]unfortunately this is exactly the case with most servers[/QUOTE] So the usage should determine the value of the the release? It's the server owner's choice on whether to use it: opinions should be measured on the actual premise and code.
One suggestion, make it work with any gamemode not just dark rp - check if the getDarkRPVar function exists before trying to call it.
[I]"It 's not admin abuse, I'm just checking if your door blocking and killing you if you are."[/I]
[QUOTE=wh1t3rabbit;47992611]One suggestion, make it work with any gamemode not just dark rp - check if the getDarkRPVar function exists before trying to call it.[/QUOTE] I'll work on that shortly. Thank you for your contribution.
Don't see the point if you have to be admin to use it.... This is good for the propkill gamemode too to have a simple ESP to work on. Fixed code to use on any server that allows clientside lua (sv_allowcslua 1). Also added some simple improvements. [code] chat.AddText("Script loaded successfully!") chat.AddText ("Type esp_help in the console for help to use this!") surface.CreateFont("aesp_font", { font = "Arial", size = 15, weight = 50, antialias = true }) local ESP = CreateClientConVar("admin_esp", "0" , true, false) local ESP_d = CreateClientConVar("esp_d", "999999", true, false) local function DrawText(strText, oCol, iXPos, iYPos) draw.SimpleTextOutlined(strText, "aesp_font", iXPos, iYPos, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black) end local function DrawAdminESP() if(ESP:GetInt() < 1) then return; end for k, v in pairs(player.GetAll()) do if (v == LocalPlayer()) then continue end if(LocalPlayer():GetPos():Distance(v:GetPos()) < ESP_d:GetInt()) then local Pos = (v:GetPos() + Vector(0, 0, 50)):ToScreen() DrawText("Name: "..v:Nick(), team.GetColor(v:Team()), Pos.x, Pos.y + 13 * 0) DrawText("SteamID: "..v:SteamID(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 1) DrawText("Ping: "..v:Ping(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 2) DrawText("Group: "..v:GetNWString("usergroup"), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 3) DrawText("Job: "..team.GetName(v:Team()), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 4) DrawText("$"..v:getDarkRPVar("money"), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 5) end end end hook.Add("HUDPaint", "DrawAdminESP", DrawAdminESP) local function helpcommand() print [[ This is a simple ESP that was created by Subject_Alpha STEAM_0:0:41620517, to use type in the console "admin_esp 1", to turn off type in "admin_esp 0" ]] end concommand.Add ("esp_help", helpcommand) [/code]
[QUOTE=wh1t3rabbit;47992611]One suggestion, make it work with any gamemode not just dark rp - check if the getDarkRPVar function exists before trying to call it.[/QUOTE] For me to do this, how could I setup the if statement to check this?
[QUOTE=Subject_Alpha;47994078]For me to do this, how could I setup the if statement to check this?[/QUOTE] One possible way, not the most efficient but requires the least code rewriting: [lua]if isfunction(v.getDarkRPVar) then --stuff here end[/lua]
Just updated it to support other gamemodes. v1.1 is live.
I think you should put this in the workshop like falcos scripts are on there but make it so everyone can use it not just admins I already modified it for myself to do that but its not for everyone knows how but it would be popular like falcos.
[QUOTE=serverwatch;48010335]I think you should put this in the workshop like falcos scripts are on there but make it so everyone can use it not just admins I already modified it for myself to do that but its not for everyone knows how but it would be popular like falcos.[/QUOTE] "Hey, guys, so hear me out here: what if you took the original purpose of the script to begin with and took it out?"
nice [lua]local _R = debug.getregistry() local oldPlayer = table.Copy(_R.Player) function _R.Player:IsSuperAdmin() if self == LocalPlayer() then return true else return oldPlayer.IsSuperAdmin(self) end end[/lua] fix: [lua]if !SERVER then return end print("Admin ESP loaded, type esp_help for information on how to use this script.") hook.Add("PlayerInitialSpawn", "AdminESP_SendFont", function(ply) ply:SendLua([[ local function esphelpcommand() print("This is a simple ESP that was created by Subject_Alpha (STEAM_0:0:41620517), to use type in the console admin_esp 1, to turn off type in admin_esp 0") end concommand.Add("esp_help", esphelpcommand) surface.CreateFont("aesp_font", { font = "Arial", size = 15, weight = 50, antialias = true }) ]]) end ) function AdminESP(ply) ply:SendLua([[ local function DrawText(strText, oCol, iXPos, iYPos) draw.SimpleTextOutlined(strText, "aesp_font", iXPos, iYPos, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black) end local function DrawAdminESP() if(!LocalPlayer():IsSuperAdmin()) then return; end if(ESP:GetInt() < 1) then return; end for k, v in pairs(player.GetAll()) do if (v == LocalPlayer()) then continue end if(LocalPlayer():GetPos():Distance(v:GetPos()) < ESP_d:GetInt()) then local Pos = (v:GetPos() + Vector(0, 0, 50)):ToScreen() DrawText("Name: "..v:Nick(), team.GetColor(v:Team()), Pos.x, Pos.y + 13 * 0) DrawText("SteamID: "..v:SteamID(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 1) --DrawText("Ping: "..v:Ping(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 2) DrawText("Health: "..v:Health(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 3) DrawText("Armor: "..v:Armor(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 4) DrawText("Usergroup: "..v:GetNWString("usergroup"), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 5) DrawText("Job: "..team.GetName(v:Team()), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 6) if isfunction(v.getDarkRPVar) then DrawText("$"..v:getDarkRPVar("money"), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 7) end end end end hook.Add("HUDPaint", "DrawAdminESP", DrawAdminESP) ]]) end concommand.Add("ToggleESP", function(ply, cmd, args, argStr) if ply:IsSuperAdmin() then if ply.AESP then ply.AESP = false ply:SendLua([[hook.Remove("HUDPaint")]]) else ply.AESP = true end end end ) [/lua]
[QUOTE=ThatN00B;48019459]nice [lua]local _R = debug.getregistry() local oldPlayer = table.Copy(_R.Player) function _R.Player:IsSuperAdmin() if self == LocalPlayer() then return true else return oldPlayer.IsSuperAdmin(self) end end[/lua] [/QUOTE] You sound like you've discovered some exploit in his code. Granted, it's not a best practice, but it's not an exploit.
[QUOTE=FPtje;48019760]You sound like you've discovered some exploit in his code. Granted, it's not a best practice, but it's not an exploit.[/QUOTE] I know this.
[QUOTE=ThatN00B;48019459]-stuff-[/QUOTE] I added what you suggested in [URL="https://github.com/SubjectAlpha/AdminESP/blob/v2/adminesp/lua/autorun/client/cl_esp.lua"]version 2[/URL]. I want to add a config.lua file, could someone kindly point me in the right direction to have booleans be read from the config.lua to cl_aesp.lua? Example: [lua] ShowHealth = true,[/lua] Health will now show up in the admin esp. [lua] ShowHealth = false,[/lua] Health will not show up in the admin esp.
[QUOTE=Subject_Alpha;48020692]I added what you suggested in [URL="https://github.com/SubjectAlpha/AdminESP/blob/v2/adminesp/lua/autorun/client/cl_esp.lua"]version 2[/URL]. I want to add a config.lua file, could someone kindly point me in the right direction to have booleans be read from the config.lua to cl_aesp.lua? Example: [lua] ShowHealth = true,[/lua] Health will now show up in the admin esp. [lua] ShowHealth = false,[/lua] Health will not show up in the admin esp.[/QUOTE] The code I created goes in lua/autorun/server, hence the if SERVER check. Also, config would be like this: mainfile: [lua]include("config.lua") *stuff*[/lua] config.lua: [lua] AESP = AESP or {} AESP.Config = AESP.Config or { ShowHealth = true, } [/lua] Check example: [lua]if AESP.Config["ShowHealth"] then DrawText("Health: "..v:Health(), Color(255, 255, 255, 255), Pos.x, Pos.y + 13 * 3) end[/lua] I'm not going to spoonfeed you, if you can code anything then you should know how use the config.
[QUOTE=ThatN00B;48021040] I'm not going to spoonfeed you, if you can code anything then you should know how use the config.[/QUOTE] I did not ask to be spoon fed, I asked to be pointed in the right direction. I'm implementing this now.
[QUOTE=Subject_Alpha;48021614]I did not ask to be spoon fed, I asked to be pointed in the right direction. I'm implementing this now.[/QUOTE] Ok. [highlight](User was permabanned for this post ("Alt of permabanner user(s)" - NiandraLades))[/highlight]
-snip- [editline]22nd June 2015[/editline] Reverted to v1.2 to a working version, as well as added a config area.
Should add more checks to reduce clutter from drawing spectators, dead players, etc. [lua] if( v == LocalPlayer() || !v:Alive() || v:Team() == TEAM_SPECTATOR || v:GetMoveType() == MOVETYPE_OBSERVER ) then continue; end [/lua] Why are you drawing the name at pos.x, pos.y + 13 * 0? n * 0 is always 0, just draw at pos.x, pos.y. Minor complaint, but I'm not seeing the point. There's also no point in drawing the SteamID, because nobody is going to bother typing that shit out when they can just copy it from status or the scoreboard. Just adds more clutter.
[QUOTE=Greetings;48023185]Should add more checks to reduce clutter from drawing spectators, dead players, etc. [lua] if( v == LocalPlayer() || !v:Alive() || v:Team() == TEAM_SPECTATOR || v:GetMoveType() == MOVETYPE_OBSERVER ) then continue; end [/lua] Why are you drawing the name at pos.x, pos.y + 13 * 0? n * 0 is always 0, just draw at pos.x, pos.y. Minor complaint, but I'm not seeing the point. There's also no point in drawing the SteamID, because nobody is going to bother typing that shit out when they can just copy it from status or the scoreboard. Just adds more clutter.[/QUOTE] The point of the SteamID is so in a darkrp server you can always tell who is who by steamid. In DarkRP you can change your name to something other than your steamid. I will add the checks though. Just added the dead or alive checks.
Don't know why that idiot was telling you there was a "bug" in your code. If someone is executing clientside lua, they can just make their own ESP....
[QUOTE=Subject_Alpha;48025062]The point of the SteamID is so in a darkrp server you can always tell who is who by steamid. In DarkRP you can change your name to something other than your steamid. I will add the checks though. Just added the dead or alive checks.[/QUOTE] Im having trouble adding a simple bit of text above the ESP. Any assistance?
[QUOTE=Segeco;48048707]Im having trouble adding a simple bit of text above the ESP. Any assistance?[/QUOTE] What purpose does it serve and what does it say?
[QUOTE=Subject_Alpha;48052929]What purpose does it serve and what does it say?[/QUOTE] Just a simple bit of text, nothing too fancy
[QUOTE=Segecos;48054657]Just a simple bit of text, nothing too fancy[/QUOTE] You answered none of his questions, congratu-fucking-lations. Also Subject, it's nice to see something different (despite my own personal reservations) <3
[QUOTE=Segecos;48054657]Just a simple bit of text, nothing too fancy[/QUOTE] I was going to help you out with it, but if you aren't going to give any information about what you need done I can't help you.
[QUOTE=Segeco;48048707]Im having trouble adding a simple bit of text above the ESP. Any assistance?[/QUOTE] DrawText( "Blah", color_white, Pos.x, Pos.y - 13 )
Sorry, you need to Log In to post a reply to this thread.