Difference between revisions of "Player onthrowgren2"

From Fortress Forever Wiki
Jump to navigationJump to search
(New page: {{Infobox manual/Header}} ==player_throwgren2( player, time )== This function is called whenever a player throws a secondary grenade. Return true or false to allow/disallow the throw. ===I...)
 
Line 1: Line 1:
 
{{Infobox manual/Header}}
 
{{Infobox manual/Header}}
==player_throwgren2( player, time )==
+
==player_onthrowgren2( player, time )==
 
This function is called whenever a player throws a secondary grenade. Return true or false to allow/disallow the throw.
 
This function is called whenever a player throws a secondary grenade. Return true or false to allow/disallow the throw.
 
===Inputs===
 
===Inputs===
Line 7: Line 7:
  
 
===Examples===
 
===Examples===
<pre>function player_throwgren2( player, time )
+
<pre>function player_onthrowgren2( player, time )
 
if time < .5 then
 
if time < .5 then
 
ApplyToPlayer( player, {AT.kStopPrimedGrens} )
 
ApplyToPlayer( player, {AT.kStopPrimedGrens} )

Revision as of 02:38, 4 July 2017


player_onthrowgren2( player, time )

This function is called whenever a player throws a secondary grenade. Return true or false to allow/disallow the throw.

Inputs

player(CFFPlayer) The player trying to throw the grenade time(float) The time, in seconds, since the grenade was primed.

Examples

function player_onthrowgren2( player, time )
	if time < .5 then
		ApplyToPlayer( player, {AT.kStopPrimedGrens} )
		BroadcastMessageToPlayer(player, "Stop spamming!")
		return EVENT_DISALLOWED
	end
end