So... I made this plugin long time ago. I made it quickly and badly. I rewrote it a bit, and added a database system to save the purchases. The main objective of this plugin is to replace Überupgrade wich has been reported to be buggy.
1) Download the SMX file.
2) Put the smx file in the PLUGINS folder.
3) Download the translation file and put it in translations folder.
4) Download and edit the shop configuration file to your needs. (configs/TF2_PSitems.cfg)
Exemple of configuration (thanks to secondtimesold)
Spoiler
PHP Code:
"PowerShop_Items" { "1" { "menuItemName" "+10% Speed (100)" //Name of the item in the menu "attributName" "move speed bonus" //Name of the attribut, take a look here : https://wiki.teamfortress.com/wiki/L...tem_attributes "defaultValue" "1.0" //Starting of the attribut value, if it's a perctange, always put 1 otherwise, 0 or more., take a look here https://wiki.teamfortress.com/wiki/L...tem_attributes "increaseValue" "0.1" //Each time you buy the upgrade, add this vlaue to the actual value (defaultValue+increaseValue) "maxValue" "2.0" //Maxium value of the upgrade. "descriptionLine1" "Increase your speed by 10% !" //1nd descirption line of the item "descriptionLine2" "Maxium upgrade : +100% !" //2nd descirption line of the item "cost" "100" //Cost of eahc upgrades "upgradetype" "1" //1 = PHYSIC MENU 2 = WEAPON MENU 3 = OTHER MENU }
"3" { "menuItemName" "+25 Health (75)" "attributName" "max health additive bonus" "defaultValue" "0.0" "increaseValue" "25.0" "maxValue" "1000" "descriptionLine1" "Increase your health by 25 !" "descriptionLine2" "Maxium health 1000" "cost" "75" "upgradetype" "1" }
"4" { "menuItemName" "1+ per Second Health regen (35)" "attributName" "health regen" "defaultValue" "0.0" "increaseValue" "1.0" "maxValue" "100.0" "descriptionLine1" "Increase your health regen by 1 unit (per second)" "descriptionLine2" "Maxium health regen 100" "cost" "35" "upgradetype" "1" }
"5" { "menuItemName" "+10% Rate of fire (75)" "attributName" "fire rate bonus" "defaultValue" "1.0" "increaseValue" "-0.1" "maxValue" "-0.3" "descriptionLine1" "Increase your rate of fire by 10% unit !" "descriptionLine2" "Max allowed fire speed bonus +50%" "cost" "75" "upgradetype" "2" }
"6" { "menuItemName" "Ammo regen (25)" "attributName" "ammo regen" "defaultValue" "1.0" "increaseValue" "1.0" "maxValue" "2.0" "descriptionLine1" "Increase your ammo regeneration by 5% !" "descriptionLine2" "Max allowed ammo regen bonus +100%" "cost" "25" "upgradetype" "2" }
"7" { "menuItemName" "Golden Pan Kill (100)" "attributName" "turn to gold" "defaultValue" "0.0" "increaseValue" "1.0" "maxValue" "2.0" "descriptionLine1" "Turn kills into gold statues !" "descriptionLine2" "Can only be bought once." "cost" "100" "upgradetype" "3" }
"23" { "menuItemName" "Disguise on Backstab (100)" "attributName" "disguise on backstab" "defaultValue" "0.0" "increaseValue" "1.0" "maxValue" "1.0" "descriptionLine1" "Eternal Reward Bonus on Any Knife" "descriptionLine2" "You can only buy this once" "cost" "100" "upgradetype" "2" }
"24" { "menuItemName" "Jarate Backstabber (125)" "attributName" "jarate backstabber" "defaultValue" "0.0" "increaseValue" "1.0" "maxValue" "1.0" "descriptionLine1" "If you get backstabbed you will jarate the spy" "descriptionLine2" "You can only buy this once" "cost" "125" "upgradetype" "1" }
6) Navigate to the database configuration file (configs/database.cfg) and add an entry like this at the end of the file, but before the last '}' :
Code:
[...]
"powershop"
{
"driver" "default"
"host" "MY HOST IP"
"database" "PowerShop"
"user" "MY DATABASE USER"
"pass" "MY PASSWORD"
}
Obviously, replace MY HOST IP by your database host's IP, MY DATABASE USER by your database's user and MY PASSWORD by your user's database password.
7) REBOOT THE SERVER OR CHANGE THE MAP!
sm_credits - Display the number of credits you have.
sm_shop - Display the shop menu
Require : Admin flag - cheats
sm_addcredit - Add a specific ammount of credit to a player.
A configuration file is automatically generated at the first run of this plugin. Althoug, here is a list of cvar :
Code:
// This file was auto-generated by SourceMod (v1.8.0.5967)
// ConVars for plugin "TF2PowerShop.smx"
// Configuration name in database.cfg, by default, all results are saved in the sqlite database.
// -
// Default: "storage-local"
sm_tf2ps_configuration_name "powershop"
// How much credit to deduct when you die.
// -
// Default: "5"
// Minimum: "0.000000"
sm_tf2ps_death_deduction "5"
// How much credits to give on kill.
// -
// Default: "3"
// Minimum: "0.000000"
sm_tf2ps_kill_credits "3"
// Restric the command !shop to 1 team only. (-1 no restriction, 0 RED only, 1 BLU only)
// -
// Default: "-1"
// Minimum: "-1.000000"
// Maximum: "1.000000"
sm_tf2ps_shop_restriction "-1"
// How much credits to give on team loose x 3.
// -
// Default: "30"
// Minimum: "0.000000"
sm_tf2ps_teamLooseX3_credits "30"
// How much credits to give on team win.
// -
// Default: "10"
// Minimum: "0.000000"
sm_tf2ps_teamWin_credits "10"
// How much credits to give on every 90 seconds.
// -
// Default: "10"
// Minimum: "0.000000"
sm_tf2ps_time_credits "10"
sm_tf2ps_HUD_position_x "0.14"
sm_tf2ps_HUD_position_y "0.90"
Nothing, really. Just feel free to ask.
None found yet. Produce strange things when reloading the plugin with player inside server.
Few quick suggestions:
• Credits displayed on screen (lower left)
• !credits displays 'You have X credits.' in chat
• 'You gained X credits.' message printed to client in chat upon gaining credits
• Back button in menu sections (that takes you back to main menu)
• Upgrade information shouldn't have numbers at the beginning of lines
• Jump height should have higher max limit
Btw, spending points doesn't really work, whatever you're buying gets upgraded, but points don't change.
And weapon upgrades don't work either.
PS: Thanks so much for doing this, I really appreciate it.
Few quick suggestions: • Credits displayed on screen (lower left) • !credits displays 'You have X credits.' in chat • 'You gained X credits.' message printed to client in chat upon gaining credits • Back button in menu sections (that takes you back to main menu) • Upgrade information shouldn't have numbers at the beginning of lines • Jump height should have higher max limit
Btw, spending points doesn't really work, whatever you're buying gets upgraded, but points don't change.
And weapon upgrades don't work either.
PS: Thanks so much for doing this, I really appreciate it.
Not gonna fix it now, too bored. But, sure will do it sometimes...
Fixed some. Also, if you really appreciate it, yu can always give me a few bucks, you know, I have to eat
Cool plugin.
- bug: you gain credits if you kill yourself or type "explode" in console
- bug: bodies don't become gold after you kill them with upgrade
- bug: health on soldier doesn't go after 350, even though it says 1000. Health regen adds more after 350, even if it's not intended to
- bug: my players are reporting that the rate of fire doesn't work
- bug: "back" button doesn't work *sometimes* in upgrades menu when you don't have enough credits... I'm not sure for what though
- suggestion: move credits to a different location; my server has spells enabled and spells overwrite the credits text
- suggestion: add a cvar to give points for assists
- suggestion: secondary ammo regen
- suggestion: input from my players - "minicrit after kill" upgrade
- suggestion: input from my players - "clip size" upgrade
- suggestion: command to view other players' credits
- suggestion: ability to give other players from your credit
I think I'll keep adding there forever
Last edited by Pomp; 05-23-2015 at 13:33.
Reason: added some more shit :^)
- bug: bodies don't become gold after you kill them with upgrade
You sure ? It worked fine on my server. - bug: "back" button doesn't work *sometimes* in upgrades menu when you don't have enough Strange as well.
- bug: bodies don't become gold after you kill them with upgrade
You sure ? It worked fine on my server. - bug: "back" button doesn't work *sometimes* in upgrades menu when you don't have enough Strange as well.
Suggestion looks cool. I will add that.
Thanks ♥
what exactly happens is the body turns gold just for half a second and then becomes normal, falling on ground and such