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

Keep knife model and speed/gravity after switching weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-17-2018 , 13:33   Keep knife model and speed/gravity after switching weapon
Reply With Quote #1

Hello, I wanted to ask if anyone knows how to add knife model without being replaced by normal knife while switching between other weapons. The same could be done to gravity and speed.
LemoNSK is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 13:47   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #2

Use Ham_Item_Deploy for knife model.
Use Ham_Item_PreFrame for speed.
Nothing to do for gravity.
__________________

Last edited by HamletEagle; 07-17-2018 at 13:47.
HamletEagle is online now
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-17-2018 , 13:56   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #3

Can it be given by menu for example in the middle of the round?
LemoNSK is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 14:50   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #4

Why not?
__________________
HamletEagle is online now
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-17-2018 , 14:55   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #5

Alright, I figured it out myself. Now I can't use slash and stab.. It also disabled an ability to shoot from pistol. Any advice?

Last edited by LemoNSK; 07-17-2018 at 15:33.
LemoNSK is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 17:59   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #6

Quote:
Originally Posted by LemoNSK View Post
Alright, I figured it out myself. Now I can't use slash and stab.. It also disabled an ability to shoot from pistol. Any advice?
If you don't show what you did we can't help.
__________________
HamletEagle is online now
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 18:04   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
Nothing to do for gravity.
He can set the gravity after weapon switch
__________________
edon1337 is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 00:41   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #8

So what I basically done was adding these two lines into my menu handler, when someone chooses a model:

PHP Code:
deployWeapon[id] = 1//Variable for every player. Value 1 means that Ham will be executed after this is performed.
set_pev(idpev_viewmodel2fireaxe_v); //Temporary sets the model 
Then,

PHP Code:
public DeployAxe weapon_ent )
{
    static 
id
    
id get_pdata_cbase(weapon_ent41);
    
    if(
deployWeapon[id] == 1)
    {
    
        
set_pev(idpev_viewmodel2fireaxe_v);    
        
ExecuteHamB(Ham_Item_Deployid);
    }

And the RegisterHam is in the PLUGIN_INIT.
This is all what I have done.

Don't hate me even if it's from my own head. I tried to figure it out myself somehow.

Last edited by LemoNSK; 07-18-2018 at 00:42.
LemoNSK is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 02:06   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #9

Well, my method was actually correct (it works now) but the plugin itself was somehow bugged from last attempts .. Thank you all for your assistence. I figured it out myself.
LemoNSK is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-18-2018 , 05:00   Re: Keep knife model and speed/gravity after switching weapon
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
He can set the gravity after weapon switch
Why? Gravity doesn't reset on weapon switch like speed. It is enough to set it once.
__________________
HamletEagle is online now
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 05:10.


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