Raised This Month: $ Target: $400
 0% 

Urgent: Vehichle kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SirTiger
Member
Join Date: Mar 2004
Old 09-19-2004 , 11:12   Urgent: Vehichle kills
Reply With Quote #1

Dear guys,
I need to find a way to catch kills done by vehichle brushes.
Friendly Fire is off but its a total hell with all the vehichle maps we got on the server. I can probably do the implementation myself,
I just need to find out how to catch a kill done by a vehichle. (Marked as worldspawn unfortunately)

Thanks.
SirTiger is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-20-2004 , 07:23  
Reply With Quote #2

You can try registering deathmsg, and if the killer is unknown (if its not suicide or done buy an actual person) you can persume that it was done by a vehicle...or...a trigger_hurt somewhere on your map...
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
SirTiger
Member
Join Date: Mar 2004
Old 09-20-2004 , 13:07  
Reply With Quote #3

But jumping of a cliff would giving the same result right?
So people might abuse it if I would do it that way.
SirTiger is offline
Trp. Jed
Member
Join Date: Aug 2004
Old 09-20-2004 , 15:54  
Reply With Quote #4

Could you not combine it with pfn_touch to find the toucher and touchee and combined with a death figure out what caused it?
Trp. Jed is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-20-2004 , 16:54  
Reply With Quote #5

Yeah, you can combine what I said with pfn_touch and it should work.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-21-2004 , 12:33  
Reply With Quote #6

but how would u find out it was a vehicle? func_vehicle?
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Votorx
Senior Member
Join Date: Jun 2004
Old 09-21-2004 , 12:52  
Reply With Quote #7

Well...Yeah.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
Trp. Jed
Member
Join Date: Aug 2004
Old 09-21-2004 , 13:51  
Reply With Quote #8

Depending on who touched who first you could check properties of the toucher and touchee entity (such as classname) to identify if they are ones you want to care about. Ones you've identified that they are, you'll need to write the relevant logic to make a descision on what to do.

An example from some code I've written in my own plugin:

Code:
// check if the grenade has hit something // public pfn_touch(ptr, ptd) {         // get the name of the touching entity     new classname[32]     entity_get_string(ptr, EV_SZ_classname, classname, 32)         // was it a smoke grenade?     if (equali(classname, "smoke_grenade")) {         // is it on the ground?         if (entity_get_int(ptr, EV_INT_flags) & FL_ONGROUND)         {             // handle smoke grenade hitting ground                 }else {                                              // hangle grenade hitting anything but ground         }     }     return PLUGIN_CONTINUE }

In this case ptr is the "toucher", ptd is the "touched". Im checking if the entity was of classname "smoke_grenade" and if it was on the ground.

You would use something similar but alter the logic to taste. However ptr and ptd are still valid.
Trp. Jed is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-22-2004 , 13:01  
Reply With Quote #9

Don't forget. The PTD (which is the touched) will always be the player (in this case where you want it to be inbetween a player and an ent).
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-22-2004 , 15:54  
Reply With Quote #10

Quote:
Originally Posted by Votorx
Don't forget. The PTD (which is the touched) will always be the player (in this case where you want it to be inbetween a player and an ent).
always? it cant be when any other two entities touch that are not info_player_start and info_player_deathmatch?
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
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 17:19.


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