mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-23 04:00:37 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04bb7a2575 | ||
|
|
f00ba48f60 | ||
|
|
08342e4a99 | ||
|
|
29a6041d7a | ||
|
|
c44433766c | ||
|
|
a987ed972a | ||
|
|
50777661c5 | ||
|
|
31fd014f55 |
57
README.md
57
README.md
@@ -1,30 +1,28 @@
|
|||||||
# 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/EEg6qtNScq) 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 or global website at [weaponpaints.fun](https://weaponpaints.fun/), so you dont need mysql/website
|
- 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`
|
- Setup **`addons/counterstrikesharp/configs/plugins/WeaponPaints/WeaponPaints.json`** set **`GlobalShare`** to **`true`** for global, or include database credentials;
|
||||||
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**
|
|
||||||
|
|
||||||
### Plugin configuration:
|
## Plugin Configuration
|
||||||
<details>
|
<details>
|
||||||
<summary>Spoiler warning</summary>
|
<summary>Spoiler warning</summary>
|
||||||
<code><pre>{
|
<code><pre>{
|
||||||
@@ -65,19 +63,18 @@ There will be a lot of frequent changes which may break functionality or compati
|
|||||||
}</pre></code>
|
}</pre></code>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Web install:
|
## Web install
|
||||||
- not needed if config `GlobalShare = true`
|
Disregard if the config is **`GlobalShare = true`**;
|
||||||
- requires PHP min v7.3 (tested on php ver `8.2.3` and nginx webserver)
|
- Requires PHP >= 7.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; ***(Folder `img` not needed)***
|
||||||
- import `database.sql` to mysql
|
- Get [Steam API Key](https://steamcommunity.com/dev/apikey);
|
||||||
- get steam api key [https://steamcommunity.com/dev/apikey](https://steamcommunity.com/dev/apikey)
|
- 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
|
## Known issues
|
||||||
- Issue on Windows servers, no knives are given.
|
- 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
|
||||||

|

|
||||||
|
|||||||
@@ -22,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]]);
|
||||||
@@ -83,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'])
|
||||||
@@ -120,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