Description
This plugin allows players to buy powerups using points that they get by playing on your server!
How does it works?
While a player is on your server, he will get points for:
- Playing (Time)
- Doing map objectives
Spoiler
- Capturing points
- Blocking points
- Capturing the flag
- Defending the flag
- Killing other players
*Note: You can disable any of these
When the player have enough points, he will be able to buy powerups by accessing the shop menu (!powerups)
Commands sm_powerups or !powerups in the chat to open the shop menu. sm_addpoints <player name/steam id> <quantity> - Adds points to a given player account. sm_removepoints <player name/steam id> <quantity> - Removes points from a given player account. sm_forcepowerup <player name> <powerup> - Forces a powerup to some player. (<powerup> parameter is the powerup number in "ps_powerups.txt").
Install Instructions
- Download the .zip at "Attached Files" and extract into "...\addons\sourcemod" folder;
- Optional: Install Updater to get automatic updates!
- Done!
Configuration
When you run the plugin for the first time, a .cfg named "plugin.powerups_shop" will be generated in your "...\cfg\sourcemod" folder. Modify that file to customize the plugin settings.
All players informations are stored in "...\addons\sourcemod\data" folder, as a text file named "ps_players".
All powerups settings are stored in "...\addons\sourcemod\configs" folder as a text file named "ps_powerups".
ConVars
Spoiler
// Allow players to receive points after playing for "ps_autopoints_playtime" ammount of seconds.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_autopoints_allow "1"
// Minimum ammount of people in the server before players get playtime points.
// -
// Default: "4"
// Minimum: "0.000000"
ps_autopoints_minplayers "4"
// If "ps_autopoints_allow" is set to 1, each time the user plays for this ammount of seconds, he will receive "ps_autopoints_points" points.
// -
// Default: "600"
// Minimum: "1.000000"
ps_autopoints_playtime "600"
// If "ps_autopoints_allow" is set to 1, the user will receive this ammount of points for each "ps_autopoints_playtime" seconds he plays.
// -
// Default: "1"
// Minimum: "0.000000"
ps_autopoints_points "1"
// Makes the player wait this ammount of seconds before buying anything again.
// -
// Default: "180"
// Minimum: "0.000000"
ps_buy_wait "180"
// If 1, the remaining time before the powerup ends will be shown in the player hud.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_hudtime_allow "1"
// Position X of the powerup time in the player hud.
// -
// Default: "0.5"
ps_hudtimepos_x "0.5"
// Position Y of the powerup time in the player hud.
// -
// Default: "-0.2"
ps_hudtimepos_y "-0.2"
// Allow players to receive points by killing each others.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_killpoints_allow "1"
// Minimum ammount of people in the server before players get points for killing each others.
// -
// Default: "4"
// Minimum: "0.000000"
ps_killpoints_minplayers "4"
// If "ps_killpoints_allow" is set to 1, players will receive this ammount of points for killing each others.
// -
// Default: "1"
// Minimum: "0.000000"
ps_killpoints_points "1"
// Minimum ammount of people in the server before players get objective points.
// -
// Default: "4"
// Minimum: "0.000000"
ps_objectivepoints_minplayers "4"
// If "ps_objectivepoints_allow" is set to 1, players will receive this ammount of points for doing map objectives.
// -
// Default: "1"
// Minimum: "0.000000"
ps_objectivepoints_points "3"
// If 1, the user will lose his bought powerup if he changes team.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_powerup_changeteamremove "0"
// If 1, the user will lose his bought powerup if he dies.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_powerup_removeondeath "0"
// If "ps_randompowerups_enable" is set to 1, the player will pay this ammount of points for a random powerup.
// -
// Default: "1"
// Minimum: "0.000000"
ps_randompowerup_cost "200"
// Displays the "Random powerup" item in the shop menu.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_randompowerups_enable "1"
// Displays an welcome message for the player that has connected.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ps_welcomemessage_enabled "1"
Changelog
Spoiler
1.0.2 - Recompiled to fix compatibility problems with new sourcemod versions. - (10/05/2018) (MM:DD:YYYY)
1.0.1 - Fixed an out of bounds errors from ReducedDamage and Eye for an Eye effects. - (21/11/2016) (MM:DD:YYYY)
1.0 - Added two new powerups, organizated the code. - (11/16/2016) (MM:DD:YYYY)
0.8.5 - Fixed powerups getting broken if the plugin was loaded after the server started; Slowed now applies for the player each 0.1 second. - 06/08/2016 (MM:DD:YYYY)
0.8.4 - Fixed a bug that could occur with custom powerups, split translations into two files: ps.phrases for plugin phrases and ps.powerups_phrases for powerups names, added infinite ammo powerup, added slowed bad perk, added bleed bad perk, changed powerups costs to balance with the added events in 0.8.3. - 06/07/2016 (MM:DD:YYYY)
0.8.3 - Added Added objective points, kill points, changed and added some translations. - 06/06/2016 (MM:DD:YYYY)
0.8.2 - Fixed a translation, added Health Buff powerup and Suicide bad perk. - 06/05/2016 (MM:DD:YYYY)
0.8.1 - Added new translations, changed some code of client verification, added a new ConVar for removing client powerups if the player switches team, added updater support, fixed some command names. - 06/04/2016 (MM:DD:YYYY)
0.8 - Beta Release
Advanced users: Compilation and custom powerups
Check #template.sp in "...\addons\sourcemod\scripting\include\power ups" folder to a tutorial on how to create custom powerups.