Raised This Month: $ Target: $400
 0% 

force weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wyrda
Member
Join Date: Nov 2009
Old 01-02-2010 , 14:44   force weapon
Reply With Quote #1

How do I force a player to change weapon to knife?
__________________
wyrda is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-02-2010 , 17:36   Re: force weapon
Reply With Quote #2

engclient_cmd( index, "weapon_knife" );
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
wyrda
Member
Join Date: Nov 2009
Old 01-02-2010 , 18:39   Re: force weapon
Reply With Quote #3

Thank but this doesn't work for what I want.If I select the knife and type /knife I want my model to be changed.If a switch to another weapon and back to knife it works.
__________________
wyrda is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 01-02-2010 , 18:40   Re: force weapon
Reply With Quote #4

You want to change the skin of your knife?
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
wyrda
Member
Join Date: Nov 2009
Old 01-02-2010 , 18:56   Re: force weapon
Reply With Quote #5

Yes.I did it but if the current weapon is the knife I need a "refresh".
__________________
wyrda is offline
wyrda
Member
Join Date: Nov 2009
Old 01-03-2010 , 07:17   Re: force weapon
Reply With Quote #6

I solve it.
Now another problem .
How can I determine what weapon has player now?(don't need with CurWeapon)
Solve it .
__________________
wyrda is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 07:31   Re: force weapon
Reply With Quote #7

get_user_weapon()
__________________
Arkshine is offline
wyrda
Member
Join Date: Nov 2009
Old 01-03-2010 , 08:14   Re: force weapon
Reply With Quote #8

I thought i solve it with get-user_wepon but it doesn't work

PHP Code:
if(PW[id])
    {
        
PW[id]=0;
        new 
ammo,clip;
        if( 
get_user_weapon(id,clip,ammo) == CSW_KNIFE )
            
console_cmd(id,"lastinv;lastinv");
    }
    else
    {
        
PW[id]=1;
        new 
ammo,clip;
        if( 
get_user_weapon(id,clip,ammo) == CSW_KNIFE )        
            
set_pevidpev_viewmodel2g_NewModel );
    } 

If I have a pistol it still change the model.Why?
__________________
wyrda is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 08:30   Re: force weapon
Reply With Quote #9

To change the knife model, you should hook FM_PrecacheModel and FM_ModelIndex ; this way the precache count will not increase.
__________________
Arkshine is offline
wyrda
Member
Join Date: Nov 2009
Old 01-03-2010 , 08:37   Re: force weapon
Reply With Quote #10

Actually when I type /knife I want the knife to change to normal or the new model.
__________________
wyrda 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 04:16.


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