xDShot / csgo_knives_sweps

MIT License
5 stars 3 forks source link

Viewmodel not working #5

Open Robbob72 opened 6 years ago

Robbob72 commented 6 years ago

I put the download into the servers addons folder and the knives all appear there fine and the world model works image but anytime I equip the knives on my server the skin is the default texture image as far as I know the code should be exactly how it is on the github but just in case here is both the code for the weapon as well as the code for the pointshot.

Pointshop:

ITEM.Name = 'Butterfly Knife' .. ' | ' .. 'Boreal Forest' ITEM.Price = 20000 ITEM.Model = 'models/weapons/w_csgo_butterfly.mdl' ITEM.Skin = 1 ITEM.WeaponClass = 'csgo_butterfly_boreal'

function ITEM:OnEquip(ply) ply:Give(self.WeaponClass) end

function ITEM:OnBuy(ply) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end

function ITEM:OnSell(ply) ply:StripWeapon(self.WeaponClass) end

function ITEM:OnHolster(ply) ply:StripWeapon(self.WeaponClass) end

Weapon:

if not file.Exists( 'weapons/csgo_baseknife.lua', 'LUA' ) then SWEP.Spawnable = false print( 'csgo_butterfly_boreal failed to initialize: csgo_baseknife.lua not found. Did you install the main part?' ) return end

local TTT = ( GAMEMODE_NAME == "terrortown" or cvars.Bool("csgo_knives_force_ttt", false) )

DEFINE_BASECLASS( 'csgo_baseknife' )

if ( SERVER ) then SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false

if TTT then SWEP.EquipMenuData = nil end end

if ( CLIENT ) then SWEP.Slot = TTT and 6 or 2 SWEP.SlotPos = 0 end

SWEP.PrintName = 'Butterfly Knife' .. ' | ' .. 'Boreal Forest' SWEP.Category = 'CS:GO Knives'

SWEP.Spawnable = true SWEP.AdminSpawnable = true

SWEP.ViewModel = 'models/weapons/v_csgo_butterfly.mdl' SWEP.WorldModel = 'models/weapons/w_csgo_butterfly.mdl'

SWEP.SkinIndex = 1 SWEP.PaintMaterial = nil SWEP.AreDaggers = false

util.PrecacheModel( SWEP.ViewModel ) util.PrecacheModel( SWEP.WorldModel )

-- TTT config values

-- Kind specifies the category this weapon is in. Players can only carry one of -- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP1, EQUIP2 or ROLE. -- Matching SWEP.Slot values: 0 1 2 3 4 6 7 8 SWEP.Kind = WEAPON_EQUIP

-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can -- be spawned as a random weapon. SWEP.AutoSpawnable = false

-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun. -- SWEP.AmmoEnt = "item_ammo_smg1_ttt"

-- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If -- a role is in this table, those players can buy this. SWEP.CanBuy = nil

-- InLoadoutFor is a table of ROLE_* entries that specifies which roles should -- receive this weapon as soon as the round starts. In this case, none. SWEP.InLoadoutFor = nil

-- If LimitedStock is true, you can only buy one per round. SWEP.LimitedStock = false

-- If AllowDrop is false, players can't manually drop the gun with Q SWEP.AllowDrop = true

-- If IsSilent is true, victims will not scream upon death. SWEP.IsSilent = true

-- If NoSights is true, the weapon won't have ironsights SWEP.NoSights = true

-- This sets the icon shown for the weapon in the DNA sampler, search window, -- equipment menu (if buyable), etc. SWEP.Icon = "vgui/entities/csgo_butterfly_boreal.vmt"

Ive checked the FAQ numerous times as well as check all other bug reports on the steam page and github and still have been unable to find the fix

xDShot commented 6 years ago

If you installed separate skin packs, try disabling them.

Robbob72 commented 6 years ago

I did not install any other skins packs.

ceifa commented 5 years ago

This problem is not an addon bug, but a gamemode bug. Probably the gamemode is overwriting "GM: PreDrawViewModel" and is not calling it from the weapon.

If you are using "Deathrun Neue", it is easy to fix, just replace the method for this:

function GM:PreDrawViewModel( vm, ply, wep )
    if LocalPlayer():GetObserverMode() == OBS_MODE_CHASE or LocalPlayer():GetObserverMode() == OBS_MODE_ROAMING then
        return true
    elseif wep and wep.PreDrawViewModel then
        return wep:PreDrawViewModel( vm, wep, ply )
    end
end
ceifa commented 4 years ago

where i replace?? i'm using arizard's deathrun, and the skins work for me, i see the skins... But in the pointshop, the skins appears without skins, any help?

I think your problem its unrelated to this issue, can you create new one?

CurryBoi29 commented 3 years ago

What gamemode should i use, instead of Arizards to get my knives working?