Raised This Month: $ Target: $400
 0% 

Knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-19-2010 , 05:35   Knife
Reply With Quote #1

Hi ,

I have seen loooots of places where they show how to replace knife skin/model with custom ones .... well that is not exactly what i want ... what i want is

Script :
PHP Code:
#include <amxmodx>
#include <fakemeta_util>

#define PLUGIN "Knife"
#define VERSION "1.0"
#define AUTHOR "Sam"

new Model[] = "models/model.mdl"
new Model1[] = "models/model1.mdl"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2;
        
register_menucmd(register_menuid("Test knife"), keys"ChooseKnife");
    
    
// Clcmd
        
register_clcmd("say /Test""Test");
}

public 
plugin_precache()
{
    
precache_model(Model)
    
precache_model(Model1)
}

public 
Test(id)
{
    new 
menu[192];
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
    
    format
(menu191"Test knife^n^n1. Knife1^n2. Knife2")
    
show_menu(idkeysmenu)
    
    return 
PLUGIN_CONTINUE
}

public 
ChooseChar(idkey
{
    switch (
key)
    {
        case 
1
        {
            
fm_strip_user_weapons(id)
            
fm_give_item(idModel)
            
        }
        case 
2
        {
            
fm_strip_user_weapons(id)
            
fm_give_item(idModel1)
        }
    }
    return 
PLUGIN_HANDLED;

If Option 1 is selected ... I want him to be given Model knife ... and if Option 2 is selected ... i want him to be given Model1 knife.
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-19-2010 , 06:05   Re: Knife
Reply With Quote #2

Maybe this is okay, i dont know

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <fun>

#define PLUGIN "Knife" 
#define VERSION "1.0" 
#define AUTHOR "Sam" 

new Model[] = "models/model.mdl" 
new Model1[] = "models/model1.mdl" 

new bool:g_knifemodel[33][3]

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
    
register_menucmd(register_menuid("Test knife"), keys"ChooseKnife"); 
    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
     
    
// Clcmd 
    
register_clcmd("say /Test""Test"); 


public 
plugin_precache() 

    
precache_model(Model
    
precache_model(Model1


public 
Test(id

    new 
menu[192]; 
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2 
     
    format
(menu191"Test knife^n^n1. Knife1^n2. Knife2"
    
show_menu(idkeysmenu
     
    return 
PLUGIN_CONTINUE 


public 
ChooseChar(idkey)  

    switch (
key
    { 
        case 
1:  
        { 
            
strip_user_weapons(id
            
g_knifemodel[id][1] = true
            give_item
(id"weapon_knife")
             
        } 
        case 
2:  
        { 
            
strip_user_weapons(id
            
g_knifemodel[id][2] = true
            give_item
(id"weapon_knife")
        } 
    } 
    return 
PLUGIN_HANDLED


public 
Event_CurWeapon(id)
{
    new 
weapon get_user_weapon(id)
    
    if (
weapon == CSW_KNIFE && g_knifemodel[id][1])
        
set_pev(idpev_viewmodel2Model)        
    else if (
weapon == CSW_KNIFE && g_knifemodel[id][2])
        
set_pev(idpev_viewmodel2Model1)

Vechta is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-19-2010 , 07:34   Re: Knife
Reply With Quote #3

aww thanx man ... works -.-
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN 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 10:21.


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