Raised This Month: $32 Target: $400
 8% 

[CS:GO] Weird TE_SetupBeamFollow problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 03-19-2016 , 14:25   [CS:GO] Weird TE_SetupBeamFollow problem
Reply With Quote #1

Currently trying to get trails working for my replay bots (so players can simply follow the bot's trail), which works for the most part.
Meaning, that if you first spawn, you correctly see the bot's trail. Once you go spec and back into a team, it's gone.
Same also happens if you change spectate targets, the trail just disappears.

I have already tried making the timer repeat, which solves the disappearing issue, but makes the trail "unsmooth". To be more precise, it behaves like a "normal" laser (just straight lines, breaking, or even 4-5 lines at once).

Is there any way to get this working properly? Already tried a env_spritetrail, which spawns a trail, but is just straight all the time and doesn't move (meaning you will have a solid line between your spawn point and where you currently are).

Current code:

PHP Code:
public void OnMapStart()
{
    
g_iTrailIndex PrecacheModel(TRAIL_MODELtrue);
}


public 
Action Event_PlayerSpawn(Handle event, const char[] namebool dontBroadcast)
{
    
int userid GetEventInt(event"userid");
    
int client GetClientOfUserId(userid);

    if(
IsFakeClient(client) && FindTrackForClient(client) > -1)
    {
        
CreateTimer(1.0Timer_Trailuserid);
    }
    
    return 
Plugin_Continue;
}

public 
Action Timer_Trail(Handle timerany serial)
{
    
int client GetClientOfUserId(serial);
    
    if(!
IsClientInGame(client) || !IsFakeClient(client) || FindTrackForClient(client) == -1)
    {
        return 
Plugin_Stop;
    }
    
    
TE_SetupBeamFollow(clientg_iTrailIndex03.05.05.01g_arrTrailColors[FindTrackForClient(client)]);
    
TE_SendToAll();
    
    return 
Plugin_Continue;

Event_PlayerSpawn is hooked in OnPluginStart().
Thanks in advance!
</span>
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 03-24-2016 , 13:22   Re: [CS:GO] Weird TE_SetupBeamFollow problem
Reply With Quote #2

I am wondering, how expensive is it to set up a TE and fire it?
A workaround which might do what I am asking is hooking player_spawn/spec target change and simply setting up the TE's again and sending it to that client only.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-24-2016 , 19:19   Re: [CS:GO] Weird TE_SetupBeamFollow problem
Reply With Quote #3

if i remeber correctly TE_SetupBeamFollow will dissappear after a while / not moving

https://forums.alliedmods.net/showpo...5&postcount=10
__________________

Last edited by 8guawong; 03-24-2016 at 19:23.
8guawong is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 03-25-2016 , 11:26   Re: [CS:GO] Weird TE_SetupBeamFollow problem
Reply With Quote #4

I know about that, but am using it to "highlight" my replay bots, which are always moving.
And If I don't switch spec targets/respawn, the trail works perfectly fine - it only disappears once I switch spec target or change stage/respawn.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode