Compare commits

...

3 Commits

Author SHA1 Message Date
Nereziel
29a6041d7a fixed discord link 2023-11-21 19:35:52 +01:00
Nereziel
50777661c5 Merge pull request #55 from daffyyyy/patch-1
Fix when player select "Select skin" as skin
2023-11-19 22:52:08 +01:00
Dawid Bepierszcz
31fd014f55 Fix when player select "Select skin" as skin 2023-11-19 22:42:32 +01:00
2 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
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! 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.
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E2G0P2O) or [Donate on Steam](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E2G0P2O) or [Donate on Steam](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)

View File

@@ -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)