Skip to content

Commit

Permalink
new cvar regg_rolling_points
Browse files Browse the repository at this point in the history
  • Loading branch information
byjumpe committed Dec 20, 2023
1 parent c25d987 commit 4e903c6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
9 changes: 9 additions & 0 deletions cstrike/addons/amxmodx/configs/regg/regg-main.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ regg_steal_mode "1"
// Количество украденных очков или уровня (Режим Knife Pro)
regg_steal_value "1"

// Очки полученные в ходе убийства с ножа
// при включенном regg_steal_mode, переходят на следующий уровень
// например у вас 3/4, вы украли очки у соперника 3 очка,
// на новом уровне у вас будет 2/4, если отключено 0/4
// ОТКЛЮЧЕНО НА УРОВНЕ НОЖА И ГРАНАТЫ, ВСЕГДА БУДЕТ ПРИ ПЕРЕХОДЕ 0
// 0 - отключено
// 1 - включено
regg_rolling_points "1"

// Смена карты, какой плагин использовать
// 0 - ReGG Map Manager, a random map from the maplist (maps.ini or mapcycle.txt)
// 1 - Map Manager by Mistrik (v. 3.0.7)
Expand Down
9 changes: 9 additions & 0 deletions cstrike/addons/amxmodx/scripting/regg/config.inl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
enum _:config_s {
CfgStealMode,
CfgStealValue,
CfgRollingPoints,
CfgAWPOneShot,
CfgAmmoAmount,
CfgRefillOnKill,
Expand Down Expand Up @@ -65,6 +66,14 @@ registerCvars() {
.min_val = 1.0
), Config[CfgStealValue]);

bind_pcvar_num(create_cvar(
"regg_rolling_points", "1",
.has_min = true,
.min_val = 0.0,
.has_max = true,
.max_val = 1.0
), Config[CfgRollingPoints]);

bind_pcvar_num(create_cvar(
"regg_awp_oneshot", "1",
.has_min = true,
Expand Down
12 changes: 10 additions & 2 deletions cstrike/addons/amxmodx/scripting/regg/functions.inl
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ ReGG_Result:addPlayerPoints(const id, const value, const bool:forwards = true) {
}

default: {
points -= needPoints;
if(Config[CfgRollingPoints] > 0) {
points -= needPoints;
} else {
points = 0;
}
needPoints = Levels[level][LevelPoints];
result = ReGG_ResultLevelUp;
}
Expand Down Expand Up @@ -400,7 +404,11 @@ ReGG_Result:addTeamPoints(const slot, const value, const bool:forwards = true) {
}

default: {
points -= needPoints;
if(Config[CfgRollingPoints] > 0) {
points -= needPoints;
} else {
points = 0;
}
needPoints = getTeamLevelPoints(slot, level);
result = ReGG_ResultLevelUp;
}
Expand Down

0 comments on commit 4e903c6

Please sign in to comment.