Creating "medkit" drops on player death
Posted: Tue Jun 02, 2020 1:43 am
This is a WIP, but I wish to spawn a medkit at a player when they die. For now I have it hooked up to spawn a medkit when a TypedSayCommand is triggered. Snippet below:
I know that the medkit model exists in CS:GO, but for some reason item_healthkit is not a recognized classname for Sourcepython. I tried swapping out Entity for Weapon, but same result, so am a bit lost.
Also might need a primer on how entities and props work together in SP.
Syntax: Select all
from entities.entity import Entity
from engines.precache import Model
from players.entity import Player
my_model = Model('models/weapons/w_eq_medkit.mdl')
....
player = Player.from_userid(index)
entity = Entity.create('item_healthkit')
entity.model = my_model
entity.origin = player.view_coordinates
entity.spawn()
....
I know that the medkit model exists in CS:GO, but for some reason item_healthkit is not a recognized classname for Sourcepython. I tried swapping out Entity for Weapon, but same result, so am a bit lost.
Also might need a primer on how entities and props work together in SP.