01-11-2011, 06:48 AM | #1 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Return Gren2 after it expires
I was wondering if anyone knew how to return a player's gren2 after the one he throws or holds on to expires? I know there's _throwgren2, but what if the player doesn't throw? Also, what if the player doesn't throw immediately after priming? You wouldn't be able to time it properly. This is in an effort to combat spam by limiting the player to only one live grenade at a time.
|
|
01-12-2011, 01:38 AM | #2 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Does player_onprimegren2( player_id ) work? I'm not sure if it's available in the current version.
onexplode() might work, too. |
|
01-12-2011, 02:21 AM | #3 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Code:
function player_onprimegren2( player_id ) --ConsoleToAll( "[script] gren2 primed" ) local player = GetPlayer(player_id) end There's also this, but after thinking about it, you'd need a GetOwner() function, which isn't implemented. I'll add that and it'll be in 2.42. Code:
catch_all = trigger_ff_script:new({}) function catch_all:onexplode( explode_entity ) if explode_entity:GetClassName() == "ff_grenade_concussion" then -- need explode_entity:GetOwner() to get the player that threw the gren so we can call AddAmmo() end return EVENT_ALLOWED end
__________________
#FF.Pickup ยค Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|