Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- local function MyMenu()
- local w = 700
- local h = 550
- local JailPanel = vgui.Create( "DFrame" )
- JailPanel:SetPos( 50,50 )
- JailPanel:SetSize( w, h )
- JailPanel:SetTitle( "Список аррестованых:" )
- JailPanel:SetVisible( true )
- JailPanel:SetDraggable( true )
- JailPanel:ShowCloseButton( true )
- JailPanel:MakePopup()
- JailPanel:Center()
- JailPanel.Paint = function()
- draw.RoundedBox( 0, 0, 0, w, h, Color( 0,0,0,150 ))
- end
- local JailUserList = vgui.Create("DListView")
- JailUserList:SetParent(JailPanel)
- JailUserList:SetPos(25, 50)
- JailUserList:SetSize(650, 425)
- JailUserList:SetMultiSelect(false)
- JailUserList:AddColumn("Ник")
- JailUserList:AddColumn("SteamID")
- JailUserList:AddColumn("Профессия")
- playersInJail = {}
- // ВОТ ТУТ СУТЬ
- for k,v in pairs(player.GetAll()) do
- if v:isArrested() then
- JailUserList:AddLine(v:Nick(),v:SteamID(), v:getDarkRPVar("job")) -- Add lines
- for i=1, 10 do
- if playersInJail[i] == nil then
- playersInJail[i] = v
- end
- end
- end
- end
- // КОНЕЦ
- local JailButtonImg = surface.GetTextureID( "icon16/coins.png" )
- local texGradient = surface.GetTextureID( "gui/center_gradient" )
- local JailButton = vgui.Create("DButton")
- JailButton:SetParent(JailPanel)
- JailButton:SetPos(150, 488)
- JailButton:SetSize(200, 50)
- JailButton:SetText("Заплатить залог($3000)")
- JailButton.DoClick = function()
- playerSelected = JailUserList:GetSelectedLine()
- if playersInJail[playerSelected] ~= nil then
- net.Start("myMessage")
- net.WriteEntity(playersInJail[playerSelected])
- net.SendToServer()
- end
- //print(JailUserList:GetLine(JailUserList:GetSelectedLine()):GetValue(1))
- // print(JailUserList:GetSelectedLine())
- // print(players[JailUserList:GetSelectedLine()])
- //players[JailUserList:GetSelectedLine()]:setDarkRPVar("Arrested", false)
- end
- JailButton.Paint = function()
- draw.RoundedBox( 0, 0, 0, JailButton:GetWide(), JailButton:GetTall(), Color( 255,255,255,255 ))
- surface.SetTexture( texGradient )
- surface.SetDrawColor( 0, 255, 0, 200 )
- surface.DrawTexturedRect( -25, -3, JailButton:GetWide()+50, JailButton:GetTall()+25)
- end
- end
- concommand.Add("up_jailhelp", MyMenu)
- usermessage.Hook("MyMenu", MyMenu)
- end
- if SERVER then
- util.AddNetworkString( "myMessage" )
- function MyMenu( ply ) --Start the function
- umsg.Start( "MyMenu", ply ) --Send the contents of "MyMenu" to the client
- umsg.End()
- end --End the function
- hook.Add("ShowSpare1", "MyHook", MyMenu)
- net.Receive( "myMessage", function( len, ply )
- net.ReadEntity():unArrest()
- ply:addMoney(-3000)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement