weapons icon indicating copy to clipboard operation
weapons copied to clipboard

Random knife bug

Open shubhamdev8 opened this issue 2 years ago • 14 comments

I just updated the plugin from release 1.7.5 to build #53 and I saw a bug in the random knife feature. As soon I select a random knife from the knives menu, I can set the knife's skin to random and all it does is again change my knife to random and if I spam it enough suddenly my knife would disappear and it will give me a MP5-SD. I have attached a video to make it easier to understand. https://drive.google.com/file/d/1DxDGlxCvlnX7lrwlpo5xDhLNOYWhHYe3/view?usp=sharing

sm version

SourceMod 1.10.0.6524, by AlliedModders LLC To see running plugins, type "sm plugins" To see credits, type "sm credits" Visit http://www.sourcemod.net/

metamod version

Metamod:Source Version Information Metamod:Source version 1.11.0-dev+1145 Plugin interface version: 16:14 SourceHook version: 5:5 Loaded As: Valve Server Plugin Compiled on: Jul 11 2021 22:32:15 Built from: https://github.com/alliedmodders/metamod-source/commit/0bb53f2 Build ID: 1145:0bb53f2 http://www.metamodsource.net/

plugins list

"[Retakes] Autoplant" (2.3.1) by B3none "eStickers" (0.3.4) by ESK0 "Anti-Flood" (1.10.0.6524) by AlliedModders LLC "Gloves" (1.0.5) by kgns | oyunhost.net "Nextmap" (1.10.0.6524) by AlliedModders LLC "Fun Commands" (1.10.0.6524) by AlliedModders LLC "Fun Votes" (1.10.0.6524) by AlliedModders LLC "[Retakes] VIP Queue" (1.2.1) by B3none "Nikooo777" (1.0) by Nikooo777 "Basic Ban Commands" (1.10.0.6524) by AlliedModders LLC "RandomCycle" (1.10.0.6524) by AlliedModders LLC "MyWeaponAllocator" (2.5) by shanapu "Admin Menu" (1.10.0.6524) by AlliedModders LLC "Basic Chat" (1.10.0.6524) by AlliedModders LLC "Instant Defuse" (2.0) by Eyal282 "MapChooser" (1.10.0.6524) by AlliedModders LLC "Admin Help" (1.10.0.6524) by AlliedModders LLC "Basic Votes" (1.10.0.6524) by AlliedModders LLC "Updater" (1.2.2) by GoD-Tony "Sound Commands" (1.10.0.6524) by AlliedModders LLC "Basic Comm Control" (1.10.0.6524) by AlliedModders LLC "Admin File Reader" (1.10.0.6524) by AlliedModders LLC "Fix Hint Color Messages" (1.2.2 Franc1sco franug github version) by Phoenix (˙·٠●Феникс●٠·˙) "Client Preferences" (1.10.0.6524) by AlliedModders LLC "Reserved Slots" (1.10.0.6524) by AlliedModders LLC "[Retakes] Bombsite HUD" (2.5.1) by B3none "Rock The Vote" (1.10.0.6524) by AlliedModders LLC "Fix Competitive Warmup" (1.0) by Ilusion9 "AFK Manager" (4.3.0) by Rothgar "eItems" (0.19.1) by ESK0 "Player Commands" (1.10.0.6524) by AlliedModders LLC "CS:GO Retakes" (0.3.4+184) by splewis "Basic Commands" (1.10.0.6524) by AlliedModders LLC "Basic Info Triggers" (1.10.0.6524) by AlliedModders LLC "Friendly Fire Damage" (2.0) by Ilusion9 "Weapons & Knives" (1.7.5) by kgns | oyunhost.net

exts list

"Automatic Updater" (1.10.0.6524) by AlliedModders LLC: Updates SourceMod gamedata files "Webternet" (1.10.0.6524) by AlliedModders LLC: Extension for interacting with URLs "cURL Extension" (1.3.0.0) by ben: cURL Extension "CS Tools" (1.10.0.6524) by AlliedModders LLC: CS extended functionality "BinTools" (1.10.0.6524) by AlliedModders LLC: Low-level C/C++ Calling API "SDK Tools" (1.10.0.6524) by AlliedModders LLC: Source SDK Tools "SDK Hooks" (1.10.0.6524) by AlliedModders LLC: Source SDK Hooks "PTaH" (1.1.3) by Phoenix (˙·٠●Феникс●٠·˙): Additional CS:GO Hooks and Natives "Top Menus" (1.10.0.6524) by AlliedModders: Creates sorted nested menus "Client Preferences" (1.10.0.6524) by AlliedModders: Saves client preference settings "SQLite" (1.10.0.6524) by AlliedModders LLC: SQLite Driver "SteamWorks Extension" (1.2.3) by Kyle Sanderson: Exposes SteamWorks functions to Developers "Socket" (3.0.1) by Player: Socket extension for SourceMod "Regex" (1.10.0.6524) by AlliedModders LLC: Provides regex natives for plugins "REST in Pawn" (1.3.1) by Tsunami: Provides HTTP and JSON natives for plugins "MySQL-DBI" (1.10.0.6524) by AlliedModders LLC: MySQL driver implementation for DBI

