AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Giving weapon without irrelevant sounds (https://forums.alliedmods.net/showthread.php?t=146524)

m0v3 12-28-2010 21:59

Giving weapon without irrelevant sounds
 
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.

Exolent[jNr] 12-28-2010 22:20

Re: Giving weapon without irrelevant sounds
 
Use ham_give_weapon() stock by XxAvalanchexX.

You can search for it in the Code Snippets/Tutorials section.

m0v3 12-29-2010 06:47

Re: Giving weapon without irrelevant sounds
 
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 ?

ConnorMcLeod 12-29-2010 07:09

Re: Giving weapon without irrelevant sounds
 
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.

m0v3 12-29-2010 08:21

Re: Giving weapon without irrelevant sounds
 
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 ?


All times are GMT -4. The time now is 02:08.

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