Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Psykotikism authored Jun 18, 2018
1 parent 5b91d43 commit 00ed331
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Version 5.0 (June 18, 2018)

1. Bug fixes:

- Fixed the gdb_enabledgamemodes and gdb_disabledgamemodes convars not working properly.

## Version 4.5 (June 16, 2018)

1. Bug fixes:
Expand Down
Binary file modified addons/sourcemod/plugins/gun_damage_booster.smx
Binary file not shown.
29 changes: 16 additions & 13 deletions addons/sourcemod/scripting/gun_damage_booster.sp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Gun Damage Booster
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
#define GDB_VERSION "4.5"
#define GDB_VERSION "5.0"

public Plugin myinfo =
{
Expand All @@ -19,6 +20,7 @@ ConVar g_cvGDBChrome;
ConVar g_cvGDBDisabledGameModes;
ConVar g_cvGDBEnable;
ConVar g_cvGDBEnabledGameModes;
ConVar g_cvGDBGameMode;
ConVar g_cvGDBHunting;
ConVar g_cvGDBM16;
ConVar g_cvGDBM60;
Expand Down Expand Up @@ -54,6 +56,7 @@ public void OnPluginStart()
g_cvGDBDisabledGameModes = CreateConVar("gdb_disabledgamemodes", "", "Disable the Gun Damage Booster in these game modes.\nGame mode limit: 64\nCharacter limit for each game mode: 32\n(Empty: None)\n(Not empty: Disabled in these game modes.)", _, true, 0.0, true, 99999.0);
g_cvGDBEnable = CreateConVar("gdb_enable", "1", "Enable the Gun Damage Booster?\n(0: OFF)\n(1: ON)", _, true, 0.0, true, 99999.0);
g_cvGDBEnabledGameModes = CreateConVar("gdb_enabledgamemodes", "", "Enable the Gun Damage Booster in these game modes.\nGame mode limit: 64\nCharacter limit for each game mode: 32\n(Empty: None)\n(Not empty: Enabled in these game modes.)", _, true, 0.0, true, 99999.0);
g_cvGDBGameMode = FindConVar("mp_gamemode");
g_cvGDBHunting = CreateConVar("gdb_hunting", "45", "Damage boost for the Hunting Rifle.", _, true, 0.0, true, 99999.0);
g_cvGDBM16 = CreateConVar("gdb_m16", "40", "Damage boost for the M16 Assault Rifle.", _, true, 0.0, true, 99999.0);
g_cvGDBM60 = CreateConVar("gdb_m60", "45", "Damage boost for the M60 Assault Rifle.", _, true, 0.0, true, 99999.0);
Expand Down Expand Up @@ -317,26 +320,26 @@ stock bool bIsSurvivor(int client)
stock bool bIsSystemValid()
{
char sGameMode[32];
char sConVarModes[2049];
char sModeName[64][32];
FindConVar("mp_gamemode").GetString(sGameMode, sizeof(sGameMode));
char sConVarModes[32];
g_cvGDBGameMode.GetString(sGameMode, sizeof(sGameMode));
Format(sGameMode, sizeof(sGameMode), ",%s,", sGameMode);
g_cvGDBEnabledGameModes.GetString(sConVarModes, sizeof(sConVarModes));
ExplodeString(sConVarModes, ",", sModeName, sizeof(sModeName), sizeof(sModeName[]));
for (int iMode = 0; iMode < sizeof(sModeName); iMode++)
if (strcmp(sConVarModes, ""))
{
if (StrContains(sGameMode, sModeName[iMode], false) != -1 && sModeName[iMode][0] != '\0')
Format(sConVarModes, sizeof(sConVarModes), ",%s,", sConVarModes);
if (StrContains(sConVarModes, sGameMode, false) == -1)
{
return true;
return false;
}
}
g_cvGDBDisabledGameModes.GetString(sConVarModes, sizeof(sConVarModes));
ExplodeString(sConVarModes, ",", sModeName, sizeof(sModeName), sizeof(sModeName[]));
for (int iMode = 0; iMode < sizeof(sModeName); iMode++)
if (strcmp(sConVarModes, ""))
{
if (StrContains(sGameMode, sModeName[iMode], false) == -1 && sModeName[iMode][0] != '\0')
Format(sConVarModes, sizeof(sConVarModes), ",%s,", sConVarModes);
if (StrContains(sConVarModes, sGameMode, false) != -1)
{
return true;
return false;
}
}
return false;
return true;
}

0 comments on commit 00ed331

Please sign in to comment.