shubhamdev8 avatar Nov 13 '21 19:11 shubhamdev8

That's the problem for me too.

VaaLaaKi avatar Nov 16 '21 19:11 VaaLaaKi

Same problem. Sometimes mp5 or mp7 (default skin) This also appears on only awp and only pistol servers and spoils the game.

pcheloveker avatar Nov 27 '21 23:11 pcheloveker

make sure to only use the released versions, not automatic builds from master branch, which is not tested and supported until it becomes a release of its own

kgns avatar Nov 28 '21 00:11 kgns

make sure to only use the released versions, not automatic builds from master branch, which is not tested and supported until it becomes a release of its own

Thanks! I really made a mistake with the version.

pcheloveker avatar Dec 07 '21 19:12 pcheloveker

I have the same problem, version with automatic compilation of the master branch.

I will be downloading the officially released version, would there be any forecast for the Random Knife version?

crashzk avatar Dec 10 '21 02:12 crashzk

I'm still testing it, but I believe the solution would be to remove the index 47 from this line since it would be from the MP5-SD.

https://github.com/kgns/weapons/blob/787c6da5ba69b49cfe386f48fdf5e0b0bdccf9e9/addons/sourcemod/scripting/weapons/globals.sp#L38-L40

I'm testing it here and I'll get back to you as soon as possible.

crashzk avatar Dec 12 '21 01:12 crashzk

I'm still testing it, but I believe the solution would be to remove the index 47 from this line since it would be from the MP5-SD.

https://github.com/kgns/weapons/blob/787c6da5ba69b49cfe386f48fdf5e0b0bdccf9e9/addons/sourcemod/scripting/weapons/globals.sp#L38-L40

I'm testing it here and I'll get back to you as soon as possible.

This change apparently worked, MP5-SD no longer comes when I choose Random Knife. But the bug of when choosing a random knife skin to change the knife still continues.

crashzk avatar Dec 12 '21 02:12 crashzk

I'm still testing it, but I believe the solution would be to remove the index 47 from this line since it would be from the MP5-SD.

https://github.com/kgns/weapons/blob/787c6da5ba69b49cfe386f48fdf5e0b0bdccf9e9/addons/sourcemod/scripting/weapons/globals.sp#L38-L40

I'm testing it here and I'll get back to you as soon as possible.

great find! yes that would be the bug.

random knife giving random knives on every skin change is the way it's supposed to work right now. need more thoughts about how it should work for better ux

kgns avatar Dec 12 '21 03:12 kgns

random knife giving random knives on every skin change is the way it's supposed to work right now. need more thoughts about how it should work for better ux

It's currently like this, if I select the random knife option in the knife menu, every time I go I change the knife, so far perfect.

But if I go with the option to choose a skin for the knife that I'm currently using, whenever I choose a skin, the knife changes and stays in this infinite loop.

I believe it should be like, knife that he is changed to the skin he chose, only when he dies and changes the knife that he can choose another skin for the new knife.

https://vimeo.com/655766099

Short video showing the bug, I believe that leaving it as I mentioned is perfect.

crashzk avatar Dec 12 '21 03:12 crashzk

So far I've just done a PR to fix Random Knives

crashzk avatar Dec 12 '21 03:12 crashzk

again, it's not a bug, it is how it is coded at the moment and it works as it is supposed to currently. i'll take a look at improving how it works later on

kgns avatar Dec 12 '21 03:12 kgns

again, it's not a bug, it is how it is coded at the moment and it works as it is supposed to currently. i'll take a look at improving how it works later on

I understand, I believe that from this method the player can choose skins that he doesn't have for certain knives.

In any case, we are waiting, who knows, more opinions may appear on how they would like it to be.

crashzk avatar Dec 12 '21 03:12 crashzk

again, it's not a bug, it is how it is coded at the moment and it works as it is supposed to currently. i'll take a look at improving how it works later on

I understand, I believe that from this method the player can choose skins that he doesn't have for certain knives.

In any case, we are waiting, who knows, more opinions may appear on how they would like it to be.

Another observation, I noticed that whenever the restart round/game the knife changes. I believe it's better to switch only if the player dies.

crashzk avatar Dec 21 '21 02:12 crashzk

@kgns can the version of the dev branch already be merged into the master branch?

I ask because the latest version of the plugin 1.7.7 does not have some fixes, such as the Random Knife option.

crashzk avatar Jul 26 '22 13:07 crashzk