• Changing models during rounds PLEASE HELP!!!
    7 replies, posted
I currently host a TTT server with the pointshop addon. The issue I am having is that you can change your model as many times as you like during each and every round. Changing your model during rounds can easily disguise you, if someone had not seen your name, but has seen your old equipped model. Is it possible to make it so your model will only change when the next round starts? Please help!
Snip. Misread the question :p
Post your pointshop code.
[QUOTE=code_gs;43126804]Post your pointshop code.[/QUOTE] Which code? If you mean an error, there are not any
I meant your pointshop code for the model.
[QUOTE=code_gs;43128509]I meant your pointshop code for the model.[/QUOTE] This? ITEM.Name = 'Venom' ITEM.Price = 0 ITEM.Model = 'models/player/venom.mdl' 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
Does TTT have any hooks or functions that can check to see if a round in progress? I think so, but you'll need to put that in ITEM:OnEquip and OnHolster and if those conditions are not met, then don't set the player's model.
Rarely use PointShop so I don't know if this will work. However you can still give it a shot :P [lua] ITEM.Name = 'Venom' ITEM.Price = 0 ITEM.Model = 'models/player/venom.mdl' local ShouldEquip = false local playerobj function ITEM:OnEquip(ply, modifications) local State = GetRoundState() if State == ROUND_ACTIVE then ShouldEquip = true playerobj = ply ply:PS_Notify("You can't equip this item right now! However, it will be automatically equiped when the next round is preparing!") return end if not ply._OldModel then ply._OldModel = ply:GetModel() end ply:SetModel(self.Model) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end hook.Add("TTTRoundPrepare", "EquipModels", function() if !ShouldEquip then return end if IsValid(playerobj) and playerobj:Alive() then ShouldEquip = false playerobj:PS_EquipItem(ITEM.Name) end end) [/lua]
Sorry, you need to Log In to post a reply to this thread.