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