GSC reference › Built-in
CanThrowGrenade()
Built-in (engine)
Server
AI Called on: actor
Checks whether the actor can throw a grenade at a given position. If he can't then result will be undefined, otherwise the result is the resultant velocity vector
Signature
<actor> CanThrowGrenade(<hand offset>, <random range>)
Called on an entity: actor CanThrowGrenade(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| hand offset | Required | (vector) the estimated offset of the hand for the throw |
| random range | Required | (float) random range from target position to throw at |
Example (from Treyarch's docs)
throwvel = self CanThrowGrenade( armOffset, 0 )
Real uses in BO3's scripts
Not called anywhere in BO3's shipped scripts, so check it works in your mode before relying on it.
Related built-ins
- CanThrowGrenadePos()Checks whether the actor can throw a grenade at a given position.
- GrenadeThrow()Throw a grenade.
- aithrowgrenade()Throw a grenade.
- CheckGrenadeThrow()Checks whether the actor can throw a grenade at his target.
- CheckGrenadeThrowPos()Checks whether the actor can throw a grenade at a given position.
- IsThrowingGrenade()Returns true if the player is currently throwing a grenade
- ForceGrenadeThrow()Forces the player to throw a held grenade
- IsSafeFromGrenade()Returns true/false if actor is within a blast radius of a grenade.
- IsGrenadePosSafe()Checks a grenade throw target position is safe.
- PickUpGrenade()Pick up a grenade
- MagicGrenadeType()Fire a 'magic grenade', from the source location towards the destination point.
- isGrenadeDud()Returns if a grenade is a dud
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).