Added functions and timer attribute to the weird CSensorGrenadeProjectile (tagrenade_projectile/weapon_tagrenade).
I added all the functions related to detonate. Which function to use depends on what you want the plugin to do. Normally, with Think_Arm, SensorThink is used for the next Think, and current_time+2.0 is put in the timer, but if you want to make it blow up immediately, you can choose either SensorThink or just DoDetectWave.
Also, you can detect the DetectWave by hooking Player.blind.
# Entities
from entities.hooks import EntityCondition
from entities.hooks import EntityPreHook
# Memory
from memory import make_object
# Player
from players.entity import Player
@EntityPreHook(EntityCondition.is_player, "blind")
def on_blind(args):
if (args[1] == 0.019999999552965164 and
args[2] == 1.0 and
args[3] == 128.0):
print(make_object(Player, args[0]).name, "DetectWave")
Tested on Linux and Windows.
Added functions and timer attribute to the weird CSensorGrenadeProjectile (tagrenade_projectile/weapon_tagrenade).
I added all the functions related to detonate. Which function to use depends on what you want the plugin to do. Normally, with Think_Arm, SensorThink is used for the next Think, and current_time+2.0 is put in the timer, but if you want to make it blow up immediately, you can choose either SensorThink or just DoDetectWave.
Also, you can detect the DetectWave by hooking Player.blind.