• Help with disguise code
    1 replies, posted
I'm currently using this old disguise code from [url]http://www.garrysmod.org/downloads/?a=view&id=121497[/url] Base Code: [lua] 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/sanic.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/bloodz/slow_3.mdl","models/player/cripz/slow_2.mdl","models/GrandTheftAuto5/Trevor.mdl","models/DPFilms/Metropolice/Playermodels/pm_c08cop.mdl","models/GrandTheftAuto5/Franklin.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/sanic.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 = "models/weapons/v_c4.mdl" SWEP.WorldModel = "models/weapons/w_c4.mdl" function SWEP:Initialize() if( SERVER ) then self:SetWeaponHoldType( "KeypadCracker_Hold" ) 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/sanic.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 [/lua] Its showing up in the tab weapons, under "other" but you can't spawn it in or use it. Any help?
So you need someone to fix this code for free, good luck with that..
Sorry, you need to Log In to post a reply to this thread.