• Credits
    13 replies, posted
I know that this is possible, but I couldn't find any information on how to do it anywhere. How would I go about changing the credit prices of traitor store items?
Anyone able to help?
[QUOTE=bobbrown;41377776]I know that this is possible, but I couldn't find any information on how to do it anywhere. How would I go about changing the credit prices of traitor store items?[/QUOTE] I just read this on [url]http://ttt.badking.net/custom-weapon-guide[/url]. But it sound like its the person who wrote it that dont want it and not that its not possible. Well I have never seen a weapon cost more then 1 credit but maybe you have?? anyway this is whats written: [QUOTE][B]Can I make my custom weapon cost 2 or 3 credits instead of 1?[/B] No. I don't want the equipment menu to turn into a CS:S-like store. The decision a player with a credit makes right now is "which equipment is going to help me most". If equipment starts having variable prices, the decision suddenly involves options such as saving for more expensive equipment, and which equipment is the most price-efficient. This seemingly small change will add significant complexity. In short: this is intentional and will not change. Balance your weapon for 1 credit. If you're looking for an easy option, limit the weapon's ammo and let players buy another one to get more shots once they run out.[/QUOTE] I dont know if that help what so ever and you allowed to correct me because im actually intrested in this aswell :D... I hope you will find what you seek :3 Ps. if you find out anything usefull then dont hesitate to share your result :)
[quote] Can I make my custom weapon cost 2 or 3 credits instead of 1? No. I don't want the equipment menu to turn into a CS:S-like store. The decision a player with a credit makes right now is "which equipment is going to help me most". If equipment starts having variable prices, the decision suddenly involves options such as saving for more expensive equipment, and which equipment is the most price-efficient. This seemingly small change will add significant complexity. In short: this is intentional and will not change. Balance your weapon for 1 credit. If you're looking for an easy option, limit the weapon's ammo and let players buy another one to get more shots once they run out. [/quote] [url]http://ttt.badking.net/custom-weapon-guide[/url] EDIT: [QUOTE=morten7000;41383231]I just read this on [url]http://ttt.badking.net/custom-weapon-guide[/url]. But it sound like its the person how wrote it that dont want it and not that its not possible. Well I have never seen a weapon cost more then 1 credit but maybe you have?? anyway this is whats written: I dont know if that help what so ever and you allowed to correct me because im actually intrested in this aswell :D... I hope you will find what you seek :3 Ps. if you find out anything usefull then dont be insecure to share you result :)[/QUOTE] We are somehow connected, brother.
I just wrote that?? :P [QUOTE=The Android1;41383234][url]http://ttt.badking.net/custom-weapon-guide[/url] We are connected somehow, brother,[/QUOTE] Edit: Yeah ;)
Thanks for trying to help, I appreciate it. If anyone knows anything about this, please tell me.
Go to line 342 in weaponry.lua in the terrortown gamemode files. That's where ordering equipment is handled so try poking around in there if you're familiar with lua at all. I think I could do it, just from taking a quick look, but I have no interest in it.
[QUOTE=bobbrown;41409819]Thanks for trying to help, I appreciate it. If anyone knows anything about this, please tell me.[/QUOTE] [URL="http://pastebin.com/mSJZf5g7"]Lua Code [/URL] This Is A Way Two Edit A Weapon In Lua So That It Takes Two Credits TO Buy And Use A Weapon.. Its Sorta Common Sense But It Does Work Perfectly I Made This When I Used To Have A Server
[QUOTE=MerkyShadow;46355162][URL="http://pastebin.com/mSJZf5g7"]Lua Code [/URL] This Is A Way Two Edit A Weapon In Lua So That It Takes Two Credits TO Buy And Use A Weapon.. Its Sorta Common Sense But It Does Work Perfectly I Made This When I Used To Have A Server[/QUOTE] Why on earth did you capitalize every single word in that sentence...
Your welcome, because this was so easy to do but you guys were just looking in the wrong places ;)
terrotown/gamemode/weaponry.lua Find a function called OrderEquipment straight after [code] local swep_table = (not is_item) and weapons.GetStored(id) or nil[/code], add [code] if (swep_table) then if (ply:GetCredits() < (swep_table.Cost or 1)) then return ply:PrintMessage( HUD_PRINTTALK, "You require ".. swep_table.Cost - ply:GetCredits() .." more credit(s) to buy this!") end else if (ply:GetCredits() < 1) then return end end [/code] also find the line [code]if received then[/code], after that line there's a line which is [code] ply:SubtractCredits(1)[/code] replace the ply:SubtractCredits(1) with [code] if (swep_table) then ply:SubtractCredits((swep_table.Cost or 1)) else ply:SubtractCredits(1) end[/code] for every swep you want to cost more than 1 credit, add [code]SWEP.Cost = <number>[/code] to it. Tested. Should work. If you have any problems, post here.
This might work, however do to circumstances I think my way is way easier and is to the point.
[QUOTE=MerkyShadow;46357934]This might work, however do to circumstances I think my way is way easier and is to the point.[/QUOTE] "might" also, your's must disable limited stock. Mine doesnt. It can cause a big difference in some weapons, such as the knife. Imagine if a server had a 1 hit knife, and it wasnt limited stock. rip the whole server
Never thought of it that way, I wasn't trying to disprove your code. I was just pointing out that most people need a code like mine for overpowered weapons such as the defibrillator and cloak and maybe mines. I felt that's what most people were trying to use it for
Sorry, you need to Log In to post a reply to this thread.