Is there a way to force the user to equip something such as a permanent weapon as soon as they buy it? Also can I prevent them from equiping more than one item in a group, such as either the pistol, glock, or deagle in the secondaries menu but never 2 at the same time. Lastly, where are the pointshop user files located to I can manually delete a pointshop item out of a user's inventory.
Take a look at this website: [url]http://pointshop.burt0n.net[/url]
As you can see by looking at [url]http://pointshop.burt0n.net/categories[/url] there is a line you can add to __category.lua (lua/items/youritemsfolder/__category.lua) which limits the number of items equipable from that category.In your case this would be [code]CATEGORY.AllowedEquipped = 1[/code]
As for permanent weapons you neeed to have a look at adding hooks to your weapons code (see the bottom of here: [url]http://pointshop.burt0n.net/items[/url]). You are looking for something like this
[code] ITEM.Name = 'AUG'
ITEM.Price = 500
ITEM.Model = "models/weapons/w_rif_aug.mdl"
ITEM.WeaponClass = 'weapon_ttt_aug'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
ply.droppedPSWeapons = ply.droppedPSWeapons or {}
if not ply.droppedPSWeapons[self.WeaponClass] then
ply:Give( self.WeaponClass )
ply:SelectWeapon( self.WeaponClass )
ply.droppedPSWeapons[self.WeaponClass] = true
end
end
function ITEM:OnHolster(ply)
ply:StripWeapon( self.WeaponClass )
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
hook.Add( "TTTEndRound", "ClearDrops", function( )
for k, v in pairs( player.GetAll( ) ) do
v.droppedPSWeapons = {}
end
end )
[/code]
This is for the AUG (clearly), just change the obvious to get different weapons.
[QUOTE=Roag15;43189294]Take a look at this website: [url]http://pointshop.burt0n.net[/url]
As you can see by looking at [url]http://pointshop.burt0n.net/categories[/url] there is a line you can add to __category.lua (lua/items/youritemsfolder/__category.lua) which limits the number of items equipable from that category.In your case this would be [code]CATEGORY.AllowedEquipped = 1[/code]
As for permanent weapons you neeed to have a look at adding hooks to your weapons code (see the bottom of here: [url]http://pointshop.burt0n.net/items[/url]). You are looking for something like this
[code] ITEM.Name = 'AUG'
ITEM.Price = 500
ITEM.Model = "models/weapons/w_rif_aug.mdl"
ITEM.WeaponClass = 'weapon_ttt_aug'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
ply.droppedPSWeapons = ply.droppedPSWeapons or {}
if not ply.droppedPSWeapons[self.WeaponClass] then
ply:Give( self.WeaponClass )
ply:SelectWeapon( self.WeaponClass )
ply.droppedPSWeapons[self.WeaponClass] = true
end
end
function ITEM:OnHolster(ply)
ply:StripWeapon( self.WeaponClass )
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
hook.Add( "TTTEndRound", "ClearDrops", function( )
for k, v in pairs( player.GetAll( ) ) do
v.droppedPSWeapons = {}
end
end )
[/code]
This is for the AUG (clearly), just change the obvious to get different weapons.[/QUOTE]
You misundersood me, I have permanent weapons, I just needed to know how to limit the players from having one per group as well as my other two issues. Though i have to thank you for the info about the group restriction.
Apoligies, to manually remove something from someone you must use the in game pointshop admin menu and take an item form them using the menu. There is no way to force someone to equip something, it'll auto equip if they have it equipped when they spawn. Sorry if I'm still not understanding :/. The one per group thing, if you just make a primary weapon tab and a secondary weapon tab and put this in the __category.lua (CATEGORY.AllowedEquipped = 1) then that will only allow one primary and one secondary equipped at one time.
[QUOTE=Roag15;43189968]Apoligies, to manually remove something from someone you must use the in game pointshop admin menu and take an item form them using the menu. There is no way to force someone to equip something, it'll auto equip if they have it equipped when they spawn. Sorry if I'm still not understanding :/. The one per group thing, if you just make a primary weapon tab and a secondary weapon tab and put this in the __category.lua (CATEGORY.AllowedEquipped = 1) then that will only allow one primary and one secondary equipped at one time.[/QUOTE]
Its fine, the advice about the one per group helped a lot, and I did exactly what you said to do before I read it or knew you replied. Your understanding perfectly but are you sure theres no txt file with what every player has? Because there was a glitch where I had a ghost weapon that kept spawning on me that I had deleted. I fixed it but I'd still like to know for the future if anyone knows.
Sorry, you need to Log In to post a reply to this thread.