Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = LocalPlayer()
- if( SERVER ) then
- AddCSLuaFile( "shared.lua" )
- SWEP.Weight = 50
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- function DisguiseMDL(player,commands,args)
- if type(args[1]) != "string" then return end
- if args[1] != "models/player/arctic.mdl" then
- Disguise = true
- end
- util.PrecacheModel( args[1] )
- player:SetModel( args[1] )
- end
- concommand.Add("disguise_mdl",DisguiseMDL)
- function PlayerDeath(victim,weapon,killer)
- if killer == plr then
- umsg.Start("PlayerGotKilled",killer)
- umsg.Entity(killer)
- umsg.End()
- end
- end
- hook.Add("PlayerDeath","afolafhaflhu",PlayerDeath)
- end
- if( CLIENT ) then
- SWEP.PrintName = "Disguise Kit"
- SWEP.Slot = 0
- SWEP.SlotPos = 3
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = false
- --Thief Gangster Cop Citizen(lol?)
- local GMdl = {"models/player/barney.mdl","models/player/group03/male_01.mdl","models/player/police.mdl","models/player/group01/male_01.mdl"}
- function DisguiseMenu()
- --Menu code, hacked from DarkRP.
- local frame = vgui.Create( "DFrame" )
- frame:SetTitle( "Choose disguise" )
- frame:SetVisible(true)
- frame:MakePopup()
- local levels = 1
- local IconsPerLevel = math.floor(ScrW()/64)
- while #GMdl * (64/levels) > ScrW() do
- levels = levels + 1
- end
- frame:SetSize(math.Min(#GMdl * 64, IconsPerLevel*64), math.Min(90+(64*(levels-1)), ScrH()))
- frame:Center()
- local CurLevel = 1
- for k,v in pairs(GMdl) do
- local icon = vgui.Create("SpawnIcon", frame)
- if (k-IconsPerLevel*(CurLevel-1)) > IconsPerLevel then
- CurLevel = CurLevel + 1
- end
- icon:SetPos((k-1-(CurLevel-1)*IconsPerLevel) * 64, 25+(64*(CurLevel-1)))
- icon:SetModel(v)
- icon:SetIconSize(64)
- icon:SetToolTip()
- icon.DoClick = function()
- RunConsoleCommand("disguise_mdl",v)
- frame:Close()
- end
- end
- end
- usermessage.Hook("OpenDisguiseGUI",DisguiseMenu)
- function PlayerDead(msg)
- person = msg:ReadEntity()
- if person == LocalPlayer() then
- RunConsoleCommand("disguise_mdl","models/player/arctic.mdl")
- end
- end
- usermessage.Hook("PlayerGotKilled",PlayerDead)
- end
- SWEP.Base = "weapon_base"
- SWEP.Author = "Meoowe(SWEP), Rifleman223(GUI)"
- SWEP.Instructions = "Primary Fire : Open Disguise Menu \n Secondary Fire : Toggle Cloak \n Reload : Undisguise"
- SWEP.Contact = ""
- SWEP.Purpose = ""
- SWEP.Spawnable = true
- SWEP.AdminSpawnable = true
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = false
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.ViewModel = ""
- SWEP.WorldModel = "models/weapons/w_package.mdl"
- function SWEP:Initialize()
- if( SERVER ) then
- self:SetWeaponHoldType( "slam" )
- end
- end
- Disguise = false
- local plr
- function SWEP:PrimaryAttack()
- plr = self.Owner
- if( SERVER )then
- umsg.Start("OpenDisguiseGUI",plr)
- umsg.End()
- end
- end
- --util.PrecacheModel( "models/player/"..Mdl..".mdl" )
- --self.Owner:SetModel( "models/player/"..Mdl..".mdl" )
- conceal = false
- function SWEP:SecondaryAttack()
- if ( !conceal ) then
- self.Owner:SetColor( 0, 0, 0, 0, 50 )
- self.Weapon:SetColor( 0, 0, 0, 0, 50 )
- self.Owner:PrintMessage( HUD_PRINTCENTER, "Invisible" )
- conceal = true
- else
- self.Owner:SetColor( 255, 255, 255, 255 )
- self.Weapon:SetColor( 255, 255, 255 )
- self.Owner:PrintMessage( HUD_PRINTCENTER, "Visible" )
- conceal = false
- end
- end
- function SWEP:Reload()
- if CLIENT then
- Disguise = false
- RunConsoleCommand("disguise_mdl","models/player/arctic.mdl")
- end
- end
- function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
- draw.SimpleText( "H", "CSSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement