Raised This Month: $ Target: $400
 0% 

Disable weapon pick up


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-06-2013 , 06:23   Disable weapon pick up
Reply With Quote #1

How can i disable picking up, having and buying weapons for ONE person? So the only weapon is knife.

Last edited by Podarok; 03-06-2013 at 06:23.
Podarok is offline
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-06-2013 , 08:57   Re: Disable weapon pick up
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=86089

try this if it helps
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-07-2013 , 00:59   Re: Disable weapon pick up
Reply With Quote #3

Didnt help. Anything more please?
Podarok is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 03-07-2013 , 17:14   Re: Disable weapon pick up
Reply With Quote #4

Quote:
Originally Posted by Podarok View Post
Didnt help. Anything more please?
It does, you can also search through the forum. Sure you'll get a answer.
Torge is offline
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-08-2013 , 00:18   Re: Disable weapon pick up
Reply With Quote #5

I think fakemeta have this function,
you should check other Zombie/HnS plugins code.

check the zombie/runner part.
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
Kard1nal
Senior Member
Join Date: Dec 2012
Location: Russia
Old 03-08-2013 , 01:56   Re: Disable weapon pick up
Reply With Quote #6

Try this to disable pick-up weapons.
Code:
#include <amxmodx> #include <hamsandwich> public plugin_init() {     RegisterHam(Ham_Touch, "weapon_hegrenade", "player_touchweapon")     RegisterHam(Ham_Touch, "weaponbox", "player_touchweapon")     RegisterHam(Ham_Touch, "armoury_entity", "player_touchweapon") } public player_touchweapon(id, ent) return HAM_SUPERCEDE
Kard1nal is offline
Send a message via Skype™ to Kard1nal
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-08-2013 , 04:05   Re: Disable weapon pick up
Reply With Quote #7

Need to disable it only for one particular person, not for all.

PHP Code:
public player_touchweapon(ident
if(
native_to_check_hero(id))
return 
HAM_SUPERCEDE 
Will this work?

Last edited by Podarok; 03-08-2013 at 04:09.
Podarok is offline
Kard1nal
Senior Member
Join Date: Dec 2012
Location: Russia
Old 03-08-2013 , 08:15   Re: Disable weapon pick up
Reply With Quote #8

Only if you got this function (native_to_check_hero(id)) in this plugin and it returns true.

Natives makes in another way, you should search about them.

Edit: and if you want to add IF in ham function, you should do like this to prevent errors:
Code:
public player_touchweapon(id, ent) { if(somefunc(someparam)) return HAM_SUPERCEDE return HAM_IGNORED //Return this when you don't want to block picking-up }
__________________
Sorry for my English, I'm Russian.

Last edited by Kard1nal; 03-08-2013 at 08:26.
Kard1nal is offline
Send a message via Skype™ to Kard1nal
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-08-2013 , 08:53   Re: Disable weapon pick up
Reply With Quote #9

[en] I know how to make natives and i do have them. But didnt know that i have to return HAM_IGNORED, ty ill try it today.
[ru] Спасибо, незнал что нужно хам игнор возвращать... =]

Last edited by Podarok; 03-08-2013 at 08:54.
Podarok is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 03-08-2013 , 12:58   Re: Disable weapon pick up
Reply With Quote #10

Code above blocks only touch. To block
Quote:
Originally Posted by Podarok
having and buying
you also need
Code:
RegisterHam(Ham_AddPlayerItem, "player", "fw_AddPlayerItem");
....

public fw_AddPlayerItem(id, ent)
{
      if (your_variable[id] && cs_get_weapon_id(ent) != CSW_KNIFE)
               return HAM_SUPERCEDE;
 
      return HAM_IGNORED;
}
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Reply


Thread Tools
Display Modes

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 21:42.


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