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

Set model when pick up a weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arenmake
Junior Member
Join Date: Apr 2012
Old 04-28-2012 , 07:06   Set model when pick up a weapon
Reply With Quote #1

I have a menu in which I press an option and gives me a gun m4a1, modified model

But if a user selects the option, and then he drops the gun, I do not have to pick the model

I tried Fw_Item_Deploy_Post but I have two types of M4A1, I need to recognize which is which to set a model

As could be solved?

Last edited by Arenmake; 04-28-2012 at 07:17.
Arenmake is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 04-28-2012 , 12:06   Re: Set model when pick up a weapon
Reply With Quote #2

Use Curweapon
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-28-2012 , 15:52   Re: Set model when pick up a weapon
Reply With Quote #3

Quote:
Originally Posted by Bilal Pro View Post
Use Curweapon
No, Ham_Item_Deploy post hook, like how he has it, is the best method.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 04-30-2012 , 07:43   Re: Set model when pick up a weapon
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
No, Ham_Item_Deploy post hook, like how he has it, is the best method.
Teach me the forward please.
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-30-2012 , 07:52   Re: Set model when pick up a weapon
Reply With Quote #5

Quote:
Originally Posted by JoKeR LauGh View Post
Teach me the forward please.
PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_m4a1" "fw_ItemDeployPost"1)

/********************************************/

public fw_ItemDeployPost(Weapon) {     
    if( 
pev_valid(Weapon) != 
        return
        
    static 
id
    
id get_pdata_cbase(Weapon41);
    
    
set_pev(idpev_viewmodel2"models/v_NEWM4A1.mdl")
    
set_pev(idpev_weaponmodel2"models/p_NEWM4A1.mdl")


__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-30-2012 at 07:52.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 04-30-2012 , 07:57   Re: Set model when pick up a weapon
Reply With Quote #6

^_^
Thanks~

But, Can I know what is the different between CurWeapon and Ham_Item_Deploy ?

*EDIT

@rak
for the first parameter in the set_pev why don't you just use loop? Sorry my scripting skill is low..
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 04-30-2012 at 07:58.
JoKeR LauGh is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2012 , 09:28   Re: Set model when pick up a weapon
Reply With Quote #7

Quote:
Originally Posted by JoKeR LauGh View Post
But, Can I know what is the different between CurWeapon and Ham_Item_Deploy ?
Ham_Item_Deploy is called only when the weapon is deployed for use.
CurWeapon is called many times that isn't just for weapon deployment, such as ammo updating.

Quote:
Originally Posted by JoKeR LauGh View Post
for the first parameter in the set_pev why don't you just use loop? Sorry my scripting skill is low..
Because you already know the player who is holding the weapon, so you don't need to set it for all players.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 20:46.


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