Raised This Month: $51 Target: $400
 12% 

Solved Knife model changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
saarthbhosale
Member
Join Date: Feb 2020
Old 04-19-2020 , 03:19   Knife model changer
Reply With Quote #1

Hello, i am running a multimod server so i need different knife skin for different mod

For that, i need an easy sma file where it can find any directory model which i tell it to..

Example :- new knife model should be here:- cstrike/models/sj/knife/knife.mdl

I just need an easy sma code!
Can anybody help me?

Last edited by saarthbhosale; 04-20-2020 at 04:02.
saarthbhosale is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-19-2020 , 06:04   Re: Knife model changer
Reply With Quote #2

Try OciXCrom's plugin. It's not an easy sma code, but i think it can do what u need.

https://forums.alliedmods.net/showthread.php?t=293632
__________________

Last edited by Napoleon_be; 04-19-2020 at 06:04.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-19-2020 , 08:44   Re: Knife model changer
Reply With Quote #3

"Easy" doesn't always mean "good". The above plugin does everything you need and it's EASY to configure via a configuration file that doesn't require you to make any changes to the .sma itself, which is definitely harder to do and can break the plugin if you don't know what you're doing.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
saarthbhosale
Member
Join Date: Feb 2020
Old 04-19-2020 , 09:03   Re: Knife model changer
Reply With Quote #4

Sorry i forgot to say one point, players should be forced to use that skin, without other knife models by typing /knife or something!
saarthbhosale is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-19-2020 , 13:55   Re: Knife model changer
Reply With Quote #5

Configure the model paths in the highlighted lines.

Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #if !defined m_pPlayer     #define m_pPlayer 41 #endif
new const KNIFE_V_MODEL[] = "models/v_my_knife.mdl"
new const KNIFE_P_MODEL[] = "models/p_my_knife.mdl"
public plugin_init() {     register_plugin("Custom Knife Skin", "1.0", "OciXCrom")     RegisterHam(Ham_Item_Deploy, "weapon_knife", "OnSelectKnife", 1) } public plugin_precache() {     precache_model(KNIFE_V_MODEL)     precache_model(KNIFE_P_MODEL) } public OnSelectKnife(iEnt) {     new id = get_pdata_cbase(iEnt, m_pPlayer, 4)     if(is_user_connected(id))     {         set_pev(id, pev_viewmodel2, KNIFE_V_MODEL)         set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL)     } }
__________________

Last edited by OciXCrom; 04-19-2020 at 13:55.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
saarthbhosale
Member
Join Date: Feb 2020
Old 04-19-2020 , 14:25   Re: Knife model changer
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Configure the model paths in the highlighted lines.

Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #if !defined m_pPlayer     #define m_pPlayer 41 #endif
new const KNIFE_V_MODEL[] = "models/v_my_knife.mdl"
new const KNIFE_P_MODEL[] = "models/p_my_knife.mdl"
public plugin_init() {     register_plugin("Custom Knife Skin", "1.0", "OciXCrom")     RegisterHam(Ham_Item_Deploy, "weapon_knife", "OnSelectKnife", 1) } public plugin_precache() {     precache_model(KNIFE_V_MODEL)     precache_model(KNIFE_P_MODEL) } public OnSelectKnife(iEnt) {     new id = get_pdata_cbase(iEnt, m_pPlayer, 4)     if(is_user_connected(id))     {         set_pev(id, pev_viewmodel2, KNIFE_V_MODEL)         set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL)     } }
Thank you!
saarthbhosale is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode