Skip to content

Commit 58968ce

Browse files
committedApr 8, 2018
🎨 Delay Convar Fetch
1 parent eacf799 commit 58968ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎sbpp_discord.sp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma semicolon 1
22

33
#define PLUGIN_AUTHOR "RumbleFrog, SourceBans++ Dev Team"
4-
#define PLUGIN_VERSION "1.0.2"
4+
#define PLUGIN_VERSION "1.0.3"
55

66
#include <sourcemod>
77
#include <sourcebanspp>
@@ -37,17 +37,17 @@ public void OnPluginStart()
3737
Convars[Ban] = CreateConVar("sbpp_discord_banhook", "", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED);
3838
Convars[Report] = CreateConVar("sbpp_discord_reporthook", "", "Discord web hook endpoint for report forward. If left empty, the ban endpoint will be used instead", FCVAR_PROTECTED);
3939

40-
FindConVar("hostname").GetString(sHostname, sizeof sHostname);
41-
42-
int iIPB = FindConVar("hostip").IntValue;
43-
Format(sHost, sizeof sHost, "%d.%d.%d.%d:%d", iIPB >> 24 & 0x000000FF, iIPB >> 16 & 0x000000FF, iIPB >> 8 & 0x000000FF, iIPB & 0x000000FF, FindConVar("hostport").IntValue);
44-
4540
Convars[Ban].AddChangeHook(OnConvarChanged);
4641
Convars[Report].AddChangeHook(OnConvarChanged);
4742
}
4843

4944
public void OnConfigsExecuted()
5045
{
46+
FindConVar("hostname").GetString(sHostname, sizeof sHostname);
47+
48+
int iIPB = FindConVar("hostip").IntValue;
49+
Format(sHost, sizeof sHost, "%d.%d.%d.%d:%d", iIPB >> 24 & 0x000000FF, iIPB >> 16 & 0x000000FF, iIPB >> 8 & 0x000000FF, iIPB & 0x000000FF, FindConVar("hostport").IntValue);
50+
5151
Convars[Ban].GetString(sEndpoints[Ban], sizeof sEndpoints[]);
5252
Convars[Report].GetString(sEndpoints[Report], sizeof sEndpoints[]);
5353
}

0 commit comments

Comments
 (0)