danielkrupinski / Osiris

Cross-platform game hack for Counter-Strike 2 with Panorama-based GUI.
MIT License
3.34k stars 963 forks source link

[Help] How to add custom weapon models? or custom Player models into enemy? #2005

Closed sheavyq closed 1 year ago

sheavyq commented 4 years ago

I think use FindMDL, but i dont know how to include that in osiris. Can you help me? :D

NekoRem commented 4 years ago

I'd recommend using Precache models since its better and applies the model instantly instead of needing to change map Relevant documentation: https://www.unknowncheats.me/forum/counterstrike-global-offensive/214919-precache-models.html

sheavyq commented 4 years ago

I'd recommend using Precache models since its better and applies the model instantly instead of needing to change map Relevant documentation: https://www.unknowncheats.me/forum/counterstrike-global-offensive/214919-precache-models.html

I precached my model in Visuals.cpp at Visuals::playerModel(): modelprecache->addString(false, "models/weapons/awp/freedom.mdl");

and change weapon model(at Visuals::playerModel()) const auto cwid = interfaces->entityList->getEntityFromHandle(localPlayer->getActiveWeapon()->handle()); cwid->setModelIndex(interfaces->modelInfo->getModelIndex("models/weapons/awp/freedom.mdl"));

this didnt change anything, can you help me what is wrong with this code? :d