General > Developers Corner

Adding models from different games?

(1/2) > >>

Sophersky:
I was wondering if there was a way to import a model from, say, TF2, into Gmod and use it in Pointshop. Is this possible?

UnderYouFive:
Yes it is, you need to find an addon like this http://steamcommunity.com/sharedfiles/filedetails/?id=292523019&searchtext=tf2+player+model then you need this code.
--- Code: ---ITEM.Name = 'You name here'
ITEM.Price = 250
ITEM.Model = 'models/player/Yourmodelnamehere.mdl'

function ITEM:CanPlayerEquip(ply)
    return ply:Team() ~= TEAM_UNDEAD
end

function ITEM:OnEquip(ply, modifications)
if not ply._OldModel then
ply._OldModel = ply:GetModel()
end

timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
if ply._OldModel then
ply:SetModel(ply._OldModel)
end
end

function ITEM:PlayerSetModel(ply)
ply:SetModel(self.Model)
end

--- End code ---

Sophersky:
I mean is it possible to extract a model like tf2_misc_dir.vpk/models/lilchewchew/lilchewchew.mdl and allow pointshop to use it?

Neku:
I don't know how TF2 handles their models, but it looks to be the same as HL2.
Go ahead and give it a shot.

Decicus:
I'm pretty sure that if you have Team Fortress 2 mounted on a Gmod server, then you can use it as a normal "models/tf2_model_directory/modelname.mdl" in the pointshop, although I have no experience myself with a pointshop.

Navigation

[0] Message Index

[#] Next page

Go to full version