Raised This Month: $ Target: $400
 0% 

Giving weapon without irrelevant sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m0v3
Member
Join Date: May 2009
Old 12-28-2010 , 21:59   Giving weapon without irrelevant sounds
Reply With Quote #1

How to give a weapon to a player not like he would have bought it ? As I give_item() , or fm_give_item(), seems like player buys it, or picks it up(sound and box in the right side). How can I give a weapon without any of these things? Thank You.
m0v3 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 22:20   Re: Giving weapon without irrelevant sounds
Reply With Quote #2

Use ham_give_weapon() stock by XxAvalanchexX.

You can search for it in the Code Snippets/Tutorials section.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
m0v3
Member
Join Date: May 2009
Old 12-29-2010 , 06:47   Re: Giving weapon without irrelevant sounds
Reply With Quote #3

Yes, weapon doesn't make any sound when is given. But the box(item icon) still appears in the right side of the screen. How could I deal with that ?
m0v3 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2010 , 07:09   Re: Giving weapon without irrelevant sounds
Reply With Quote #4

Code:
GiveItem(id, szItem[]) {     new iForward = register_forward(FM_EmitSound, "EmitSound")     give_item(id, szItem)     unregister_forward(FM_EmitSound, iForward)     emit_sound(id, ) } public EmitSound() {     return FMRES_SUPERCEDE }

You could block WeaponPickUp and AmmoPickUp messages as well, but it's needed so client's hud is properly updated.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-29-2010 at 07:12.
ConnorMcLeod is offline
m0v3
Member
Join Date: May 2009
Old 12-29-2010 , 08:21   Re: Giving weapon without irrelevant sounds
Reply With Quote #5

But as I see that cs_set_bpammo() doesn't emit any sound or send any AmmoPickUp messages. Can't we give weapons in a somehow similar way ? Another question, what will happen if I actually block the WeaponPickUp message ?
m0v3 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 02:08.


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