how to do this in csgo??
kinda like these
http://addons.eventscripts.com/addons/view/cheapemote
http://addons.eventscripts.com/addons/view/SourceTrails
scripts to produce player trails and icon above player's head
Once the entities_changes branch is finished, the following should work for trails (actually tested with my local version and it does work):
I haven't tested the emote, as of yet.
Syntax: Select all
from colors import BLUE
from colors import RED
from engines.precache import Model
from entities.entity import BaseEntity
from entities.helpers import create_entity
from events import Event
from filters.players import PlayerIter
model = Model('materials/sprites/laser.vmt')
teams = {
2: RED,
3: BLUE,
}
@Event
def player_say(game_event):
for index, team in PlayerIter('alive', return_types=['index', 'team']):
create_trail(index, teams[team])
def create_trail(index, color):
entity = BaseEntity(index)
trail = BaseEntity(create_entity('env_spritetrail'))
trail.lifetime = 10
trail.startwidth = 1
trail.endwidth = 1
trail.spritename = model
trail.color = color
origin = entity.origin
origin.z += 10
trail.origin = origin
trail.spawn()
trail.set_parent(entity.pointer, -1)
trail.set_prop_float('m_flTextureRes', 0.05)
trail.show_sprite()
I haven't tested the emote, as of yet.
satoon101 wrote:Once the entities_changes branch is finished, the following should work for trails (actually tested with my local version and it does work):Syntax: Select all
from colors import BLUE
from colors import RED
from engines.precache import Model
from entities.entity import BaseEntity
from entities.helpers import create_entity
from events import Event
from filters.players import PlayerIter
model = Model('materials/sprites/laser.vmt')
teams = {
2: RED,
3: BLUE,
}
@Event
def player_say(game_event):
for index, team in PlayerIter('alive', return_types=['index', 'team']):
create_trail(index, teams[team])
def create_trail(index, color):
entity = BaseEntity(index)
trail = BaseEntity(create_entity('env_spritetrail'))
trail.lifetime = 10
trail.startwidth = 1
trail.endwidth = 1
trail.spritename = model
trail.color = color
origin = entity.origin
origin.z += 10
trail.origin = origin
trail.spawn()
trail.set_parent(entity.pointer, -1)
trail.set_prop_float('m_flTextureRes', 0.05)
trail.show_sprite()
I haven't tested the emote, as of yet.
very cool but if i want to use custom trails do i just replace the
Syntax: Select all
model = Model('materials/sprites/laser.vmt')
for the emote i was thinking it would cool to attach floating admin/vip text over players head ;-)
Yes, you would replace the model to change the trail. Also, since you are just passing the string when setting the spritename, you will need to precache when using a custom material:
We will work on a fix for this, possibly something like:
Also, I should have mentioned this yesterday, but I only tested this on CS:S. I will test on CS:GO, when I get the chance, to verify it works.
*Edit: had to change the model to laserbeam instead of laser on CS:GO, but it works :)
http://cloud-4.steampowered.com/ugc/541884075847249020/C35B4AE88412ACBDF6DE25341473C127A431B480/
Syntax: Select all
model.index
trail.spritename = model
We will work on a fix for this, possibly something like:
Syntax: Select all
trail.spritename = model.path
Also, I should have mentioned this yesterday, but I only tested this on CS:S. I will test on CS:GO, when I get the chance, to verify it works.
*Edit: had to change the model to laserbeam instead of laser on CS:GO, but it works :)
http://cloud-4.steampowered.com/ugc/541884075847249020/C35B4AE88412ACBDF6DE25341473C127A431B480/
satoon101 wrote:Yes, you would replace the model to change the trail. Also, since you are just passing the string when setting the spritename, you will need to precache when using a custom material:Syntax: Select all
model.index
trail.spritename = model
We will work on a fix for this, possibly something like:Syntax: Select all
trail.spritename = model.path
Also, I should have mentioned this yesterday, but I only tested this on CS:S. I will test on CS:GO, when I get the chance, to verify it works.
*Edit: had to change the model to laserbeam instead of laser on CS:GO, but it works :)
http://cloud-4.steampowered.com/ugc/541884075847249020/C35B4AE88412ACBDF6DE25341473C127A431B480/
coolio
looking foward to the the next SP release
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 76 guests