Raised This Month: $ Target: $400
 0% 

Setting Knife Model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
anon12
Member
Join Date: Aug 2013
Old 07-13-2014 , 23:12   Setting Knife Model
Reply With Quote #1

Why wont it work? The knife model is staying at default..

just wondering wats wrong with my code?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <creditweapons>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new PANDA_KNIFE[64] = "models/SurfWorld/v_pandaknife.mdl"
new DEFAULT_KNIFE[64] = "models/v_knife.mdl"

new bool:DefaultKnife[33]
new 
bool:PandaKnife[33]

#define WEAPON_ID CSW_KNIFE

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("CurWeapon","checkWeapon","be","1=1")
    
    
//Knifes
    
credits_shop_add_item("Default Knife \r[3]""knife"00"Callback_Default")
    
credits_shop_add_item("Panda Knife \r[3]""pandaknife"503000"Callback_PandaKnife")
}
public 
plugin_precache()
{
    
precache_model(DEFAULT_KNIFE)
    
precache_model(PANDA_KNIFE)
}
public 
Callback_Default(id)
{
    
DefaultKnife[id] = true
    PandaKnife
[id] = false
    
    
new weap read_data(2)
    
    if(
weap == WEAPON_ID && DefaultKnife[id] == true)
    {
        
set_pev(idpev_viewmodel2DEFAULT_KNIFE)
    }
}
public 
Callback_PandaKnife(id)
{
    
DefaultKnife[id] = false
    PandaKnife
[id] = true
    
    
new weap read_data(2)
    
        
    if(
weap == WEAPON_ID && PandaKnife[id] == true)
    {
        
set_pev(idpev_viewmodel2PANDA_KNIFE)
    }
}

public 
checkWeapon(id)
{
    new 
weap read_data(2)
    
    if(
weap==WEAPON_ID && PandaKnife[id] == true)
    {
        
set_pev(idpev_viewmodel2PANDA_KNIFE)
    }
    else if(
weap==WEAPON_ID && DefaultKnife[id] == true)
    {
        
set_pev(idpev_viewmodel2DEFAULT_KNIFE)
    }


Last edited by anon12; 07-14-2014 at 02:04.
anon12 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 21:09.


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