Raised This Month: $ Target: $400
 0% 

Urgent: Vehichle kills


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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