mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 10:43:22 +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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,9 +170,9 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
await using var connection = await _database.GetConnectionAsync();
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
string query = @"
|
string query = @"
|
||||||
INSERT INTO `wp_player_agents` (`steamid`, `agent_ct`, `agent_t`)
|
INSERT INTO `wp_player_agents` (`steamid`, `agent_ct`, `agent_t`)
|
||||||
VALUES(@steamid, @agent_ct, @agent_t)
|
VALUES(@steamid, @agent_ct, @agent_t)
|
||||||
ON DUPLICATE KEY UPDATE
|
ON DUPLICATE KEY UPDATE
|
||||||
`agent_ct` = @agent_ct,
|
`agent_ct` = @agent_ct,
|
||||||
`agent_t` = @agent_t";
|
`agent_t` = @agent_t";
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
{
|
{
|
||||||
"ChangeSubclass": {
|
"ChangeSubclass": {
|
||||||
"signatures": {
|
"signatures": {
|
||||||
"library": "server",
|
"library": "server",
|
||||||
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x57\\x48\\x83\\xEC\\x20\\x48\\x8B\\xDA\\x48\\x8B\\xF9\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x74\\x2A\\x41\\xB0\\x01",
|
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x57\\x48\\x83\\xEC\\x20\\x48\\x8B\\xDA\\x48\\x8B\\xF9\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x74\\x2A\\x41\\xB0\\x01",
|
||||||
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x41\\x55\\x49\\x89\\xF5\\x41\\x54\\x49\\x89\\xFC\\x53\\x48\\x81\\xEC\\xA8\\x00\\x00\\x00"
|
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x41\\x55\\x49\\x89\\xF5\\x41\\x54\\x49\\x89\\xFC\\x53\\x48\\x81\\xEC\\xA8\\x00\\x00\\x00"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"CAttributeList_SetOrAddAttributeValueByName": {
|
"CAttributeList_SetOrAddAttributeValueByName": {
|
||||||
"signatures": {
|
"signatures": {
|
||||||
"library": "server",
|
"library": "server",
|
||||||
"windows": "\\x40\\x53\\x41\\x56\\x41\\x57\\x48\\x81\\xEC\\x90\\x00\\x00\\x00\\x0F\\x29\\x74\\x24\\x70",
|
"windows": "\\x40\\x53\\x41\\x56\\x41\\x57\\x48\\x81\\xEC\\x90\\x00\\x00\\x00\\x0F\\x29\\x74\\x24\\x70",
|
||||||
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x49\\x89\\xFE\\x41\\x55\\x41\\x54\\x49\\x89\\xF4\\x53\\x48\\x83\\xEC\\x78"
|
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x49\\x89\\xFE\\x41\\x55\\x41\\x54\\x49\\x89\\xF4\\x53\\x48\\x83\\xEC\\x78"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"CBaseModelEntity_SetBodygroup": {
|
"CBaseModelEntity_SetBodygroup": {
|
||||||
"signatures": {
|
"signatures": {
|
||||||
"library": "server",
|
"library": "server",
|
||||||
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x48\\x89\\x74\\x24\\x10\\x57\\x48\\x83\\xEC\\x20\\x41\\x8B\\xF8\\x48\\x8B\\xF2\\x48\\x8B\\xD9\\xE8\\x2A\\x2A\\x2A\\x2A",
|
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x48\\x89\\x74\\x24\\x10\\x57\\x48\\x83\\xEC\\x20\\x41\\x8B\\xF8\\x48\\x8B\\xF2\\x48\\x8B\\xD9\\xE8\\x2A\\x2A\\x2A\\x2A",
|
||||||
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x56\\x49\\x89\\xF6\\x41\\x55\\x41\\x89\\xD5\\x41\\x54\\x49\\x89\\xFC\\x48\\x83\\xEC\\x08"
|
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x56\\x49\\x89\\xF6\\x41\\x55\\x41\\x89\\xD5\\x41\\x54\\x49\\x89\\xFC\\x48\\x83\\xEC\\x08"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"image": "",
|
"image": "",
|
||||||
"model": "null",
|
"model": "null",
|
||||||
"agent_name": "Agent | Default"
|
"agent_name": "Agent | Default"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"team": 3,
|
"team": 3,
|
||||||
"image": "",
|
"image": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user