kgns / weapons

CS:GO Custom Weapon Options (Skins, NameTag, StatTrak, Wear/Float, Knives)
GNU General Public License v3.0
339 stars 121 forks source link

!knife works but it doesnt change and in !ws menu it doubles it #263

Open spazeONE opened 1 year ago

spazeONE commented 1 year ago

Hi, i installed everything properly and when i type !knife and select a knife it doesnt change meanwhile i can see it in !ws menu but its doubled in the menu. How to fix it ? Or its bcs of new update which fucked up a sourcemod? (THE NOMAD KNIFE IS MY OWN BUT I TRIED TO SELECT SKIN ON IT AND IT WORKED) 20230203222343_1 20230203222356_1

SzollosiJanos commented 1 year ago

Same problem here, the latest cs go update fucked it up.

spazeONE commented 1 year ago

Same problem here, the latest cs go update fucked it up.

Now i tried to set a default knife and the knives worked. But im still wondering why i cant change the knives when i have my own Nomad Crimson Web

SzollosiJanos commented 1 year ago

update: i tried to fix it, and it's working.... kinda..... you need to change the weapons definedid to the new knifes id in ptah weaponequip post function. then ylu can have any knife even if you have cs go knife equiped. The problem is that that knife can not have skin, only vanilla knifes working. I try to fix this issue, then i will post the fix, probably today

SzollosiJanos commented 1 year ago

I fixed the code, now everything works fine. Put this into OnClientPostAdminCheck this line at the end: SDKHook(client, SDKHook_WeaponEquip, OnWeaponEquip);

and then put this code somewhere

public Action OnWeaponEquip(int client, int iWeapon)
{
    int id = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
    if((id>=507 && id<=525)||id==59 || id==42){
        if(g_iKnife[client]!=0){
            SetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex", g_iWeaponDefIndex[g_iKnife[client]]);
            SetEntProp(iWeapon, Prop_Send, "m_iItemIDLow", -1);
            SetEntProp(iWeapon, Prop_Send, "m_nFallbackPaintKit", g_iSkins[client][g_iKnife[client]]);
        }
    }
}

And everything will work just fine Let me know if something doesn't work

spazeONE commented 1 year ago

I fixed the code, now everything works fine. Put this into OnClientPostAdminCheck this line at the end: SDKHook(client, SDKHook_WeaponEquip, OnWeaponEquip);

and then put this code somewhere

public Action OnWeaponEquip(int client, int iWeapon)
{
  int id = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
  if((id>=507 && id<=525)||id==59 || id==42){
      if(g_iKnife[client]!=0){
          SetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex", g_iWeaponDefIndex[g_iKnife[client]]);
          SetEntProp(iWeapon, Prop_Send, "m_iItemIDLow", -1);
          SetEntProp(iWeapon, Prop_Send, "m_nFallbackPaintKit", g_iSkins[client][g_iKnife[client]]);
      }
  }
}

And everything will work just fine Let me know if something doesn't work

can u lead me how to do it little bit? Im just a user of this plugin i dont know nothing about coding etc.

SzollosiJanos commented 1 year ago

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

spazeONE commented 1 year ago

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

That would be lovely from you if u can do it for me! <3

BKOKAN commented 1 year ago

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

Can u send me please the compiled smx file with sp folder.

SzollosiJanos commented 1 year ago

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

Can u send me please the compiled smx file with sp folder.

weapons-dev.zip

BKOKAN commented 1 year ago

t

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

Can u send me please the compiled smx file with sp folder.

weapons-dev.zip Thanks man!!

BKOKAN commented 1 year ago

Can u send me please the compiled smx file with sp folder.

i uploaded all the files u sent me to my

You need to modify the .sp files, then you need to recompile it with sourcemod. I will compile it for you and send it to you in private, if you want it.

Can u send me please the compiled smx file with sp folder.

weapons-dev.zip

i uploaded all the files u sent me on my server but still the same issue. Players who have their own knife equiped in inventory they cant changed it on server. Their knife still remains equiped

SzollosiJanos commented 1 year ago

I tested it on my server, and spazeONE tested it too, it's works fine. Are you sure you did everything correct? You need EVERYTHING up to date. Sourcemod at least 1.11.6928 Latest update of PTaH (https://github.com/komashchenko/PTaH/blob/master/PTaH.games.txt) Latest update of the original weapons plugin, just override the smx file! Do these things, test it and then let me know about it.

kgns commented 1 year ago

I believe this is something to do with PTaH not having all the correct gamedata signatures updated yet.

[PTaH] Could not locate FindMatchingWeaponsForTeamLoadout - Disabling detour
[PTaH] Detour failed FindMatchingWeaponsForTeamLoadout, functionality GiveNamedItemPre will be limited.

Once these signature are found and gamedata is updated, it will probably work as it did before. Until then, I would suggest not trying to find workarounds and just wait. It's not the end of the world :)

SzollosiJanos commented 1 year ago

PTaH is already updated and works just fine, but the plugin doesn't

kgns commented 1 year ago

I believe you are mistaken. Check https://github.com/komashchenko/PTaH/commit/74ec3715c12d0757d20b937ebebe6a0f018c32d9#commitcomment-99256169 and also check your own server logs after a restart

SzollosiJanos commented 1 year ago

I restarted the server, no error log at all, everything works fine :) Maybe PTaH update is bad on github, i use this one, this works fine: PTaH.games.txt No error

BKOKAN commented 1 year ago

in doesn't

I restarted the server, no error log at all, everything works fine :) Maybe PTaH update is bad on github, i use this one, this works fine: PTaH.games.txt No error

i did like u told me. Updated ptah to the latest after that just uploaded ur files that u sent me in zip. Just one thing i needed to copy paste ur PTaH.games.txt for some reason before i copied pasted it server kept crashing. Thanks man.

SzollosiJanos commented 1 year ago

Then you do something wrong. It's working for everyone else, just not for you.

BKOKAN commented 1 year ago

Then you do something wrong. It's working for everyone else, just not for you.

Its fine now. It was issue due to old version of PTaH. Didnt update it in a while.

SzollosiJanos commented 1 year ago

So the knives working fine now?

BKOKAN commented 1 year ago

So the knives working fine now?

yes my friend tested it. He had his knife and tried to change the skin while on server. Works just fine.

crashzk commented 1 year ago

Just for a feedback, record.

After I updated to the latest version of SourceMod & PTaH I downloaded again and just updated the gamedata I don't have this error anymore, I didn't make any changes in the case.

In any case, I'm going to test it thoroughly to see if it really fixed it.

kimberlyeet commented 1 year ago

In my case some players can switch to different knives but some can't, haven't tried the fix posted here. Entries in my MariaDB get updated even if my knife stays the same.

deactivateco commented 1 year ago

WS not working, gloves & knives are, any tips? should i try adding the weapons-dev cfg + addons into my weapon paints?

kimberlyeet commented 1 year ago

So I've just updated PTaH and added these files and its fixed now: https://forums.alliedmods.net/showpost.php?p=2799182&postcount=1812