alphaprops

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

alphaprops

Postby daren adler » Sun Aug 09, 2020 5:31 pm

Hello SourcePython Team and Community,
Would it be possible to make a SP for me in my hl2dm server for alphaprops ( https://forums.alliedmods.net/showthread.php?p=2362847)(its for the things when you pick them up,like barrels,crate and you can see through them) :smile:
Thank you.
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: alphaprops

Postby VinciT » Sun Aug 09, 2020 6:44 pm

Hi daren, I think this should do the trick:

Syntax: Select all

# ../alpha_props/alpha_props.py

# Source.Python
from entities.constants import RenderMode
from listeners import OnEntityOutput


# Transparency of the picked up object. (0 - 255)
PICKED_UP_ALPHA = 120
# Outputs that are fired when a player picks up and drops an object.
hooked_outputs = ('OnPlayerPickup', 'OnPhysGunDrop')


@OnEntityOutput
def on_entity_output(output, activator, caller, value, delay):
if output not in hooked_outputs:
return

if 'prop_physics' not in caller.classname:
return

caller.render_mode = RenderMode.TRANS_ALPHA
caller.call_input(
'Alpha', PICKED_UP_ALPHA if output == 'OnPlayerPickup' else 255)
ImageImageImageImageImage
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: alphaprops

Postby daren adler » Sun Aug 09, 2020 7:25 pm

VinciT wrote:Hi daren, I think this should do the trick:

Syntax: Select all

# ../alpha_props/alpha_props.py

# Source.Python
from entities.constants import RenderMode
from listeners import OnEntityOutput


# Transparency of the picked up object. (0 - 255)
PICKED_UP_ALPHA = 120
# Outputs that are fired when a player picks up and drops an object.
hooked_outputs = ('OnPlayerPickup', 'OnPhysGunDrop')


@OnEntityOutput
def on_entity_output(output, activator, caller, value, delay):
if output not in hooked_outputs:
return

if 'prop_physics' not in caller.classname:
return

caller.render_mode = RenderMode.TRANS_ALPHA
caller.call_input(
'Alpha', PICKED_UP_ALPHA if output == 'OnPlayerPickup' else 255)


Yes Thank you so much, It works great :smile: :smile:

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 26 guests