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

How to give player grenade but don't auto switching weapon to the nade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 10-16-2021 , 02:15   How to give player grenade but don't auto switching weapon to the nade
Reply With Quote #1

For example, He is using a knife now, then I give him a grenade, I want the player doesn't auto switching weapon to the new grenade, but keep using the knife, how?
__________________
youtube:
@holla16

Last edited by 11922911; 10-16-2021 at 02:23.
11922911 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-16-2021 , 09:27   Re: How to give player grenade but don't auto switching weapon to the nade
Reply With Quote #2

1) Give grenade
2) Force weapon switch to knife.

PHP Code:
give_item(id"weapon_hegrenade");
engclient_cmd(id"weapon_knife"); 
__________________
Napoleon_be is online now
Send a message via Skype™ to Napoleon_be
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-16-2021 , 09:39   Re: How to give player grenade but don't auto switching weapon to the nade
Reply With Quote #3

A more elegant way is to use m_iAutoWepSwitch offset, value 509. Set it to 0 to prevent auto weapon switching, before give_item.
__________________

Last edited by HamletEagle; 10-16-2021 at 09:40.
HamletEagle is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 10-16-2021 , 10:20   Re: How to give player grenade but don't auto switching weapon to the nade
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
A more elegant way is to use m_iAutoWepSwitch offset, value 509. Set it to 0 to prevent auto weapon switching, before give_item.
Thanks!!
__________________
youtube:
@holla16
11922911 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 16:23.


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