mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 02:41:54 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
530a7d64c7 | ||
|
|
3453f4c505 | ||
|
|
25b466422b | ||
|
|
6baa59dd9b | ||
|
|
10afe7ce1e | ||
|
|
5eeb0c5fec | ||
|
|
e53ee27b39 | ||
|
|
75112b02fe |
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -30,6 +30,7 @@ jobs:
|
|||||||
run: dotnet build ${{ env.PROJECT_PATH }} -c WeaponPaints -o ${{ env.OUTPUT_PATH }}
|
run: dotnet build ${{ env.PROJECT_PATH }} -c WeaponPaints -o ${{ env.OUTPUT_PATH }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
|
if: github.event_name == 'push'
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
@@ -72,4 +73,4 @@ jobs:
|
|||||||
name: "Build ${{ env.BUILD_NUMBER }}"
|
name: "Build ${{ env.BUILD_NUMBER }}"
|
||||||
tag: "build-${{ env.BUILD_NUMBER }}"
|
tag: "build-${{ env.BUILD_NUMBER }}"
|
||||||
body: |
|
body: |
|
||||||
Place the plugin in game/csgo/addons/counterstrikesharp/plugins/WeaponPaints
|
Place the plugin in game/csgo/addons/counterstrikesharp/plugins/WeaponPaints
|
||||||
|
|||||||
139
Config.cs
139
Config.cs
@@ -3,92 +3,95 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace WeaponPaints
|
namespace WeaponPaints
|
||||||
{
|
{
|
||||||
public class Messages
|
public class Messages
|
||||||
{
|
{
|
||||||
[JsonPropertyName("WebsiteMessageCommand")]
|
[JsonPropertyName("WebsiteMessageCommand")]
|
||||||
public string WebsiteMessageCommand { get; set; } = "Visit {WEBSITE} where you can change skins.";
|
public string WebsiteMessageCommand { get; set; } = "Visit {WEBSITE} where you can change skins.";
|
||||||
[JsonPropertyName("SynchronizeMessageCommand")]
|
[JsonPropertyName("SynchronizeMessageCommand")]
|
||||||
public string SynchronizeMessageCommand { get; set; } = "Type !wp to synchronize chosen skins.";
|
public string SynchronizeMessageCommand { get; set; } = "Type !wp to synchronize chosen skins.";
|
||||||
[JsonPropertyName("KnifeMessageCommand")]
|
[JsonPropertyName("KnifeMessageCommand")]
|
||||||
public string KnifeMessageCommand { get; set; } = "Type !knife to open knife menu.";
|
public string KnifeMessageCommand { get; set; } = "Type !knife to open knife menu.";
|
||||||
[JsonPropertyName("CooldownRefreshCommand")]
|
[JsonPropertyName("CooldownRefreshCommand")]
|
||||||
public string CooldownRefreshCommand { get; set; } = "You can't refresh weapon paints right now.";
|
public string CooldownRefreshCommand { get; set; } = "You can't refresh weapon paints right now.";
|
||||||
[JsonPropertyName("SuccessRefreshCommand")]
|
[JsonPropertyName("SuccessRefreshCommand")]
|
||||||
public string SuccessRefreshCommand { get; set; } = "Refreshing weapon paints.";
|
public string SuccessRefreshCommand { get; set; } = "Refreshing weapon paints.";
|
||||||
[JsonPropertyName("ChosenKnifeMenu")]
|
[JsonPropertyName("ChosenKnifeMenu")]
|
||||||
public string ChosenKnifeMenu { get; set; } = "You have chosen {KNIFE} as your knife.";
|
public string ChosenKnifeMenu { get; set; } = "You have chosen {KNIFE} as your knife.";
|
||||||
[JsonPropertyName("ChosenKnifeMenuKill")]
|
[JsonPropertyName("ChosenKnifeMenuKill")]
|
||||||
public string ChosenKnifeMenuKill { get; set; } = "To correctly apply skin for knife, you need to type !kill.";
|
public string ChosenKnifeMenuKill { get; set; } = "To correctly apply skin for knife, you need to type !kill.";
|
||||||
[JsonPropertyName("KnifeMenuTitle")]
|
[JsonPropertyName("KnifeMenuTitle")]
|
||||||
public string KnifeMenuTitle { get; set; } = "Knife Menu.";
|
public string KnifeMenuTitle { get; set; } = "Knife Menu.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Additional
|
public class Additional
|
||||||
{
|
{
|
||||||
[JsonPropertyName("SkinVisibilityFix")]
|
[JsonPropertyName("SkinVisibilityFix")]
|
||||||
public bool SkinVisibilityFix { get; set; } = true;
|
public bool SkinVisibilityFix { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("KnifeEnabled")]
|
[JsonPropertyName("KnifeEnabled")]
|
||||||
public bool KnifeEnabled { get; set; } = true;
|
public bool KnifeEnabled { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("SkinEnabled")]
|
[JsonPropertyName("SkinEnabled")]
|
||||||
public bool SkinEnabled { get; set; } = true;
|
public bool SkinEnabled { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("CommandWpEnabled")]
|
[JsonPropertyName("CommandWpEnabled")]
|
||||||
public bool CommandWpEnabled { get; set; } = true;
|
public bool CommandWpEnabled { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("CommandKillEnabled")]
|
[JsonPropertyName("CommandKillEnabled")]
|
||||||
public bool CommandKillEnabled { get; set; } = true;
|
public bool CommandKillEnabled { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("CommandKnife")]
|
|
||||||
public string CommandKnife { get; set; } = "knife";
|
|
||||||
|
|
||||||
[JsonPropertyName("CommandSkin")]
|
[JsonPropertyName("CommandKnife")]
|
||||||
public string CommandSkin { get; set; } = "ws";
|
public string CommandKnife { get; set; } = "knife";
|
||||||
|
|
||||||
[JsonPropertyName("CommandRefresh")]
|
[JsonPropertyName("CommandSkin")]
|
||||||
public string CommandRefresh { get; set; } = "wp";
|
public string CommandSkin { get; set; } = "ws";
|
||||||
|
|
||||||
[JsonPropertyName("CommandKill")]
|
[JsonPropertyName("CommandRefresh")]
|
||||||
public string CommandKill { get; set; } = "kill";
|
public string CommandRefresh { get; set; } = "wp";
|
||||||
|
|
||||||
[JsonPropertyName("GiveRandomKnife")]
|
[JsonPropertyName("CommandKill")]
|
||||||
public bool GiveRandomKnife { get; set; } = false;
|
public string CommandKill { get; set; } = "kill";
|
||||||
}
|
|
||||||
|
|
||||||
public class WeaponPaintsConfig : BasePluginConfig
|
[JsonPropertyName("GiveRandomKnife")]
|
||||||
{
|
public bool GiveRandomKnife { get; set; } = false;
|
||||||
public override int Version { get; set; } = 4;
|
}
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseHost")]
|
public class WeaponPaintsConfig : BasePluginConfig
|
||||||
public string DatabaseHost { get; set; } = "";
|
{
|
||||||
|
public override int Version { get; set; } = 4;
|
||||||
|
|
||||||
[JsonPropertyName("DatabasePort")]
|
[JsonPropertyName("DatabaseHost")]
|
||||||
public int DatabasePort { get; set; } = 3306;
|
public string DatabaseHost { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseUser")]
|
[JsonPropertyName("DatabasePort")]
|
||||||
public string DatabaseUser { get; set; } = "";
|
public int DatabasePort { get; set; } = 3306;
|
||||||
|
|
||||||
[JsonPropertyName("DatabasePassword")]
|
[JsonPropertyName("DatabaseUser")]
|
||||||
public string DatabasePassword { get; set; } = "";
|
public string DatabaseUser { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseName")]
|
[JsonPropertyName("DatabasePassword")]
|
||||||
public string DatabaseName { get; set; } = "";
|
public string DatabasePassword { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("CmdRefreshCooldownSeconds")]
|
[JsonPropertyName("DatabaseName")]
|
||||||
public int CmdRefreshCooldownSeconds { get; set; } = 60;
|
public string DatabaseName { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("Prefix")]
|
[JsonPropertyName("GlobalShare")]
|
||||||
public string Prefix { get; set; } = "[WeaponPaints]";
|
public bool GlobalShare { get; set; } = false;
|
||||||
|
|
||||||
[JsonPropertyName("Website")]
|
[JsonPropertyName("CmdRefreshCooldownSeconds")]
|
||||||
public string Website { get; set; } = "example.com/skins";
|
public int CmdRefreshCooldownSeconds { get; set; } = 60;
|
||||||
|
|
||||||
[JsonPropertyName("Messages")]
|
[JsonPropertyName("Prefix")]
|
||||||
public Messages Messages { get; set; } = new Messages();
|
public string Prefix { get; set; } = "[WeaponPaints]";
|
||||||
|
|
||||||
|
[JsonPropertyName("Website")]
|
||||||
|
public string Website { get; set; } = "example.com/skins";
|
||||||
|
|
||||||
|
[JsonPropertyName("Messages")]
|
||||||
|
public Messages Messages { get; set; } = new Messages();
|
||||||
|
|
||||||
|
[JsonPropertyName("Additional")]
|
||||||
|
public Additional Additional { get; set; } = new Additional();
|
||||||
|
}
|
||||||
|
|
||||||
[JsonPropertyName("Additional")]
|
|
||||||
public Additional Additional { get; set; } = new Additional();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ There will be a lot of frequent changes which may break functionality or compati
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
- changes only paint, seed and wear on weapons and knives
|
- changes only paint, seed and wear on weapons and knives
|
||||||
- mysql based
|
- mysql based or global website at [weaponpaints.fun](https://weaponpaints.fun/), so you dont need mysql/website
|
||||||
- data sync on player connect
|
- data sync on player connect
|
||||||
- Added command `!wp` to refresh skins (with cooldown in second can be configured)
|
- Added command `!wp` to refresh skins (with cooldown in second can be configured)
|
||||||
- Added command `!ws` to show website
|
- Added command `!ws` to show website
|
||||||
@@ -20,10 +20,12 @@ There will be a lot of frequent changes which may break functionality or compati
|
|||||||
|
|
||||||
### CS2 server:
|
### CS2 server:
|
||||||
- compile and copy plugin to plugins. Info here [https://docs.cssharp.dev/guides/hello-world-plugin/](https://docs.cssharp.dev/guides/hello-world-plugin/)
|
- compile and copy plugin to plugins. Info here [https://docs.cssharp.dev/guides/hello-world-plugin/](https://docs.cssharp.dev/guides/hello-world-plugin/)
|
||||||
- setup `addons/counterstrikesharp/configs/plugins/WeaponPaints/WeaponPaints.json` with database credentials
|
- setup `addons/counterstrikesharp/configs/plugins/WeaponPaints/WeaponPaints.json`
|
||||||
|
set `GlobalShare` to true for gloval, or include database credentials
|
||||||
- in `addons/counterstrikesharp/configs/core.json` set **FollowCS2ServerGuidelines** to **false**
|
- in `addons/counterstrikesharp/configs/core.json` set **FollowCS2ServerGuidelines** to **false**
|
||||||
|
|
||||||
### Web install:
|
### Web install:
|
||||||
|
- not needed if config `GlobalShare = true`
|
||||||
- requires PHP min v7.3 (tested on php ver `8.2.3` and nginx webserver)
|
- requires PHP min v7.3 (tested on php ver `8.2.3` and nginx webserver)
|
||||||
- copy website to web server (img folder not needed)
|
- copy website to web server (img folder not needed)
|
||||||
- import `database.sql` to mysql
|
- import `database.sql` to mysql
|
||||||
@@ -31,6 +33,9 @@ There will be a lot of frequent changes which may break functionality or compati
|
|||||||
- fill in database credentials and api key in `class/config.php`
|
- fill in database credentials and api key in `class/config.php`
|
||||||
- visit website and login via steam
|
- visit website and login via steam
|
||||||
|
|
||||||
|
### Known issues
|
||||||
|
- Issue on Windows servers, no knives are given.
|
||||||
|
|
||||||
### Use this plugin at your own risk! Using this may lead to GSLT ban or something else Valve come with. [Valve Server guidelines](https://blog.counter-strike.net/index.php/server_guidelines/)
|
### Use this plugin at your own risk! Using this may lead to GSLT ban or something else Valve come with. [Valve Server guidelines](https://blog.counter-strike.net/index.php/server_guidelines/)
|
||||||
|
|
||||||
### Preview
|
### Preview
|
||||||
|
|||||||
1235
WeaponPaints.cs
1235
WeaponPaints.cs
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@
|
|||||||
<PackageReference Include="CounterStrikeSharp.API" Version="*" />
|
<PackageReference Include="CounterStrikeSharp.API" Version="*" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.21" />
|
<PackageReference Include="Dapper" Version="2.1.21" />
|
||||||
<PackageReference Include="MySqlConnector" Version="2.3.1" />
|
<PackageReference Include="MySqlConnector" Version="2.3.1" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user