Raised This Month: $12 Target: $400
 3% 

Detect player & damage thru a zone (ent solid)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-22-2008 , 08:15   Detect player & damage thru a zone (ent solid)
Reply With Quote #1

I know that is possible to detect a player that passes thru an invisible block that has an entity attached (trigger_multiple, func_buyzone or something), but how to make amxx detect that ? and launch a function that detects the user's id that passed thru

Also, is it possible to detect damage that passes thru the block ?

This is for utmod, to detect a player that touches a node and damages one .... and oh, forgot, if a player touches, get something from the ent too, get a value from a key
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-22-2008 , 08:19   Re: Detect player & damage thru a zone (ent solid)
Reply With Quote #2

Code:
register_forward(FM_Touch, "your_function")

Code:
public your_function(ent, id) {     if(!is_user_alive(id) || !is_user_connected(id))         return FMRES_IGNORED     if(!pev_valid(ent)) {         return FMRES_IGNORED     }     static classname[33]     pev(ent, pev_classname, classname, charsmax(classname))     if(!equal(classname, "your_classname"))         return FMRES_IGNORED

If you prefer engine module, use register_touch function
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-22-2008 , 08:55   Re: Detect player & damage thru a zone (ent solid)
Reply With Quote #3

I prefer the most performant... and from what I understand from this forum fakemeta is the one

Anyway, this doesn't seem to work
PHP Code:
public event_touch(ent,id){
if(!
is_user_alive(id) || !is_user_connected(id) || !pev_valid(ent)){
return 
FMRES_IGNORED
}
static 
classname[33]
pev(entpev_classnameclassnamecharsmax(classname))
if(
equal(classname"ut_node")){
client_print(0,print_chat,"It works"// test if ent works
client_print(id,print_chat,"IT WORKS !"// test if player detection works
}
return 
FMRES_IGNORED

but actually I think I don't really need that because the nodes won't move so I don't need dynamic origin detection, 'cause I'll detect the origins at map startup...

So, what's better, to detect a player's origin if he's in x/y/z +50/-50 of the node or this (the touch) ?
__________________
Hunter-Digital is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 01-22-2008 , 22:23   Re: Detect player & damage thru a zone (ent solid)
Reply With Quote #4

Use fixed ( known ) values whenever possible. Do not create hooks in the system for some trivial task
_Master_ is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-23-2008 , 06:13   Re: Detect player & damage thru a zone (ent solid)
Reply With Quote #5

And that means... what ? should I take the origin saved in a array at the plugin startup or this (touch forward) thing ?
__________________
Hunter-Digital is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-26-2008 , 01:49   Re: Detect player & damage thru a zone (ent solid)
Reply With Quote #6

* BUMP ? *
__________________
Hunter-Digital is offline
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 04:38.


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