AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Team Knife Model (https://forums.alliedmods.net/showthread.php?t=189000)

RuRuRu612754 07-02-2012 15:20

Team Knife Model
 
2 Attachment(s)
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 :
http://forums.alliedmods.net/attachm...1&d=1341256502

TR Knife Model :
http://forums.alliedmods.net/attachm...1&d=1341256512

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)



Aooka 07-02-2012 15:41

Re: Team Knife Model
 
use http://forums.alliedmods.net/showthread.php?t=43979

Or do this check :
Code:
if( cs_get_user_team( id ) == CS_TEAM_CT )

RuRuRu612754 07-02-2012 15:46

Re: Team Knife Model
 
@Aooka
thanks for answer
use this plugin + my code (you code+mycode)?

MiniBrackeur 07-02-2012 15:46

Re: Team Knife Model
 
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)
                }
            }
        }
    }



Liverwiz 07-02-2012 15:47

Re: Team Knife Model
 
Quote:

Originally Posted by Aooka (Post 1741407)
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.

RuRuRu612754 07-02-2012 15:50

Re: Team Knife Model
 
@MiniBrackeur
thanks for answer
thanks code !!

pev_viewmodel2 to use instead of pev_viewmodel why?

MiniBrackeur 07-02-2012 15:58

Re: Team Knife Model
 
It's for v_ model :)

RuRuRu612754 07-02-2012 16:06

Re: Team Knife Model
 
@MiniBrackeur
thanks

If player model
PHP Code:

    new const g_ModelPlayerCT[] = "models/model/modelplayerct.mdl" 
    
set_pev(idpev_modelg_ModelPlayerCT

??

MiniBrackeur 07-02-2012 16:23

Re: Team Knife Model
 
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



RuRuRu612754 07-02-2012 16:28

Re: Team Knife Model
 
@MiniBrackeur
thanks

sorry many question
What is the difference between these?

pev_model
pev_modelindex
pev_viewmodel
pev_weaponmodel
pev_weaponmodel2
pev_viewmodel2


All times are GMT -4. The time now is 15:12.

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