Raised This Month: $ Target: $400
 0% 

Detect trigger_hurt world entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 11-10-2015 , 05:03   Detect trigger_hurt world entity
Reply With Quote #1

Hi.

How can I detect deathrun maps trigger_hurt entities that kill players. It is usually world entity. I have tried this :

Code:
PreThink( id ) .. {                 static ent_name[ 16 ];                 pev( iEnt, pev_classname, ent_name, charsmax(ent_name));                                 client_print( id, print_chat, ent_name );                                 if( equali( ent_name, "trigger_hurt" ) )

When I am standing on the ground that kills me (trigger_hurt world entity) it doesn't print me anything to chat.

Last edited by Kowalsky; 11-11-2015 at 05:55.
Kowalsky is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 11-10-2015 , 10:56   Re: Detect trigger_hurt world entity
Reply With Quote #2

http://www.amxmodx.org/api/engine/find_ent_by_class
jimaway is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 11-11-2015 , 05:54   Re: Detect trigger_hurt world entity
Reply With Quote #3

How can I compare it with pev_groundentity index? I need to obtain index first and then compare its classname, however pev_groundentity doesnt give me the index of world's trigger_hurt (DR maps).
Kowalsky is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 11-11-2015 , 06:07   Re: Detect trigger_hurt world entity
Reply With Quote #4

Code:
        static classname[32]         entity_get_string(ent,EV_SZ_classname,classname,31)                 if(!equal(classname,"trigger_hurt"))             return HAM_IGNORED
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 11-11-2015 , 10:35   Re: Detect trigger_hurt world entity
Reply With Quote #5

trigger_hurt isn't solid, you can't stand on it
jimaway is offline
Vancold
Member
Join Date: Jan 2015
Old 11-12-2015 , 11:55   Re: Detect trigger_hurt world entity
Reply With Quote #6

If you want to hook a trigger_hurt just go for a Ham.
Every trigger_hurt counts.

RegisterHam(Ham_Touch,"trigger_hurt","myFunct ion")

public void myFunction(ent,id){
//check for things; In this case id would be the trigger and ent the player ;)
}
Vancold 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 18:04.


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