I've tried adding special equipment (from traitorshop) for donator group but i don't know how to do it. i'm using admin mod: ULX. can anyone help me?
Without editing the internal TTT code, you can't really restrict someone from purchasing the item. You could, however, immediately strip the weapon from them, and refund the credits.
Using the TTTOrderedEquipment hook, if the "equipment" is a donor-only item, strip the equipment from them ([img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/StripWeapon]Player:StripWeapon[/url]) and give them credit back ([B]ply:AddCredits(1)[/B])
I want to do that the user will not have this item available and donator will have it available in the traitorshop.
I know that is possible without strip but i don't know how to do it
In that case, add a variable to the SWEP indicating it's a donor only item (Something like SWEP.DonorOnly = true).
Then, in cl_equip.lua, in lines 43-45, if the weapon is a donor only item, only add the object to the table if the player is a donor
how can i define something like swep.donator?
[QUOTE=bartek150;52094344]how can i define something like swep.donator?[/QUOTE]
I get the impression you have no idea what you're doing, you should learn Lua before attempting things like this.
However, have a read through this: [url]https://wiki.garrysmod.com/page/Chair_Throwing_Gun[/url] it will give you an understanding of SWEP's and will more than certainly answer your question
[QUOTE=smithy285;52094409]I get the impression you have no idea what you're doing, you should learn Lua before attempting things like this.
However, have a read through this: [url]https://wiki.garrysmod.com/page/Chair_Throwing_Gun[/url] it will give you an understanding of SWEP's and will more than certainly answer your question[/QUOTE]
Adding to this, you should [URL="https://facepunch.com/showthread.php?t=1557600"]read the part about variables and the part about hooks[/URL]
solved. Thanks for help!
Sorry, you need to Log In to post a reply to this thread.