-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared.lua
More file actions
38 lines (37 loc) · 1.02 KB
/
shared.lua
File metadata and controls
38 lines (37 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
killedby = {}
if SERVER then
function Killed( victim, inflictor, attacker )
if ( victim != attacker ) then
killedby[victim:Nick()] = attacker:Nick()
end
end
hook.Add( "PlayerDeath", "LastKiller", Killed)
else
function GetKiller( victim )
if killedby[victim] != nil then
return killedby[victim]
else
return "Player hasn't been killed this session"
end
end
local Frame = vgui.Create( "DFrame" )
Frame:SetTitle( "Report" )
Frame:SetSize( 300, 300 )
Frame:Center()
Frame:MakePopup()
Frame.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
draw.RoundedBox( 0, 0, 0, w, h, Color( 231, 76, 60, 255 ) ) -- Draw a red box instead of the frame
end
local DComboBox = vgui.Create( "DComboBox" )
DComboBox:SetPos( 5, 5 )
DComboBox:SetSize( 100, 20 )
DComboBox:SetValue( "Choose One" )
DComboBox:AddChoice( "RDM" )
DComboBox:AddChoice( "NLR" )
DComboBox:AddChoice( "RDA" )
DComboBox:AddChoice( "Other" )
DComboBox.OnSelect = function( panel, index, value )
if (value == "RDM") then
print(GetKiller(self:Nick))
end
end