Defines the cw_smokegrenade weapon (Smoke), a thrown grenade that explodes into a cw_effect_smoke cloud after four seconds.

It shares its throw logic with cw_flashgrenade: holding primary fire charges the throw, releasing it throws a prop_physics grenade, and each throw uses up one grenade until the weapon is stripped.

Summary

Methods

Throws a smoke grenade that, after four seconds, explodes into a cw_effect_smoke cloud.
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 smoke grenade that, after four seconds, explodes into a cw_effect_smoke cloud.

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