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

Team Knife Model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 07-02-2012 , 15:20   Team Knife Model
Reply With Quote #1

Hello

I need to separate the knife model of TR and CT
I think maybe to use set_pve and pev_viewmodel

CT Knife Model :


TR Knife Model :


Please how to this

Best Regards

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

new ct_knife_model "models/knife/ct_knife.mdl"
new tr_knife_model "models/knife/tr_knife.mdl"

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")
}

public 
plugin_precache() 

    
precache_model(ct_knife_model
    
precache_model(tr_knife_model


public 
ct_knife(id)
{
    
set_pev(idpev_viewmodelct_knife_model)
}

public 
tr_knife(id)
{
    
set_pev(idpev_viewmodeltr_knife_model)

Attached Thumbnails
Click image for larger version

Name:	knife1.jpg
Views:	770
Size:	22.0 KB
ID:	105881   Click image for larger version

Name:	knife2.jpg
Views:	817
Size:	30.4 KB
ID:	105882  

Last edited by RuRuRu612754; 07-02-2012 at 15:21.
RuRuRu612754 is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-02-2012 , 15:41   Re: Team Knife Model
Reply With Quote #2

use http://forums.alliedmods.net/showthread.php?t=43979

Or do this check :
Code:
if( cs_get_user_team( id ) == CS_TEAM_CT )
__________________
Pawn ? Useless
Aooka is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 07-02-2012 , 15:46   Re: Team Knife Model
Reply With Quote #3

@Aooka
thanks for answer
use this plugin + my code (you code+mycode)?
RuRuRu612754 is offline
MiniBrackeur
Senior Member
Join Date: Oct 2010
Old 07-02-2012 , 15:46   Re: Team Knife Model
Reply With Quote #4

Try this:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

new const g_ModelKnifeCT[] = "models/knife/ct_knife.mdl"
new const g_ModelKnifeTE[] = "models/knife/tr_knife.mdl"

public plugin_init()
{
    
register_plugin("Knife models""1.0""Daminou")
    
    
register_event("CurWeapon""model_knife""b")
}

public 
plugin_precache() 

    
precache_model(g_ModelKnifeCT
    
precache_model(g_ModelKnifeTE
}

public 
model_knife(id)
{
    if(
is_user_alive(id) && is_user_connected(id))
    {
        new 
clipammo
        
new knife get_user_weapon(idclipammo)
        if(
knife == CSW_KNIFE)
        {
            switch(
cs_get_user_team(id))
            {
                case 
CS_TEAM_CT:
                {
                    
set_pev(idpev_viewmodel2g_ModelKnifeCT)
                }
                case 
CS_TEAM_T:
                {
                    
set_pev(idpev_viewmodel2g_ModelKnifeTE)
                }
            }
        }
    }

__________________
MiniBrackeur => Daminou
MiniBrackeur is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-02-2012 , 15:47   Re: Team Knife Model
Reply With Quote #5

Quote:
Originally Posted by Aooka View Post
use http://forums.alliedmods.net/showthread.php?t=43979

Or do this check :
Code:
if( cs_get_user_team( id ) == CS_TEAM_CT )
Code:
(get_user_weapon(id) == CSW_KNIFE && cs_get_user_team( id ) == CS_TEAM_CT) ? ct_knife(id) : tr_knife(id)
You're going to have to put that in a CurWeapon event.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-02-2012 at 15:49.
Liverwiz is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 07-02-2012 , 15:50   Re: Team Knife Model
Reply With Quote #6

@MiniBrackeur
thanks for answer
thanks code !!

pev_viewmodel2 to use instead of pev_viewmodel why?
RuRuRu612754 is offline
MiniBrackeur
Senior Member
Join Date: Oct 2010
Old 07-02-2012 , 15:58   Re: Team Knife Model
Reply With Quote #7

It's for v_ model
__________________
MiniBrackeur => Daminou

Last edited by MiniBrackeur; 07-03-2012 at 12:40.
MiniBrackeur is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 07-02-2012 , 16:06   Re: Team Knife Model
Reply With Quote #8

@MiniBrackeur
thanks

If player model
PHP Code:
    new const g_ModelPlayerCT[] = "models/model/modelplayerct.mdl" 
    
set_pev(idpev_modelg_ModelPlayerCT
??
RuRuRu612754 is offline
MiniBrackeur
Senior Member
Join Date: Oct 2010
Old 07-02-2012 , 16:23   Re: Team Knife Model
Reply With Quote #9

Ahah no... x)
use this: http://forums.alliedmods.net/showthread.php?t=80847
And for exemple, may be this code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <playermodel>

public plugin_init()
{
    
register_plugin("Give skin","1.0","Daminou")
    
    
register_clcmd("/skin""cmd_addskin")
    
register_clcmd("/resetskin""cmd_removeskin")
}

public 
plugin_precache()
{
    
precache_model("models/player/skin_ct/skin_ct.mdl")
    
precache_model("models/player/skin_te/skin_te.mdl")
}

public 
cmd_addskin(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You are dead.")
        return 
PLUGIN_HANDLED
    
}
    switch(
cs_get_user_team(id)
    {
        case 
CS_TEAM_T:
        {
            
fm_set_user_model(id"skin_te"false)
        }
        case 
CS_TEAM_CT:
        {
            
fm_set_user_model(id"skin_ct"false)
        }
    }
    
client_print(idprint_chat"You have a new skin.")
}

public 
cmd_removeskin(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You are dead.")
        return 
PLUGIN_HANDLED
    
}
    
fm_reset_user_model(id)
    
client_print(idprint_chat"You have reset your skin.")
    return 
PLUGIN_HANDLED

__________________
MiniBrackeur => Daminou
MiniBrackeur is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 07-02-2012 , 16:28   Re: Team Knife Model
Reply With Quote #10

@MiniBrackeur
thanks

sorry many question
What is the difference between these?

pev_model
pev_modelindex
pev_viewmodel
pev_weaponmodel
pev_weaponmodel2
pev_viewmodel2
RuRuRu612754 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 00:15.


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