Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
added conVars for calladmin/bug discord webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo H committed Jul 20, 2019
1 parent a406517 commit ece5ffc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions addons/sourcemod/scripting/surftimer/convars.sp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ char g_szRelativeSoundPathWRCP[PLATFORM_MAX_PATH];
ConVar g_hMustPassCheckpoints = null;
ConVar g_hSlayOnRoundEnd = null;
ConVar g_hLimitSpeedType = null;
ConVar g_dcCalladminName = null;
ConVar g_dcBugTrackerName = null;

void CreateConVars()
{
Expand Down Expand Up @@ -157,6 +159,8 @@ void CreateConVars()
g_hBackupReplays = CreateConVar("ck_replay_backup", "1", "(1 / 0) Back up replay files, when they are being replaced", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_hReplaceReplayTime = CreateConVar("ck_replay_replace_faster", "1", "(1 / 0) Replace record bots if a players time is faster than the bot, even if the time is not a server record.", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_hTeleToStartWhenSettingsLoaded = CreateConVar("ck_teleportclientstostart", "1", "(1 / 0) Teleport players automatically back to the start zone, when their settings have been loaded.", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_dcCalladminName = CreateConVar("ck_discord_calladmin_name", "z4lab Calladmin", "Webhook name for !calladmin - Discord side", FCVAR_NOTIFY);
g_dcBugTrackerName = CreateConVar("ck_discord_bug_tracker_name", "z4lab Bugtracker", "Webhook name for !bug - Discord side", FCVAR_NOTIFY);

g_hPointSystem = CreateConVar("ck_point_system", "1", "on/off - Player point system", FCVAR_NOTIFY, true, 0.0, true, 1.0);
HookConVarChange(g_hPointSystem, OnSettingChanged);
Expand Down
10 changes: 8 additions & 2 deletions addons/sourcemod/scripting/surftimer/misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4521,7 +4521,10 @@ public void SendBugReport(int client)
DiscordWebHook hook = new DiscordWebHook(webhook);
hook.SlackMode = true;

hook.SetUsername("z4lab Bugtracker");
char dcBugTrackerName[64];
GetConVarString(g_dcBugTrackerName, dcBugTrackerName, sizeof(dcBugTrackerName));

hook.SetUsername(dcBugTrackerName);

MessageEmbed Embed = new MessageEmbed();

Expand Down Expand Up @@ -4557,7 +4560,10 @@ public void CallAdmin(int client, char[] sText)
DiscordWebHook hook = new DiscordWebHook(webhook);
hook.SlackMode = true;

hook.SetUsername("z4lab Calladmin");
char dcCalladminName[64];
GetConVarString(g_dcCalladminName, dcCalladminName, sizeof(dcCalladminName));

hook.SetUsername(dcCalladminName);

MessageEmbed Embed = new MessageEmbed();

Expand Down

0 comments on commit ece5ffc

Please sign in to comment.