Skip to content

Conversation

@CookStar
Copy link
Contributor

@CookStar CookStar commented Nov 8, 2021

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.

#   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")

@jordanbriere jordanbriere merged commit c003fc8 into Source-Python-Dev-Team:master Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants