AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finding Out When An Entity Hits A Player (https://forums.alliedmods.net/showthread.php?t=117493)

wrecked_ 02-01-2010 18:00

Finding Out When An Entity Hits A Player
 
What I'm trying to do at the moment is:

1a) Find a forward of some sort that finds if a player is hit by an entity, a grenade for example. [ I have already searched Nomexus's Nade Modes plugin, but it was like finding the needle in a haystack. ]

1b) Maybe I would use a pre-think for something like this?


2) Finding an example to see what this would be like.

Any help would be appreciated.

Owyn 02-01-2010 18:33

Re: Finding Out When An Entity Hits A Player
 
Quote:

/**
* Description: Normally called whenever one entity blocks another from moving.
* Forward params: function(this, idother);
* Return type: None.
* Execute params: ExecuteHam(Ham_Blocked, this, idother);
*/
Ham_Blocked
?

wrecked_ 02-01-2010 18:48

Re: Finding Out When An Entity Hits A Player
 
Quote:

Originally Posted by Owyn (Post 1075554)
?

If it's not too much trouble, could you provide an example?

ConnorMcLeod 02-02-2010 00:56

Re: Finding Out When An Entity Hits A Player
 
register_touch("grenade", "player", "GrenadeTouchByPlayer")

public GrenadeTouchByPlayer(iNade, iPlayer)



or



RegisterHam(Ham_Touch, "grenade", "CGrenade_Touch")

public CGrenade_Touch(iNade, iAnyEnt)

wrecked_ 02-02-2010 15:28

Re: Finding Out When An Entity Hits A Player
 
Thanks Connor.


All times are GMT -4. The time now is 07:21.

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