[TF2] Power Shop
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.
Original idea :
https://forums.alliedmods.net/showpo...25&postcount=1
Here is the list of avaible features for now :
- Fully configurable shop items through a easy config file
- Translations ! By the way, I need help for that.
- Easy to configure
- Easy to installation (drag-n-drop)
- Unlimited ammount of items
- Cool HUD
Before anything, make sure you have installed :
[TF2] TF2 Attributes
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
}
"2"
{
"menuItemName" "+5% Jump height (60)"
"attributName" "increased jump height"
"defaultValue" "1.0"
"increaseValue" "0.1"
"maxValue" "2.5"
"descriptionLine1" "Increase your jump height by 5% !"
"descriptionLine2" "Maxium jump height +150%"
"cost" "60"
"upgradetype" "1"
}
"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"
}
"8"
{
"menuItemName" "Metal Regen (45)"
"attributName" "Metal Regen"
"defaultValue" "1.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Gain Metal Every 5 Seconds"
"descriptionLine2" "Metal generator"
"cost" "45"
"upgradetype" "2"
}
"9"
{
"menuItemName" "Explosive sniper shot (175)"
"attributName" "explosive sniper shot"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Explosive Sniper HeadShot"
"descriptionLine2" "Headshots explode killing nearby enemies"
"cost" "175"
"upgradetype" "2"
}
"10"
{
"menuItemName" "Sniper Charge Rate Increase (150)"
"attributName" "SRifle Charge rate increased"
"defaultValue" "1.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "SRifle Charge rate increased"
"descriptionLine2" "Faster Charge"
"cost" "150"
"upgradetype" "2"
}
"11"
{
"menuItemName" "Ubercharge rate bonus (80)"
"attributName" "ubercharge rate bonus"
"defaultValue" "0.0"
"increaseValue" "0.5"
"maxValue" "2.0"
"descriptionLine1" "Ubercharge people !"
"descriptionLine2" "Can only be bought once."
"cost" "80"
"upgradetype" "2"
}
"12"
{
"menuItemName" "Minigun spinup time decreased (80)"
"attributName" "minigun spinup time decreased "
"defaultValue" "0.0"
"increaseValue" "0.5"
"maxValue" "2.0"
"descriptionLine1" "Heavy"
"descriptionLine2" ""
"cost" "80"
"upgradetype" "2"
}
"13"
{
"menuItemName" "+25% Speed (200)"
"attributName" "move speed bonus"
"defaultValue" "1.0" https://wiki.teamfortress.com/wiki/L...tem_attributes
"increaseValue" "0.25"
"maxValue" "2.0"
"descriptionLine1" "Increase your speed by 25% !"
"descriptionLine2" "Maxium upgrade : +100% !"
"cost" "200"
"upgradetype" "1"
}
"14"
{
"menuItemName" "+15% Jump height (150)"
"attributName" "increased jump height"
"defaultValue" "1.0"
"increaseValue" "0.15"
"maxValue" "2.5"
"descriptionLine1" "Increase your jump height by 15% !"
"descriptionLine2" "Maxium jump height +150%"
"cost" "150"
"upgradetype" "1"
}
"15"
{
"menuItemName" "+100 Health (250)"
"attributName" "max health additive bonus"
"defaultValue" "0.0"
"increaseValue" "100.0"
"maxValue" "1000"
"descriptionLine1" "Increase your health by 100 !"
"descriptionLine2" "Maxium health 1000"
"cost" "250"
"upgradetype" "1"
}
"16"
{
"menuItemName" "Jingle Steps (75)"
"attributName" "add jingle to footsteps"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Adds a jingle to your step!"
"descriptionLine2" "Can only be bought once."
"cost" "100"
"upgradetype" "3"
}
"17"
{
"menuItemName" "SPELL: Halloween Voices From Below (20)"
"attributName" "SPELL: Halloween voice modulation"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Deep Voice"
"descriptionLine2" "Yee Haw"
"cost" "20"
"upgradetype" "3"
}
"18"
{
"menuItemName" "Cannot Be Backstabbed (250)"
"attributName" "cannot be backstabbed"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "1.0"
"descriptionLine1" "Cannot be backstabbed"
"descriptionLine2" "Can only be bought once"
"cost" "250"
"upgradetype" "2"
}
"19"
{
"menuItemName" "SPELL: Halloween Green Fire (20)"
"attributName" "SPELL: Halloween green flames"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Green FLames"
"descriptionLine2" "Yee Haw"
"cost" "20"
"upgradetype" "3"
}
"20"
{
"menuItemName" "SPELL: Halloween Death Ghosts (20)"
"attributName" "SPELL: Halloween death ghosts"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Release Ghosts on Death"
"descriptionLine2" "Yee Haw"
"cost" "20"
"upgradetype" "3"
}
"21"
{
"menuItemName" "SPELL: Halloween Squash Rockets (20)"
"attributName" "SPELL: Halloween pumpkin explosions"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "2.0"
"descriptionLine1" "Pumpkin Bombs"
"descriptionLine2" "Yee Haw"
"cost" "20"
"upgradetype" "3"
}
"22"
{
"menuItemName" "10% Faster Reload (100)"
"attributName" "Reload time decreased"
"defaultValue" "1.0"
"increaseValue" "-0.1"
"maxValue" "-0.5"
"descriptionLine1" "Reload Time Decreased"
"descriptionLine2" "Yee Haw"
"cost" "100"
"upgradetype" "2"
}
"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"
}
"25"
{
"menuItemName" "10% Faster Build Speed (100)"
"attributName" "build rate bonus"
"defaultValue" "1.0"
"increaseValue" "-0.1"
"maxValue" "-0.5"
"descriptionLine1" "Build Time Decreased"
"descriptionLine2" "Yee Haw"
"cost" "100"
"upgradetype" "2"
}
"26"
{
"menuItemName" "Demo Charge Time Increase (80)"
"attributName" "charge time increased"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "6.0"
"descriptionLine1" "Increase Charge Time"
"descriptionLine2" "Increase charge distance"
"cost" "80"
"upgradetype" "2"
}
"27"
{
"menuItemName" "On Kill: Drop Health Pack (40)"
"attributName" "drop health pack on kill"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "1.0"
"descriptionLine1" "Can Only be bought once"
"descriptionLine2" "Yee Haw"
"cost" "40"
"upgradetype" "1"
}
"28"
{
"menuItemName" "Scout Only: Triple Jump (280)"
"attributName" "air dash count"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "1.0"
"descriptionLine1" "Can Only be bought once"
"descriptionLine2" "3rd Jump takes 10hp"
"cost" "280"
"upgradetype" "1"
}
"28"
{
"menuItemName" "Fall Damage Immunity (100)"
"attributName" "cancel falling damage"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "1.0"
"descriptionLine1" "Can Only be bought once"
"descriptionLine2" ""
"cost" "100"
"upgradetype" "1"
}
"29"
{
"menuItemName" "Bullets Penetrate Targets (100)"
"attributName" "shot penetrate all players"
"defaultValue" "0.0"
"increaseValue" "1.0"
"maxValue" "1.0"
"descriptionLine1" "Can Only be bought once"
"descriptionLine2" ""
"cost" "100"
"upgradetype" "2"
}
}
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.
<none>
https://github.com/Arkarr/TF2-PowerShop
Enjoy !
Logs :
__________________