Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spazeONE opened this issue Feb 3, 2023 · 25 comments
Open

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

spazeONE opened this issue Feb 3, 2023 · 25 comments

Comments

@spazeONE
Copy link

spazeONE commented Feb 3, 2023

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
Copy link

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

@spazeONE
Copy link
Author

spazeONE commented Feb 3, 2023

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
Copy link

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
Copy link

SzollosiJanos commented Feb 4, 2023

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
Copy link
Author

spazeONE commented Feb 4, 2023

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
Copy link

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
Copy link
Author

spazeONE commented Feb 4, 2023

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
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link

SzollosiJanos commented Feb 4, 2023

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
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link

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
Copy link
Owner

kgns commented Feb 4, 2023

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
Copy link

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

@kgns
Copy link
Owner

kgns commented Feb 4, 2023

I believe you are mistaken. Check komashchenko/PTaH@74ec371#commitcomment-99256169 and also check your own server logs after a restart

@SzollosiJanos
Copy link

SzollosiJanos commented Feb 4, 2023

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
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link

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

@BKOKAN
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link

So the knives working fine now?

@BKOKAN
Copy link

BKOKAN commented Feb 4, 2023

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
Copy link
Contributor

crashzk commented Feb 5, 2023

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
Copy link

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
Copy link

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

@kimberlyeet
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants