View Single Post
Author Message
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 02-10-2024 , 01:50   [CS] CS 1.5 (Retro) Knife
Reply With Quote #1

Very simple addon to use the CS 1.5 knife model in CS 1.6.

Note that only the p_knife_r.mdl needs to be downloaded from server, since v_knife_r.mdl already exist by default in CS1.6 installation but is unused. The w_knife.mdl is still the same 1.5 model in 1.6, so it doesn't need to be changed.

edit: use the code from the post below, as it is more efficient

Also note that while it's supposedly better to hook v_ / p_ model using
PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_knife""OnKnifeDeploy"1
It doesn't work with bots or on knife maps. While the event method below always works.



PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN "CS 1.5 Knife"
#define VERSION "1.0"
#define AUTHOR "kebabstorm"

#pragma semicolon 1

new const V_KNIFE_R[] = "models/v_knife_r.mdl";
new const 
P_KNIFE_R[] = "models/p_knife_r.mdl";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("CurWeapon""EV_CurWeapon""be""1=1");
}

public 
plugin_precache()
{
    
precache_model(V_KNIFE_R);
    
precache_model(P_KNIFE_R);
}

public 
EV_CurWeapon(player)
{
    if (
get_user_weapon(player) == CSW_KNIFE) {
        
entity_set_string(playerEV_SZ_viewmodelV_KNIFE_R);
        
entity_set_string(playerEV_SZ_weaponmodelP_KNIFE_R);
    }

Attached Files
File Type: zip cs15_knife_models.zip (123.1 KB, 53 views)
__________________

Last edited by anssik; 02-14-2024 at 12:25.
anssik is offline