Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
163 stars 31 forks source link

Updated projectile data for CS:GO. #432

Closed CookStar closed 2 years ago

CookStar commented 2 years ago

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