Author Topic: Bystander/Gun Guy/Murder  (Read 1834 times)

0 Members and 1 Guest are viewing this topic.

Offline peyt013

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Bystander/Gun Guy/Murder
« on: June 27, 2014, 01:34:46 AM »
I was wondering if some one can make a script, where when the superadmin looks at a character in the gamemode murder, and on top of their heads it would say one of the following: bystander/murderer/gun guy... or something like that! thanks :P

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Bystander/Gun Guy/Murder
« Reply #1 on: June 30, 2014, 06:56:00 AM »
Hey there,
There is already such a panel although it does not show info above the players head. The admin command is called mu_admin_panel if I remember it correctly.

For displaying information above players heads take a look at this code snippet I am currently using in a gamemode of mine. It currently only displays the playername aswell as the distance - adjust to fit your needs. (I think I found it somewhere on FP forums.)

Code: [Select]
function HoveringNames()
if not LocalPlayer():IsAdmin() then return end

        for _, target in pairs(player.GetAll()) do
                if target:Alive() and target != LocalPlayer() then

                        local targetPos = target:GetPos() + Vector(0,0,84)
                        local targetDistance = math.floor((LocalPlayer():GetPos():Distance( targetPos ))/40)
                        local targetScreenpos = targetPos:ToScreen()
                        draw.SimpleText(target:Nick(), "Trebuchet18", tonumber(targetScreenpos.x), tonumber(targetScreenpos.y), Color(255,255,255,255), TEXT_ALIGN_CENTER)
                        draw.SimpleText(targetDistance, "Trebuchet18", tonumber(targetScreenpos.x), tonumber(targetScreenpos.y-10), Color(200,25,25,200), TEXT_ALIGN_CENTER)

                end
        end
end
hook.Add("HUDPaint", "HoveringNames", HoveringNames)

Hope I pointed you in the right direction,
Avoid
« Last Edit: June 30, 2014, 06:58:24 AM by Avoid »