Raised This Month: $ Target: $400
 0% 

Bad Touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-21-2013 , 14:34   Bad Touch
Reply With Quote #1

Please help, I use a variable to block skimmed off arms but when the variable is 0 so sometimes still do not pick up weapons "armoury_entity" I do not understand why please help.

PHP Code:
RegisterHam(Ham_Touch,"weaponbox","player_touchweapon")
RegisterHam(Ham_Touch,"armoury_entity","player_touchweapon"
PHP Code:
public player_touchweapon(ident)
{
    if(
g_BlockWeapons) return HAM_SUPERCEDE
    
return HAM_IGNORED

EDIT: But when a player takes a gun "weaponbox" and had him pick up a gun goes' armoury_entity "but straight weapon" armoury_entity "not ...
__________________

Last edited by _GamerX; 02-21-2013 at 14:37.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 02-22-2013 , 07:16   Re: Bad Touch
Reply With Quote #2

Is it supposed to block all players or individually?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-22-2013 , 07:24   Re: Bad Touch
Reply With Quote #3

Not exactly sure what the problem is in your case (I'm having a hard time reading what you wrote), but for a certain entity classname touching other certain entity classname, you would probably be better off with Engine.
PHP Code:
register_touch("weaponbox""player""player_touchweapon");
register_touch("armoury_entity""player""player_touchweapon"); 
Also, in the touch callback the first parameter is the touched entity, so id, entent, id. Though you're not required to write them in if you don't use them in inside the callback.
PHP Code:
public player_touchweapon()
{
    return 
g_BlockWeapons PLUGIN_HANDLED PLUGIN_CONTINUE;

__________________
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-22-2013 , 13:29   Re: Bad Touch
Reply With Quote #4

Quote:
Originally Posted by _GamerX View Post
Please help, I use a variable to block skimmed off arms but when the variable is 0 so sometimes still do not pick up weapons "armoury_entity" I do not understand why please help.

PHP Code:
RegisterHam(Ham_Touch,"weaponbox","player_touchweapon")
RegisterHam(Ham_Touch,"armoury_entity","player_touchweapon"
PHP Code:
public player_touchweapon(ident)
{
    if(
g_BlockWeapons) return HAM_SUPERCEDE
    
return HAM_IGNORED

EDIT: But when a player takes a gun "weaponbox" and had him pick up a gun goes' armoury_entity "but straight weapon" armoury_entity "not ...
This code is ok, problem seems to come from somewhere else.
Also, as stated, this is for a global block feature, not for individual.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-22-2013 , 13:45   Re: Bad Touch
Reply With Quote #5

Do you use strip_user_weapons?
Backstabnoob is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-23-2013 , 10:14   Re: Bad Touch
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
Not exactly sure what the problem is in your case (I'm having a hard time reading what you wrote), but for a certain entity classname touching other certain entity classname, you would probably be better off with Engine.
PHP Code:
register_touch("weaponbox""player""player_touchweapon");
register_touch("armoury_entity""player""player_touchweapon"); 
Also, in the touch callback the first parameter is the touched entity, so id, entent, id. Though you're not required to write them in if you don't use them in inside the callback.
PHP Code:
public player_touchweapon()
{
    return 
g_BlockWeapons PLUGIN_HANDLED PLUGIN_CONTINUE;

It did not help still sometimes can not take a gun "armoury_entity" when g_BlockWeapons 0

Quote:
Originally Posted by Backstabnoob View Post
Do you use strip_user_weapons?
Yes

But it is strange that grenates going to take even if it's armoury_entity normal weapons no ...
__________________

Last edited by _GamerX; 02-23-2013 at 10:17.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-23-2013 , 11:24   Re: Bad Touch
Reply With Quote #7

[Fix] strip_user_weapons [Cs Specific]
__________________
hleV is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-23-2013 , 13:26   Re: Bad Touch
Reply With Quote #8

Very thanks ! It helped
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
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 21:44.


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