weapons icon indicating copy to clipboard operation
weapons copied to clipboard

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

Open spazeONE opened this issue 3 years ago • 25 comments

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

spazeONE avatar Feb 03 '23 21:02 spazeONE

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

SzollosiJanos avatar Feb 03 '23 22:02 SzollosiJanos

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

spazeONE avatar Feb 03 '23 22:02 spazeONE

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 avatar Feb 04 '23 13:02 SzollosiJanos

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

SzollosiJanos avatar Feb 04 '23 16:02 SzollosiJanos

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.

spazeONE avatar Feb 04 '23 16:02 spazeONE

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.

SzollosiJanos avatar Feb 04 '23 17:02 SzollosiJanos

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

spazeONE avatar Feb 04 '23 17:02 spazeONE

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.

BKOKAN avatar Feb 04 '23 21:02 BKOKAN

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

SzollosiJanos avatar Feb 04 '23 21:02 SzollosiJanos

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 avatar Feb 04 '23 21:02 BKOKAN

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

BKOKAN avatar Feb 04 '23 21:02 BKOKAN

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.

SzollosiJanos avatar Feb 04 '23 22:02 SzollosiJanos

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

kgns avatar Feb 04 '23 22:02 kgns

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

SzollosiJanos avatar Feb 04 '23 22:02 SzollosiJanos

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

kgns avatar Feb 04 '23 22:02 kgns

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

SzollosiJanos avatar Feb 04 '23 22:02 SzollosiJanos

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.

BKOKAN avatar Feb 04 '23 23:02 BKOKAN

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

SzollosiJanos avatar Feb 04 '23 23:02 SzollosiJanos

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.

BKOKAN avatar Feb 04 '23 23:02 BKOKAN

So the knives working fine now?

SzollosiJanos avatar Feb 04 '23 23:02 SzollosiJanos

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.

BKOKAN avatar Feb 04 '23 23:02 BKOKAN

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.

crashzk avatar Feb 05 '23 12:02 crashzk

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.

kimberlyeet avatar Feb 08 '23 12:02 kimberlyeet

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

deactivateco avatar Feb 23 '23 22:02 deactivateco

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

kimberlyeet avatar Feb 24 '23 07:02 kimberlyeet