Defines the cw_flashgrenade weapon (Flash), a thrown grenade that blinds every player within 768 units who can see it.

Holding primary fire charges the throw and releasing it throws a prop_physics grenade that explodes after four seconds and sends the Flashed Cable message to the affected players. Each throw uses up one grenade, and the weapon is stripped when none are left.

Summary

Methods

Throws a flash grenade that, after four seconds, explodes and blinds every player within 768 units who can see it.
Deploy()shared
Plays the draw animation and cancels any throw in progress.
Reports the weapon as raised while throwing and for two seconds after.
Plays the holster animation and cancels any throw in progress.
Sets the grenade hold type on the server.
Pulls the grenade back to start a throw, which SWEP:Think releases.
Does nothing.
Think()shared
Throws the grenade once the attack key is released, using up one grenade, and strips the weapon after the throw when none are left.

Methods

Throws a flash grenade that, after four seconds, explodes and blinds every player within 768 units who can see it.

Runs only on the server. The grenade spawns 64 units ahead of the owner, or just short of a surface closer than 80 units, and is thrown with a force of 800 + power.

Parameters

  • power Number Extra throw force, 40 per second the attack key was held, up to 400

Plays the draw animation and cancels any throw in progress.

Returns

  • Boolean Always true to allow the deploy

Reports the weapon as raised while throwing and for two seconds after.

Returns

  • Boolean true while raised, otherwise nil

Plays the holster animation and cancels any throw in progress.

Refused right after a throw, until SWEP:Think has stripped the weapon if it was the last grenade; an empty weapon that was put away could otherwise be drawn and thrown again.

Parameters

  • switchingTo

Returns

  • Boolean Whether the weapon may be holstered

Sets the grenade hold type on the server.

Pulls the grenade back to start a throw, which SWEP:Think releases.

Returns

  • Boolean Always false

Does nothing.

Throws the grenade once the attack key is released, using up one grenade, and strips the weapon after the throw when none are left.

Defined in