mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 18:49:21 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf421c5614 | ||
|
|
fc64e1d261 | ||
|
|
45fc4a86a5 | ||
|
|
ad105e5cd2 | ||
|
|
f668f56d66 | ||
|
|
de6672507a | ||
|
|
2855d4e9ae | ||
|
|
0c05c25e8e | ||
|
|
8335ede7d7 | ||
|
|
d79246f161 | ||
|
|
a504506129 | ||
|
|
7bada81eb9 | ||
|
|
2929735429 | ||
|
|
04bb7a2575 | ||
|
|
f00ba48f60 | ||
|
|
08342e4a99 | ||
|
|
29a6041d7a | ||
|
|
c44433766c | ||
|
|
a987ed972a | ||
|
|
50777661c5 | ||
|
|
31fd014f55 | ||
|
|
760429e644 | ||
|
|
304d8501cc | ||
|
|
e9f7db5171 | ||
|
|
648b928b4e | ||
|
|
530a7d64c7 | ||
|
|
3453f4c505 | ||
|
|
25b466422b | ||
|
|
6baa59dd9b | ||
|
|
10afe7ce1e | ||
|
|
5eeb0c5fec | ||
|
|
e53ee27b39 | ||
|
|
75112b02fe | ||
|
|
8e92635231 |
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@@ -3,8 +3,16 @@ name: Build
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
|
- '**/.gitignore'
|
||||||
|
- '**/LICENSE'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
|
- '**/.gitignore'
|
||||||
|
- '**/LICENSE'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_NUMBER: ${{ github.run_number }}
|
BUILD_NUMBER: ${{ github.run_number }}
|
||||||
@@ -12,7 +20,6 @@ env:
|
|||||||
PROJECT_NAME: "WeaponPaints"
|
PROJECT_NAME: "WeaponPaints"
|
||||||
OUTPUT_PATH: "./WeaponPaints"
|
OUTPUT_PATH: "./WeaponPaints"
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
@@ -30,6 +37,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
|
||||||
@@ -50,6 +58,8 @@ jobs:
|
|||||||
${{ env.OUTPUT_PATH }}/McMaster.NETCore.Plugins.dll \
|
${{ env.OUTPUT_PATH }}/McMaster.NETCore.Plugins.dll \
|
||||||
${{ env.OUTPUT_PATH }}/Microsoft.DotNet.PlatformAbstractions.dll \
|
${{ env.OUTPUT_PATH }}/Microsoft.DotNet.PlatformAbstractions.dll \
|
||||||
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
|
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
|
||||||
|
- name: Copy skins.json
|
||||||
|
run: cp website/data/skins.json ${{ env.OUTPUT_PATH }}/skins.json
|
||||||
- name: Zip
|
- name: Zip
|
||||||
uses: thedoctor0/zip-release@0.7.5
|
uses: thedoctor0/zip-release@0.7.5
|
||||||
with:
|
with:
|
||||||
@@ -72,4 +82,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
|
||||||
|
|||||||
151
Config.cs
151
Config.cs
@@ -3,92 +3,107 @@ 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("ChosenSkinMenu")]
|
||||||
public string ChosenKnifeMenuKill { get; set; } = "To correctly apply skin for knife, you need to type !kill.";
|
public string ChosenSkinMenu { get; set; } = "You have chosen {SKIN} as your skin.";
|
||||||
[JsonPropertyName("KnifeMenuTitle")]
|
[JsonPropertyName("ChosenKnifeMenuKill")]
|
||||||
public string KnifeMenuTitle { get; set; } = "Knife Menu.";
|
public string ChosenKnifeMenuKill { get; set; } = "To correctly apply skin for knife, you need to type !kill.";
|
||||||
}
|
[JsonPropertyName("KnifeMenuTitle")]
|
||||||
|
public string KnifeMenuTitle { get; set; } = "Knife Menu.";
|
||||||
|
[JsonPropertyName("WeaponMenuTitle")]
|
||||||
|
public string WeaponMenuTitle { get; set; } = "Weapon Menu.";
|
||||||
|
[JsonPropertyName("SkinMenuTitle")]
|
||||||
|
public string SkinMenuTitle { get; set; } = "Select skin for {WEAPON}";
|
||||||
|
}
|
||||||
|
|
||||||
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("CommandSkinSelection")]
|
||||||
public string CommandKill { get; set; } = "kill";
|
public string CommandSkinSelection { get; set; } = "skins";
|
||||||
|
|
||||||
[JsonPropertyName("GiveRandomKnife")]
|
[JsonPropertyName("CommandRefresh")]
|
||||||
public bool GiveRandomKnife { get; set; } = false;
|
public string CommandRefresh { get; set; } = "wp";
|
||||||
}
|
|
||||||
|
|
||||||
public class WeaponPaintsConfig : BasePluginConfig
|
[JsonPropertyName("CommandKill")]
|
||||||
{
|
public string CommandKill { get; set; } = "kill";
|
||||||
public override int Version { get; set; } = 4;
|
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseHost")]
|
[JsonPropertyName("GiveRandomKnife")]
|
||||||
public string DatabaseHost { get; set; } = "";
|
public bool GiveRandomKnife { get; set; } = false;
|
||||||
|
|
||||||
[JsonPropertyName("DatabasePort")]
|
[JsonPropertyName("GiveRandomSkin")]
|
||||||
public int DatabasePort { get; set; } = 3306;
|
public bool GiveRandomSkin { get; set; } = false;
|
||||||
|
}
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseUser")]
|
public class WeaponPaintsConfig : BasePluginConfig
|
||||||
public string DatabaseUser { get; set; } = "";
|
{
|
||||||
|
public override int Version { get; set; } = 4;
|
||||||
|
|
||||||
[JsonPropertyName("DatabasePassword")]
|
[JsonPropertyName("DatabaseHost")]
|
||||||
public string DatabasePassword { get; set; } = "";
|
public string DatabaseHost { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("DatabaseName")]
|
[JsonPropertyName("DatabasePort")]
|
||||||
public string DatabaseName { get; set; } = "";
|
public int DatabasePort { get; set; } = 3306;
|
||||||
|
|
||||||
[JsonPropertyName("CmdRefreshCooldownSeconds")]
|
[JsonPropertyName("DatabaseUser")]
|
||||||
public int CmdRefreshCooldownSeconds { get; set; } = 60;
|
public string DatabaseUser { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("Prefix")]
|
[JsonPropertyName("DatabasePassword")]
|
||||||
public string Prefix { get; set; } = "[WeaponPaints]";
|
public string DatabasePassword { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("Website")]
|
[JsonPropertyName("DatabaseName")]
|
||||||
public string Website { get; set; } = "example.com/skins";
|
public string DatabaseName { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("Messages")]
|
[JsonPropertyName("GlobalShare")]
|
||||||
public Messages Messages { get; set; } = new Messages();
|
public bool GlobalShare { get; set; } = false;
|
||||||
|
|
||||||
|
[JsonPropertyName("CmdRefreshCooldownSeconds")]
|
||||||
|
public int CmdRefreshCooldownSeconds { get; set; } = 60;
|
||||||
|
|
||||||
|
[JsonPropertyName("Prefix")]
|
||||||
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
95
README.md
95
README.md
@@ -1,37 +1,80 @@
|
|||||||
# cs2-WeaponPaints
|
# CS2 Weapon Paints
|
||||||
|
|
||||||
### Description
|
## Description
|
||||||
Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin for [CSSharp](https://docs.cssharp.dev/).
|
Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin for **[CSSharp](https://docs.cssharp.dev/)**.
|
||||||
There will be a lot of frequent changes which may break functionality or compatibility. You have been warned!
|
|
||||||
|
|
||||||
## Created [Discord server](https://discord.gg/mwEQppJ5AT) where you can discus about plugin.
|
## Created [Discord server](https://discord.gg/d9CvaYPSFe) where you can discus about plugin.
|
||||||
|
|
||||||
### Consider to donate instead of buying from unknown sources.
|
### Consider to donate instead of buying from unknown sources.
|
||||||
[](https://ko-fi.com/E1E2G0P2O) or [Donate on Steam](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)
|
[](https://ko-fi.com/E1E2G0P2O) or [](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)
|
||||||
|
|
||||||
### 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;
|
||||||
- Added command `!knife` to show menu with knives
|
- Added command **`!knife`** to show menu with knives;
|
||||||
- Knife change is now limited to have these cvars empty `mp_t_default_melee ""` and `mp_ct_default_melee ""`
|
- Knife change is now limited to have these cvars empty **`mp_t_default_melee ""`** and **`mp_ct_default_melee ""`**;
|
||||||
|
|
||||||
### 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, [more info here](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 global, 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:
|
## Plugin Configuration
|
||||||
- requires PHP min v7.3 (tested on php ver `8.2.3` and nginx webserver)
|
<details>
|
||||||
- copy website to web server (img folder not needed)
|
<summary>Spoiler warning</summary>
|
||||||
- import `database.sql` to mysql
|
<code><pre>{
|
||||||
- get steam api key [https://steamcommunity.com/dev/apikey](https://steamcommunity.com/dev/apikey)
|
"Version": 4, // Don't touch
|
||||||
- fill in database credentials and api key in `class/config.php`
|
"DatabaseHost": "", // MySQL host (required if GlobalShare = false)
|
||||||
- visit website and login via steam
|
"DatabasePort": 3306, // MySQL port (required if GlobalShare = false)
|
||||||
|
"DatabaseUser": "", // MySQL username (required if GlobalShare = false)
|
||||||
|
"DatabasePassword": "", // MySQL user password (required if GlobalShare = false)
|
||||||
|
"DatabaseName": "", // MySQL database name (required if GlobalShare = false)
|
||||||
|
"GlobalShare": false, // Enable or disable GlobalShare, plugin can work without mysql credentials but with shared website at weaponpaints.fun
|
||||||
|
"CmdRefreshCooldownSeconds": 60, // Cooldown time in refreshing skins (!wp command)
|
||||||
|
"Prefix": "[WeaponPaints]", // Prefix every chat message
|
||||||
|
"Website": "example.com/skins", // Website used in WebsiteMessageCommand (!ws command)
|
||||||
|
"Messages": {
|
||||||
|
"WebsiteMessageCommand": "Visit {WEBSITE} where you can change skins.", // Information about website where player can change skins (!ws command) Set to empty to disable
|
||||||
|
"SynchronizeMessageCommand": "Type !wp to synchronize chosen skins.", // Information about skins refreshing (!ws command) Set to empty to disable
|
||||||
|
"KnifeMessageCommand": "Type !knife to open knife menu.", // Information about knife menu (!ws command) Set to empty to disable
|
||||||
|
"CooldownRefreshCommand": "You can\u0027t refresh weapon paints right now.", // Cooldown information (!wp command) Set to empty to disable
|
||||||
|
"SuccessRefreshCommand": "Refreshing weapon paints.", // Information about refreshing skins (!wp command) Set to empty to disable
|
||||||
|
"ChosenKnifeMenu": "You have chosen {KNIFE} as your knife.", // Information about choosen knife (!knife command) Set to empty to disable
|
||||||
|
"ChosenKnifeMenuKill": "To correctly apply skin for knife, you need to type !kill.", // Information about suicide after knife selection (!knife command) Set to empty to disable
|
||||||
|
"KnifeMenuTitle": "Knife Menu." // Menu title (!knife menu)
|
||||||
|
},
|
||||||
|
"Additional": {
|
||||||
|
"SkinVisibilityFix": true, // Enable or disable fix for skin visibility
|
||||||
|
"KnifeEnabled": true, // Enable or disable knife feature
|
||||||
|
"SkinEnabled": true, // Enable or disable skin feature
|
||||||
|
"CommandWpEnabled": true, // Enable or disable refreshing command
|
||||||
|
"CommandKillEnabled": true, // Enable or disable kill command
|
||||||
|
"CommandKnife": "knife", // Name of knife menu command, u can change to for e.g, knives
|
||||||
|
"CommandSkin": "ws", // Name of skin information command, u can change to for e.g, skins
|
||||||
|
"CommandRefresh": "wp", // Name of skin refreshing command, u can change to for e.g, refreshskins
|
||||||
|
"CommandKill": "kill", // Name of kill command, u can change to for e.g, suicide
|
||||||
|
"GiveRandomKnife": false // Give random knife to players if they didn't choose
|
||||||
|
},
|
||||||
|
|
||||||
|
"ConfigVersion": 4 // Don't touch
|
||||||
|
}</pre></code>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Web install
|
||||||
|
Disregard if the config is **`GlobalShare = true`**;
|
||||||
|
- Requires PHP >= 7.4; ***(Tested on php ver **`8.2.3`** and nginx webserver)***
|
||||||
|
- Copy website to web server; ***(Folder `img` not needed)***
|
||||||
|
- Get [Steam API Key](https://steamcommunity.com/dev/apikey);
|
||||||
|
- Fill in database credentials and api key in `class/config.php`;
|
||||||
|
- 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
|
||||||

|

|
||||||
|
|||||||
1588
WeaponPaints.cs
1588
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>
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ require_once 'class/utils.php';
|
|||||||
|
|
||||||
$db = new DataBase();
|
$db = new DataBase();
|
||||||
if (isset($_SESSION['steamid'])) {
|
if (isset($_SESSION['steamid'])) {
|
||||||
|
$steamid = $_SESSION['steamid'];
|
||||||
include('steamauth/userInfo.php');
|
|
||||||
$steamid = $steamprofile['steamid'];
|
|
||||||
|
|
||||||
$weapons = UtilsClass::getWeaponsFromArray();
|
$weapons = UtilsClass::getWeaponsFromArray();
|
||||||
$skins = UtilsClass::skinsFromJson();
|
$skins = UtilsClass::skinsFromJson();
|
||||||
@@ -24,6 +22,8 @@ if (isset($_SESSION['steamid'])) {
|
|||||||
if ($ex[0] == "knife") {
|
if ($ex[0] == "knife") {
|
||||||
$db->query("INSERT INTO `wp_player_knife` (`steamid`, `knife`) VALUES(:steamid, :knife) ON DUPLICATE KEY UPDATE `knife` = :knife", ["steamid" => $steamid, "knife" => $knifes[$ex[1]]['weapon_name']]);
|
$db->query("INSERT INTO `wp_player_knife` (`steamid`, `knife`) VALUES(:steamid, :knife) ON DUPLICATE KEY UPDATE `knife` = :knife", ["steamid" => $steamid, "knife" => $knifes[$ex[1]]['weapon_name']]);
|
||||||
} else {
|
} else {
|
||||||
|
if (!is_int($ex[1]))
|
||||||
|
header("Location: index.php");
|
||||||
if (array_key_exists($ex[1], $skins[$ex[0]])) {
|
if (array_key_exists($ex[1], $skins[$ex[0]])) {
|
||||||
if (array_key_exists($ex[0], $selectedSkins)) {
|
if (array_key_exists($ex[0], $selectedSkins)) {
|
||||||
$db->query("UPDATE wp_player_skins SET weapon_paint_id = :weapon_paint_id WHERE steamid = :steamid AND weapon_defindex = :weapon_defindex", ["steamid" => $steamid, "weapon_defindex" => $ex[0], "weapon_paint_id" => $ex[1]]);
|
$db->query("UPDATE wp_player_skins SET weapon_paint_id = :weapon_paint_id WHERE steamid = :steamid AND weapon_defindex = :weapon_defindex", ["steamid" => $steamid, "weapon_defindex" => $ex[0], "weapon_paint_id" => $ex[1]]);
|
||||||
@@ -85,7 +85,7 @@ if (isset($_SESSION['steamid'])) {
|
|||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<select name="forma" class="form-control select" onchange="this.form.submit()" class="SelectWeapon">
|
<select name="forma" class="form-control select" onchange="this.form.submit()" class="SelectWeapon">
|
||||||
<option>Select knife</option>
|
<option disabled>Select knife</option>
|
||||||
<?php
|
<?php
|
||||||
foreach ($knifes as $knifeKey => $knife) {
|
foreach ($knifes as $knifeKey => $knife) {
|
||||||
if ($selectedKnife['knife'] == $knife['weapon_name'])
|
if ($selectedKnife['knife'] == $knife['weapon_name'])
|
||||||
@@ -122,7 +122,7 @@ if (isset($_SESSION['steamid'])) {
|
|||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<select name="forma" class="form-control select" onchange="this.form.submit()" class="SelectWeapon">
|
<select name="forma" class="form-control select" onchange="this.form.submit()" class="SelectWeapon">
|
||||||
<option>Select skin</option>
|
<option disabled>Select skin</option>
|
||||||
<?php
|
<?php
|
||||||
foreach ($skins[$defindex] as $paintKey => $paint) {
|
foreach ($skins[$defindex] as $paintKey => $paint) {
|
||||||
if (array_key_exists($defindex, $selectedSkins) && $selectedSkins[$defindex] == $paintKey)
|
if (array_key_exists($defindex, $selectedSkins) && $selectedSkins[$defindex] == $paintKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user