Ok, so I'm new to creating servers and coding. I know some of the stuff is technical, so I thought having a place I can ask questions is awesome. So right now I'm working on a Prophunt server. I have the evolve admin mod and pointstore mod. My first question is how to make it to where props can only use the jump pack? Here's my current code:
ITEM.Name = 'Jump Pack'
ITEM.Price = 250
ITEM.Model = 'models/xqm/jetengine.mdl'
ITEM.Bone = 'ValveBiped.Bip01_Spine2'
function ITEM:OnEquip(ply, modifications)
ply:PS_AddClientsideModel(self.ID)
end
function ITEM:OnHolster(ply)
ply:PS_RemoveClientsideModel(self.ID)
end
function ITEM:ModifyClientsideModel(ply, model, pos, ang)
model:SetModelScale(0.5, 0)
pos = pos + (ang:Right() * 7) + (ang:Forward() * 6)
return model, pos, ang
end
function ITEM:Think(ply, modifications)
if ply:KeyDown(IN_JUMP) then
ply:SetVelocity(ply:GetUp() * 13)
end
end
[editline]30th March 2014[/editline]
Also is there a way to change the bind key to F4 instead of F3?
Change
[code]function ITEM:OnEquip(ply, modifications)
ply:PS_AddClientsideModel(self.ID)
end
[/code]
to
[code]function ITEM:OnEquip(ply, modifications)
if ( ply:Team( ) == TEAM_PROP ) then ply:PS_AddClientsideModel(self.ID)
else return false end
end
[/code]
That's assuming that the team is called TEAM_PROP. Otherwise, you'd have to find the team name using Player:Team( ).
That only means the clientside model won't be created for players, which is counterintuitive anyways.
Item think will still be called regardless. He needs CanBuy.
I thought that if you returned false on OnEquip, it won't equip at all.
hmm, yeah that makes more sense actually
Sorry, you need to Log In to post a reply to this thread.