Raised This Month: $ Target: $400
 0% 

Couple a questions in one post.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trp. Jed
Member
Join Date: Aug 2004
Old 09-14-2004 , 17:22   Couple a questions in one post.
Reply With Quote #1

Figured I'l put them all in one..

1) Is it possible to detect what caused damage to a player? For example, if you were shot and lost 10hp, is there an event or something that can be trapped that will return the name or ID os the weapon that hit you?

2) Akin to the above, I'm wondering if its possible to detect if damage to you was caused by a grenade and if its possible to trap when a grenade explosion takes place and get the location where it occured.

3) Looking at a couple of sprite related plugins, is it possible in some way to make the sprite only visible to a certain playing? The idea being that when you place your crosshairs over a player you see a sprite for them but no-one else can, when you move away it goes.
Trp. Jed is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-14-2004 , 17:36  
Reply With Quote #2

1/2. Yes. Damage/Death event

3. Dont think so
Freecode is offline
Trp. Jed
Member
Join Date: Aug 2004
Old 09-14-2004 , 17:45  
Reply With Quote #3

O.K. Another quick one...

Whats the best techique to "throw" a model in the same way as a grenade? I.E use triggers the event (say via a bind) and a model is thrown with a certain velocity in the direction their aiming. I know gibs work in a similar way and correctly bounce off walls and come to rest on floors so I'm assuming theres some sort of function that can do this?
Trp. Jed is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-14-2004 , 17:47  
Reply With Quote #4

u wanna change grenades model?
Freecode is offline
Trp. Jed
Member
Join Date: Aug 2004
Old 09-14-2004 , 17:55  
Reply With Quote #5

No, I want to retain them, I just want to create my own function which effectively "fires" off a model as it it were a grenade.
Trp. Jed is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-14-2004 , 17:58  
Reply With Quote #6

create an entity set its movetype and its model.
Freecode is offline
Trp. Jed
Member
Join Date: Aug 2004
Old 09-14-2004 , 18:31  
Reply With Quote #7

OK so let me see if I've got your right...

Code:
new iThrowable = create_entity( <classname> )
entity_set_model( iThrowable, <model name> )

new Float:fOrigin[3]
entity_get_vector( id, EV_VEC_origin, fOrigin )
entity_set_origin( iPlayerSprite, fOrigin )

entity_set_int( iThrowable, EV_INT_movetype, MOVETYPE_BOUNCE )
entity_set_int( iThrowable, EV_INT_solid, SOLID_NOT )
I think thats what you said, i.e create the entity, set its model, origina dn movetype. But how do I actually "throw" it in the direction the user is aiming at at a certain velocity?

Oh I forgot to ask, what classname should I use for the entirty? info_target?
Trp. Jed is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-14-2004 , 18:37  
Reply With Quote #8

On #3 doesn't WAR3FT have sprites that only the player aiming at the certain player can see? (The race sprites)
__________________
twistedeuphoria is offline
Trp. Jed
Member
Join Date: Aug 2004
Old 09-14-2004 , 18:43  
Reply With Quote #9

Don't know, need to look into that.
Trp. Jed is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-15-2004 , 02:12  
Reply With Quote #10

You can try to set the entity's velocity in order to "give it a kick in the right direction":

Code:
entity_set_vector(yourentity, EV_VEC_velocity, {0.0, 0.0, 100.0})

...would send it straight up with a velocity of "100.0" in this case. It's like X*Z*Y, where Y is up and down.
Johnny got his gun 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 17:13.


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