mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 02:41:54 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
651fae4d23 | ||
|
|
692c22f7d1 | ||
|
|
cf07106641 | ||
|
|
44177f18fe |
@@ -234,7 +234,6 @@ namespace WeaponPaints
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
string selectedSkin = opt.Text;
|
||||
string selectedPaintID = selectedSkin.Substring(selectedSkin.LastIndexOf('(') + 1).Trim(')');
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace WeaponPaints
|
||||
|
||||
[JsonPropertyName("GloveEnabled")]
|
||||
public bool GloveEnabled { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("AgentEnabled")]
|
||||
public bool AgentEnabled { get; set; } = true;
|
||||
|
||||
@@ -27,6 +28,7 @@ namespace WeaponPaints
|
||||
|
||||
[JsonPropertyName("CommandGlove")]
|
||||
public string CommandGlove { get; set; } = "gloves";
|
||||
|
||||
[JsonPropertyName("CommandAgent")]
|
||||
public string CommandAgent { get; set; } = "agents";
|
||||
|
||||
|
||||
10
Events.cs
10
Events.cs
@@ -1,6 +1,7 @@
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
||||
|
||||
namespace WeaponPaints
|
||||
@@ -265,10 +266,10 @@ namespace WeaponPaints
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
var weapon = new CBasePlayerWeapon(entity.Handle);
|
||||
if (!weapon.IsValid) return;
|
||||
if (weapon == null || !weapon.IsValid || weapon.OwnerEntity.Value == null) return;
|
||||
|
||||
var player = Utilities.GetPlayerFromSteamId(weapon.OriginalOwnerXuidLow);
|
||||
if (player == null || !Utility.IsPlayerValid(player)) return;
|
||||
CCSPlayerController? player = Utilities.GetPlayerFromIndex((int)weapon.OwnerEntity.Value.Index);
|
||||
if (player == null || !player.IsValid || !Utility.IsPlayerValid(player)) return;
|
||||
|
||||
GivePlayerWeaponSkin(player, weapon);
|
||||
});
|
||||
@@ -291,7 +292,6 @@ namespace WeaponPaints
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void RegisterListeners()
|
||||
{
|
||||
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
||||
@@ -301,7 +301,7 @@ namespace WeaponPaints
|
||||
RegisterEventHandler<EventRoundEnd>(OnRoundEnd);
|
||||
RegisterListener<Listeners.OnEntitySpawned>(OnEntitySpawned);
|
||||
RegisterListener<Listeners.OnTick>(OnTick);
|
||||
//VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post);
|
||||
VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,12 @@ namespace WeaponPaints
|
||||
`steamid` varchar(64) NOT NULL,
|
||||
`weapon_defindex` int(11) NOT NULL,
|
||||
UNIQUE (`steamid`)
|
||||
) ENGINE=InnoDB",
|
||||
@"CREATE TABLE `wp_player_agents` (
|
||||
`steamid` varchar(64) NOT NULL,
|
||||
`agent_ct` varchar(64) DEFAULT NULL,
|
||||
`agent_t` varchar(64) DEFAULT NULL,
|
||||
UNIQUE KEY `steamid` (`steamid`)
|
||||
) ENGINE=InnoDB"
|
||||
};
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ namespace WeaponPaints
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}, TimerFlags.STOP_ON_MAPCHANGE);
|
||||
}
|
||||
|
||||
@@ -297,8 +296,10 @@ namespace WeaponPaints
|
||||
}
|
||||
}
|
||||
|
||||
public void GivePlayerAgent(CCSPlayerController player)
|
||||
public static void GivePlayerAgent(CCSPlayerController player)
|
||||
{
|
||||
if (!g_playersAgent.ContainsKey(player.Slot)) return;
|
||||
|
||||
try
|
||||
{
|
||||
Server.NextFrame(() =>
|
||||
|
||||
@@ -158,7 +158,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
||||
public override string ModuleAuthor => "Nereziel & daffyy";
|
||||
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
|
||||
public override string ModuleName => "WeaponPaints";
|
||||
public override string ModuleVersion => "2.2a";
|
||||
public override string ModuleVersion => "2.2b";
|
||||
|
||||
public static WeaponPaintsConfig GetWeaponPaintsConfig()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user