Skip to content

Commit

Permalink
Merge pull request #177 from sapphonie/fix-issues
Browse files Browse the repository at this point in the history
Fix issues
  • Loading branch information
sapphonie authored Nov 6, 2023
2 parents 82257de + 730ae9f commit 9024a65
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 34 deletions.
4 changes: 4 additions & 0 deletions scripting/stac.sp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ public void OnPluginStart()

public void OnPluginEnd()
{
// do this to make sure we don't try and fail to send discord messages if the server is restarting
// we need to use OnLibraryLoad/Unload eventually...
CheckNatives();

StacLog("\n\n----> StAC version [%s] unloaded\n", PLUGIN_VERSION);

MC_PrintToChatAll("{hotpink}StAC{white} version [%s] unloaded!!! If this wasn't intentional, something nefarious is afoot!", PLUGIN_VERSION);
Expand Down
9 changes: 3 additions & 6 deletions scripting/stac/stac_livefeed.sp
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,19 @@ void LiveFeed_NetInfo(int userid)
}
}


bool IsValidLiveFeedViewer(int client)
{
if
(
// only show to admins that are dead or in spec
(
IsValidClient(client)
/*
IsValidAdmin(client)
&&
(
TF2_GetClientTeam(client) == TFTeam_Spectator
||
!IsPlayerAlive(client)
// ||
// !IsPlayerAlive(client)
)
*/
)
||
// and sourcetv
Expand Down
89 changes: 61 additions & 28 deletions scripting/stac/stac_mapchange.sp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,69 @@ public void OnMapEnd()
CloseStacLog();
}

void CheckNatives()
{
// check natives!

// sourcebans
if (GetFeatureStatus(FeatureType_Native, "SBPP_BanPlayer") == FeatureStatus_Available)
{
SOURCEBANS = true;
}
else
{
SOURCEBANS = false;
}


// materialadmin
if (GetFeatureStatus(FeatureType_Native, "MABanPlayer") == FeatureStatus_Available)
{
MATERIALADMIN = true;
}
else
{
MATERIALADMIN = false;
}


// gbans
if (CommandExists("gb_ban"))
{
GBANS = true;
}
else
{
GBANS = false;
}


// sourcemod aimplotter
if (CommandExists("sm_aimplot"))
{
AIMPLOTTER = true;
}
else
{
AIMPLOTTER = false;
}


// discord functionality
if (GetFeatureStatus(FeatureType_Native, "Discord_SendMessage") == FeatureStatus_Available)
{
DISCORD = true;
}
else
{
DISCORD = false;
}
}

Action checkNativesEtc(Handle timer)
{
CheckNatives();

if (!configsExecuted)
{
return Plugin_Handled;
Expand Down Expand Up @@ -84,34 +145,6 @@ Action checkNativesEtc(Handle timer)
MVM = false;
}

// check natives!

// sourcebans
if (GetFeatureStatus(FeatureType_Native, "SBPP_BanPlayer") == FeatureStatus_Available)
{
SOURCEBANS = true;
}
// materialadmin
if (GetFeatureStatus(FeatureType_Native, "MABanPlayer") == FeatureStatus_Available)
{
MATERIALADMIN = true;
}
// gbans
if (CommandExists("gb_ban"))
{
GBANS = true;
}
// sourcemod aimplotter
if (CommandExists("sm_aimplot"))
{
AIMPLOTTER = true;
}
// discord functionality
if (GetFeatureStatus(FeatureType_Native, "Discord_SendMessage") == FeatureStatus_Available)
{
DISCORD = true;
}

return Plugin_Continue;
}

Expand Down

0 comments on commit 9024a65

Please sign in to comment.