Raised This Month: $ Target: $400
 0% 

Find grenade in relation to player position?? -- help m3h!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 10-05-2004 , 10:52   Find grenade in relation to player position?? -- help m3h!
Reply With Quote #1

Anyone have any idea if its possible to get the direction of DMG from a grenade? -- or would it be possible to write the coord of a grens position when it detonates?

I also need to find out how far away that point is (but I'm sure there is a distance function)...and at what angle its at...

Anyone mind pointing me in a good direction?
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 10-05-2004 , 11:02  
Reply With Quote #2

The Damage message sends the coords also for hegrens, at least in CS...

if my memory is right...

Try this, dunno if it still works, I had it commented out in one of my plugins:

Code:
register_event("Damage", "hedamage_event", "b", "2!0", "4!0", "5!0", "6!0")

Code:
public hedamage_event(id) {     new inflictor = entity_get_edict(id, EV_ENT_dmg_inflictor)     if (inflictor <= MAXPLAYERS)         return PLUGIN_CONTINUE     new classname2[8]     entity_get_string(inflictor, EV_SZ_classname, classname2, 7)     if (!equal(classname2, "grenade"))         return PLUGIN_CONTINUE     new bangorigin[3]     bangorigin[0] = read_data(4)     bangorigin[1] = read_data(5)     bangorigin[2] = read_data(6)     client_print(0, print_chat, "%d got hit by %d which is a %s, from %d, %d, %d", id, inflictor, classname2, bangorigin[0], bangorigin[1], bangorigin[2])     server_print("%d got hit by %d which is a %s, from %d, %d, %d", id, inflictor, classname2, bangorigin[0], bangorigin[1], bangorigin[2])     feathersnsqueek(bangorigin)     return PLUGIN_CONTINUE }

Now you do the math. :-) Kind of like the feathersnsqueek function name.

I think the coords are used in CS/HL to know where to make the red "hurt" icons you see on screen when you're being shot at.

The coords are integers here, might be a bad thing. Maybe you can get them to be more precise using register_message and reading them as floats.
Johnny got his gun is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 10-05-2004 , 11:10  
Reply With Quote #3

TY JGHG, thats much more than I expected from anybody. -- time for me to get to work.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
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 17:25.


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