2 registered members (TipmyPip, 1 invisible),
18,731
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: What is the best way
[Re: fabiomartins]
#428666
08/31/13 17:41
08/31/13 17:41
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
A little example: The grenade will explode when hitting a wall or something.
pXent_getvelocity(nade, vVel, nullvector);
if((vec_length(vVel) - oldVel) <= -20)
{
sv_blowGrenade(nade);
break;
}
oldVel = vec_length(vVel);
Last edited by Ch40zzC0d3r; 08/31/13 17:42.
|
|
|
Re: What is the best way
[Re: Ch40zzC0d3r]
#428667
08/31/13 18:35
08/31/13 18:35
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
i would prefer a simpler solution:
[code] VECTOR vel; pXent_getvelocity(ent, vel, vector(0,0,0)); if(vec_length(vel) < 0.2) { // ent is not moving }
|
|
|
Re: What is the best way
[Re: fabiomartins]
#428670
08/31/13 19:10
08/31/13 19:10
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
you can use region_check for checking if the ball is in a specific area. create a region in WED with the one name for each goal (eg. "Goal A", "Goal B") now you can check with
if(region_check("Goal A", ent.x, ent.x) != 0)
{
// Ball is in the region/goal
}
|
|
|
Re: What is the best way
[Re: MasterQ32]
#428693
09/01/13 20:10
09/01/13 20:10
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
or use pXent_settriggerflag This function uses the volume of a static physics entity as a trigger area that generates an ENABLE_TRIGGER event.
|
|
|
|