schwarper / cs2-store

A store plugin
https://discord.gg/4zQfUzjk36
GNU General Public License v3.0
35 stars 15 forks source link

[ Need Help ] Can not equip custom weapons #47

Open DearCrazyLeaf opened 1 month ago

DearCrazyLeaf commented 1 month ago

code like:

"litems":{ "weapons": { "xxx_AK47": { "name": "xxx_AK47", "uniqueid": "weapons/.../xxx.vmdl", "type": "weapon", "price": "0", "no_pistol_round": "false", "enable": "true" } } }

Is not working, cannot change the weapon to the custom model. Is this a bug or im doing something wrong?

schwarper commented 1 month ago

code like:

"litems":{ "weapons": { "xxx_AK47": { "name": "xxx_AK47", "uniqueid": "weapons/.../xxx.vmdl", "type": "weapon", "price": "0", "no_pistol_round": "false", "enable": "true" } } }

Is not working, cannot change the weapon to the custom model. Is this a bug or im doing something wrong?

Any error logs?

DearCrazyLeaf commented 1 month ago

I found that the "type" should be "customweapon", so that the plugin can load the models(on server console), but it caused a new problem whitch is the playerskins didnt work.

the detiles: 1.when equip player skin, it shows equipped but not really work (with no info in server console) 2.when equip customweapon, it shows nothing, and the server console shows "the given key 'weapon' was not present in the dictionary." 395e5296e13f235f940f340cdcdb0ea8

DearCrazyLeaf commented 1 month ago

oh and i also find that when opening the server , it will shows "failed loading resource “weapons/..../..... (ERROR_FILEOPEN: File not found)”" but i have already uploaded the weapons file to my workshop and added it in the multiaddonmanager cfg (so as the playerskins models), does the customweapon use a different way to make it loaded?

DearCrazyLeaf commented 1 month ago

Can you show me the right way to add custom weapon? And make it can be used with playerskins (really need it plz).

Here is my cfg, I added 'weapon' into the store.json and it finally worked(with some bugs), but it still cant use with player models. The code: "weapons": { "deagle_hinata": { "name": "若叶日向专武(Deagle)", "uniqueid": "weapons/7ychu5/models/pist_deagle/deagle_hinata/deagle_hinata.vmdl", "weapon": "deagle", "type": "customweapon", "price": "0", "enable": "true" } },

So the BUG is that when I switched the 'deagle' to another weapon and switched it back, the custom model just disappeared, and the skin of the weapon disappered too.

And I cannot use it with playerskins (the playerskins function is good without useing custom weapons).

The playerskins config code: "playerskins": { "HuTao":{ "name": "原神胡桃", "uniqueid": "characters/models/rho/hutao/hutao.vmdl", "armModel": "characters/models/rho/hutao/hutao_arms.vmdl", "type": "playerskin", "price": "0", "slot": "2", "disable_leg": "false", "expiration": "0", "enable": "true" } },

schwarper commented 2 weeks ago

Custom weapon item is not stable right now, need rework. I will try to do it when i am free