Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Bind on head?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-04-2017 , 20:00   Re: [ H3LP ] Bind on head?
Reply With Quote #1

You forgot to put the classnames of the entities when registering FM_Touch...
PHP Code:
register_forward(FM_Touch"forward_touch");
->>
register_forward(FM_Touch"entity_head""player""forward_touch"); 
Since you register touch only between the desired entity and the player, and make an exception if the toucher is the owner of the entity, there won't be any problems...

Also, you forgot that in touch, the indexes you will have are the index of the head entity and the index of the player touching it...

You need to retrieve the index of the owner of the entity, and kill him ( preferably using execute ham kill ) after which you need to remove the entity
__________________

Last edited by Depresie; 04-04-2017 at 20:03.
Depresie is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-04-2017 , 20:36   Re: [ H3LP ] Bind on head?
Reply With Quote #2

Ok! I will try do.

EDIT: One doubt, I am trying to search about how to get owner of the entity, but appears that don't have this.. Can you give me a example?

EDIT 2: entity_get_edict(ENTITY, EV_ENT_owner)
__________________









Last edited by CrazY.; 04-04-2017 at 20:48.
CrazY. is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-05-2017 , 06:27   Re: [ H3LP ] Bind on head?
Reply With Quote #3

When you create the entity, store it's owner's id using this -> set_pev(entity, pev_iuser1) then retrieve it uising pev(entity, pev_iuser1) bla bla

avoid this -> entity_get_edict(ENTITY, EV_ENT_owner) since it triggers some more stuff regarding the entity...
__________________

Last edited by Depresie; 04-05-2017 at 06:29.
Depresie 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 17:48.


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