Skip to content

Commit

Permalink
2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
oqyh authored Nov 11, 2024
1 parent 65154d3 commit fd2f73a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Binary file modified CounterStrikeSharp.API.dll
Binary file not shown.
14 changes: 6 additions & 8 deletions Game-Manager-GoldKingZ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
using CounterStrikeSharp.API.Modules.Memory;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
using CounterStrikeSharp.API.Core.Attributes.Registration;

namespace Game_Manager_GoldKingZ;

[MinimumApiVersion(276)]
public class GameManagerGoldKingZ : BasePlugin
{
public override string ModuleName => "Game Manager (Block/Hide Unnecessaries In Game)";
public override string ModuleVersion => "2.0.7";
public override string ModuleVersion => "2.0.8";
public override string ModuleAuthor => "Gold KingZ";
public override string ModuleDescription => "https://github.com/oqyh";
internal static IStringLocalizer? Stringlocalizer;
Expand Down Expand Up @@ -62,6 +60,7 @@ public override void Load(bool hotReload)
return HookResult.Continue;
}, HookMode.Pre);


HookUserMessage(208, um =>
{
var soundevent = um.ReadUInt("soundevent_hash");
Expand Down Expand Up @@ -611,8 +610,6 @@ public HookResult OnEventGrenadeThrown(EventGrenadeThrown @event, GameEventInfo
if (Configs.GetConfigData().CustomThrowNadeMessagesMode == 0 || player == null || !player.IsValid || Configs.GetConfigData().CustomThrowNadeMessagesMode == 1 && player.IsBot)return HookResult.Continue;

Server.NextFrame(() => {


var playerteam = player.TeamNum;
var allplayers = Helper.GetPlayersController(true,false);

Expand All @@ -623,14 +620,15 @@ public HookResult OnEventGrenadeThrown(EventGrenadeThrown @event, GameEventInfo
var otherteam = players.TeamNum;
bool sameTeam = playerteam == otherteam;
bool teammatesAreEnemies = ConVar.Find("mp_teammates_are_enemies")!.GetPrimitiveValue<bool>();
var Nadelocation = players.PlayerPawn.Value.LastPlaceName;

string Nadelocation = player?.PlayerPawn?.Value?.LastPlaceName ?? "Unknown";

if (sameTeam && !teammatesAreEnemies) {
Helper.SendGrenadeMessage(nade, players, player.PlayerName, Nadelocation.ToString());
Helper.SendGrenadeMessage(nade, players, player!.PlayerName, Nadelocation.ToString());
} else if (sameTeam && player != players ) {
return;
} else if (sameTeam && (Configs.GetConfigData().CustomThrowNadeMessagesMode == 3 || Configs.GetConfigData().CustomThrowNadeMessagesMode == 4)) {
Helper.SendGrenadeMessage(nade, players, player.PlayerName, Nadelocation.ToString());
Helper.SendGrenadeMessage(nade, players, player!.PlayerName, Nadelocation!.ToString());
}
});
});
Expand Down

0 comments on commit fd2f73a

Please sign in to comment.