Raised This Month: $ Target: $400
 0% 

Need some help with knife plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 06-05-2015 , 23:07   Re: Need some help with knife plugin
Reply With Quote #10

Not tested, did a little fix from above code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Bloody Knife"
#define VERSION "1.0"
#define AUTHOR "natsheh"

#define V_KNIFE_DEFAULT_MDL "models/v_knife.mdl"
#define P_KNIFE_DEFAULT_MDL "models/p_knife.mdl"

#define V_KNIFE_BLOODY_MDL "models/v_bloody_knife.mdl"
#define P_KNIFE_BLOODY_MDL "models/p_bloody_knife.mdl"

new bool:gbloodyknife[33]

new const 
XO_WEAPON 4
new const m_pPlayer 41
new const m_pActiveItem 373

public plugin_precache()
{
    
precache_model(V_KNIFE_BLOODY_MDL)
    
precache_model(P_KNIFE_BLOODY_MDL)
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Item_Deploy"weapon_knife""fwd_KnifeDeploy")
    
register_clcmd("drop""clcmd_drop")
}

public 
clcmd_drop(id)
{
    if(
gbloodyknife[id])
        
gbloodyknife[id] = false
    
else
        
gbloodyknife[id] = true
    
new ent get_pdata_cbase(idm_pActiveItem)
    
ExecuteHamB(Ham_Item_Deployent)
}

public 
fwd_KnifeDeploy(ent)
{
    new 
id get_pdata_cbase(entm_pPlayerXO_WEAPON)
    if(!
is_user_alive(id))
        return
    
    if(
gbloodyknife[id])
    {
        
set_pev(id,pev_viewmodel2V_KNIFE_BLOODY_MDL);
        
set_pev(id,pev_weaponmodel2P_KNIFE_BLOODY_MDL);
    }
    else
    {
        
set_pev(id,pev_viewmodel2V_KNIFE_DEFAULT_MDL);
        
set_pev(id,pev_weaponmodel2P_KNIFE_DEFAULT_MDL);
    }
    return
}

public 
client_putinserver(id)
{
    
gbloodyknife[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
__________________

Last edited by Shiina.Mashiro; 06-06-2015 at 21:40.
Shiina.Mashiro is offline
 



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 20:01.


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