Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
PhantomYopta committed Feb 24, 2024
1 parent a0be43d commit 87145f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Binary file removed CounterStrikeSharp.API.dll
Binary file not shown.
14 changes: 7 additions & 7 deletions ReportSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ private HookResult Listener_Say(CCSPlayerController? player, CommandInfo command
_selectedReason[player.Index]!.IsSelectedReason = false;
return HookResult.Handled;
default:
Task.Run(() => SendMessageToDiscord(player.PlayerName, player.SteamID.ToString(), target.PlayerName,
target.SteamID.ToString(), commandinfo.ArgString));
Task.Run(() => SendMessageToDiscord(player.PlayerName, new SteamID(player.SteamID).SteamId2, target.PlayerName,
new SteamID(target.SteamID).SteamId2, commandinfo.ArgString, $"{ConVar.Find("hostname")!.StringValue}\n{ConVar.Find("ip")!.StringValue}:{ConVar.Find("hostport")!.GetPrimitiveValue<int>()}"));
_selectedReason[player.Index]!.IsSelectedReason = false;
player.PrintToChat($"[\x0C ReportSystem\x01 ] You have successfully filed a report on player `{target.PlayerName}`");
return HookResult.Handled;
Expand Down Expand Up @@ -109,13 +109,13 @@ private void HandleMenu2(CCSPlayerController controller, ChatMenuOption option)
var target = Utilities.GetPlayerFromIndex(int.Parse(numbersOnly.Trim()));

Task.Run(() => SendMessageToDiscord(controller.PlayerName, controller.SteamID.ToString(), target.PlayerName,
target.SteamID.ToString(), parts[0]));
target.SteamID.ToString(), parts[0], $"{ConVar.Find("hostname")!.StringValue}\n{ConVar.Find("ip")!.StringValue}:{ConVar.Find("hostport")!.GetPrimitiveValue<int>()}"));

controller.PrintToChat($"[\x0C ReportSystem\x01 ] You have successfully filed a report on player `{target.PlayerName}`");
}

private async void SendMessageToDiscord(string clientName, string clientSteamId, string targetName,
string targetSteamId, string msg)
string targetSteamId, string msg, string ip)
{
try
{
Expand All @@ -134,22 +134,22 @@ private async void SendMessageToDiscord(string clientName, string clientSteamId,
new
{
title = "Report",
description = $"{ConVar.Find("hostname")!.StringValue}\n{ConVar.Find("ip")!.StringValue}:{ConVar.Find("hostport")!.GetPrimitiveValue<int>()}",
description = ip,
color = 16711680, //255204255
fields = new[]
{
new
{
name = "Dispatcher",
value =
$"**Name:** {clientName}\n**SteamID:** {new SteamID(ulong.Parse(clientSteamId)).SteamId2}\n**Link:** [steam account link](https://steamcommunity.com/profiles/{clientSteamId}/)",
$"**Name:** {clientName}\n**SteamID:** {clientSteamId}\n**Link:** [steam account link](https://steamcommunity.com/profiles/{clientSteamId}/)",
inline = false
},
new
{
name = "Victim",
value =
$"**Name:** {targetName}\n**SteamID:** {new SteamID(ulong.Parse(targetSteamId)).SteamId2}\n**Link:** [steam account link](https://steamcommunity.com/profiles/{targetSteamId}/)",
$"**Name:** {targetName}\n**SteamID:** {targetSteamId}\n**Link:** [steam account link](https://steamcommunity.com/profiles/{targetSteamId}/)",
inline = false
},
new
Expand Down
4 changes: 4 additions & 0 deletions ReportSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.172" />
</ItemGroup>

</Project>

0 comments on commit 87145f2

Please sign in to comment.