AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect trigger_hurt world entity (https://forums.alliedmods.net/showthread.php?t=274570)

Kowalsky 11-10-2015 05:03

Detect trigger_hurt world entity
 
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.

jimaway 11-10-2015 10:56

Re: Detect trigger_hurt world entity
 
http://www.amxmodx.org/api/engine/find_ent_by_class

Kowalsky 11-11-2015 05:54

Re: Detect trigger_hurt world entity
 
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).

abdobiskra 11-11-2015 06:07

Re: Detect trigger_hurt world entity
 
Code:
        static classname[32]         entity_get_string(ent,EV_SZ_classname,classname,31)                 if(!equal(classname,"trigger_hurt"))             return HAM_IGNORED

jimaway 11-11-2015 10:35

Re: Detect trigger_hurt world entity
 
trigger_hurt isn't solid, you can't stand on it

Vancold 11-12-2015 11:55

Re: Detect trigger_hurt world entity
 
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 ;)
}


All times are GMT -4. The time now is 18:04.

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