Skip to content

earnings

thomas edited this page Aug 30, 2019 · 3 revisions

Earnings misc module

The earnings module manages the player's earnings for various actions and game events.
You can set how many credits a player earns for each event.
You can define different earnings groups using flags, so that VIP can earn more credits than a normal player.
There are three multipliers to increase the credit yield if the player uses a defined string in the nickname, is a member of a steam group, and uses a defined clan tag.

In addition to normal credit income, the module also offers a daily reward challenge.
Daily rewards can be claimed every 24 hours for 7 days in a row to master the challenge.

Picture

How it works

The module reads the configuration file (.csgo/addons/sourcemod/configs/mystore/earnings.txt) only once when starting the plugin, not when changing maps. When a player joins the server the plugin check his flags and set his earning group.

Earnings

At the same time it sends a query to steamapi whether the player is a member of the defined steam group for the first multiplier.
When the player triggers a gameevent such as a kill, the plugin searches for the other two multipliers - string in the nickname and clan tag.
The defined earning for the kill is multiplied by the three multipliers and paid to the player. Depending on the setting, the amount and the reason of the earnings are saved until the player dies or the end of the round is reached.

Also a timer counts the amount of seconds a player in in a team or spectator. Is a define amount reached the player get credits for playtime.

Daily rewards

The plugin create two cookies to store the last used reward date and the progress.
When a player trigger the command sm_daily it checks the cookie for last usage.
If the last reward is older than 24h, the playerr get the reward and time and progress will be saved.
When player master the challenge 7 days in a row, progess cookies will be reseted.

How to configure the earnings (.csgo/addons/sourcemod/configs/mystore/earnings.txt)

Please read the instructions in earnings config file guide.

Console Commands

sm_daily - Recieve your daily credits

Optional requirements

SteamWorks extention - required for steam api query to check for steamgroup member.

Limitations

You can maximal set 10 earnings groups. If you need more than these you can edit the source.
In addons/sourcemod/scripting/mystore_earnings.sp search for:

#define MAX_OBJECTIVES 10

Note

If no player flag matches the flags of the earning groups and there is no "flag" "" in any group, the first earning group is used.

If a player has more flags and would fit different earning groups, the last earning group is used.

The start credits, credits a player get for first join on server, is handled by core plugin with the console variable "mystore_startcredits" (.csgo/cfg/sourcemod/mystore/core.cfg)

Clone this wiki locally