mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-26 05:04:47 +00:00
2.9b
- Hotfix for musickit (probably not 100% valid) - Hotfix for website
This commit is contained in:
32
Events.cs
32
Events.cs
@@ -77,9 +77,6 @@ namespace WeaponPaints
|
||||
IpAddress = player.IpAddress?.Split(":")[0]
|
||||
};
|
||||
|
||||
if (!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var weaponInfos))
|
||||
return HookResult.Continue;
|
||||
|
||||
if (WeaponSync != null)
|
||||
_ = Task.Run(async () => await WeaponSync.SyncStatTrakToDatabase(playerInfo));
|
||||
|
||||
@@ -113,6 +110,35 @@ namespace WeaponPaints
|
||||
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
[GameEventHandler(HookMode.Pre)]
|
||||
public HookResult OnPlayerMvp(EventRoundMvp @event, GameEventInfo info)
|
||||
{
|
||||
var player = @event.Userid;
|
||||
if (player == null || !player.IsValid || player.IsBot)
|
||||
return HookResult.Continue;
|
||||
|
||||
if (!(GPlayersMusic.TryGetValue(player.Slot, out var musicInfo)
|
||||
&& musicInfo.TryGetValue(player.Team, out var musicId)
|
||||
&& musicId != 0))
|
||||
return HookResult.Continue;
|
||||
|
||||
@event.Musickitid = musicId;
|
||||
@event.Nomusic = 0;
|
||||
@event.Musickitmvps = 1;
|
||||
@event.Value = 1;
|
||||
|
||||
var newEvent = new EventRoundMvp(true)
|
||||
{
|
||||
Musickitid = musicId,
|
||||
Nomusic = 0,
|
||||
Musickitmvps = 1,
|
||||
Value = 1
|
||||
};
|
||||
|
||||
newEvent.FireEvent(false);
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
private void OnMapStart(string mapName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user