Raised This Month: $170 Target: $400
 42% 

[ANY] Trails Chroma (Player Trails) [9th July 2018]


Post New Thread Reply   
 
Thread Tools Display Modes
PC Gamer
Senior Member
Join Date: Mar 2014
Old 12-27-2017 , 22:13   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #11

This plugin requires you to manually add the trail every time you spawn. As Nanochip mentioned, cookies would be very helpful for this plugin. Cookie tutorial: https://forums.alliedmods.net/showthread.php?t=228244

I tried to make this open to all players by editing the sourcecode, but it didn't work. Instead, I used Nanochip's advice and used sm_trails_override, which did work.

I was trying to change the source to allow anyone to use it. Out of curiosity, can someone tell me why it doesn't work if I change the original:
gCV_AdminsOnly = CreateConVar("sm_trails_adminsonly", "1", "Enable trails for admins only.", 0, true, 0.0, true, 1.0);

to this:
gCV_AdminsOnly = CreateConVar("sm_trails_adminsonly", "0", "Enable trails for admins only.", 0, true, 0.0, true, 1.0);

I'm just trying to learn...
PC Gamer is offline
____
New Member
Join Date: Dec 2017
Old 12-28-2017 , 06:32   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #12

PHP Code:
////////////////////////////////
// Change this to your needs and recompile.
// Added Cookie v.v

// Chat prefix:
#define CHAT_PREFIX "{bluegrey}[TC]{default}"

// Trail opacity:
#define TRAIL_OPACITY 128

////////////////////////////////

#include <sourcemod>
#include <sdktools>
#include <multicolors>
#include <clientprefs>

#pragma newdecls required
#pragma semicolon 1

/* CVars */

ConVar gCV_PluginEnabled null;
ConVar gCV_AdminsOnly null;
ConVar gCV_BeamLife null;
ConVar gCV_BeamWidth null;

/* Cached CVars */

bool gB_PluginEnabled true;
bool gB_AdminsOnly true;
float gF_BeamLife 1.5;
float gF_BeamWidth 1.5;

/* Global variables */

int gI_BeamSprite;
int gI_SelectedColor[MAXPLAYERS 1];

int gI_CycleColor[MAXPLAYERS 1][4];
bool gB_RedToYellow[MAXPLAYERS 1];
bool gB_YellowToGreen[MAXPLAYERS 1];
bool gB_GreenToCyan[MAXPLAYERS 1];
bool gB_CyanToBlue[MAXPLAYERS 1];
bool gB_BlueToMagenta[MAXPLAYERS 1];
bool gB_MagentaToRed[MAXPLAYERS 1];

bool gB_TouchingTrigger[MAXPLAYERS 1];
float gF_LastPosition[MAXPLAYERS 1][3];


/* Cookie */

Handle selection;

public 
Plugin myinfo 
{
    
name "Trails Chroma",
    
author "Nickelony",
    
description "Adds colorful player trails with special effects.",
    
version "1.1",
    
url "http://steamcommunity.com/id/nickelony/"
}

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"PlayerSpawnEvent);
    
    
HookEntityOutput("trigger_teleport""OnStartTouch"StartTouchTrigger);
    
HookEntityOutput("trigger_teleport""OnEndTouch"EndTouchTrigger);
    
    
RegConsoleCmd("sm_trail"Command_Trail"Opens the 'Trail Color Selection' menu.");
    
RegConsoleCmd("sm_trails"Command_Trail"Opens the 'Trail Color Selection' menu.");
    
    
gCV_PluginEnabled CreateConVar("sm_trails_enable""1""Enable or Disable all features of the plugin."0true0.0true1.0);
    
gCV_AdminsOnly CreateConVar("sm_trails_adminsonly""1""Enable trails for admins only."0true0.0true1.0);
    
gCV_BeamLife CreateConVar("sm_trails_life""1.5""Time duration of the trails."FCVAR_NOTIFYtrue0.0);
    
gCV_BeamWidth CreateConVar("sm_trails_width""1.5""Width of the trail beams."FCVAR_NOTIFYtrue0.0);
    
    
gCV_PluginEnabled.AddChangeHook(OnConVarChanged);
    
gCV_AdminsOnly.AddChangeHook(OnConVarChanged);
    
gCV_BeamLife.AddChangeHook(OnConVarChanged);
    
gCV_BeamWidth.AddChangeHook(OnConVarChanged);

    
selection RegClientCookie("trail_selection""Trail selection"CookieAccess_Protected);

    
AutoExecConfig();
}

public 
void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
gB_PluginEnabled gCV_PluginEnabled.BoolValue;
    
gB_AdminsOnly gCV_AdminsOnly.BoolValue;
    
gF_BeamLife gCV_BeamLife.FloatValue;
    
gF_BeamWidth gCV_BeamWidth.FloatValue;
}

public 
void OnMapStart()
{
    if(!
gB_PluginEnabled)
    {
        return;
    }
    
    
HookEntityOutput("trigger_teleport""OnStartTouch"StartTouchTrigger);
    
HookEntityOutput("trigger_teleport""OnEndTouch"EndTouchTrigger);
    
    
gI_BeamSprite PrecacheModel("materials/trails/beam_01.vmt"true);
    
    
AddFileToDownloadsTable("materials/trails/beam_01.vmt");
    
AddFileToDownloadsTable("materials/trails/beam_01.vtf");
}

public 
void PlayerSpawnEvent(Event event, const char[] namebool dontBroadcast)
{
    if(!
gB_PluginEnabled)
    {
        return;
    }
    
    
int client GetClientOfUserId(event.GetInt("userid"));
    
gB_TouchingTrigger[client] = false;
}

public 
void OnClientCookiesCached(int client)
{
    
char trailCookie[32];

    
GetClientCookie(clientselectiontrailCookiesizeof(trailCookie));
    
gI_SelectedColor[client] = StringToInt(trailCookie);

}


public 
Action Command_Trail(int clientint args)
{
    if(!
gB_PluginEnabled || IsFakeClient(client))
    {
        return 
Plugin_Handled;
    }
    
    if(!
IsPlayerAlive(client))
    {
        
CPrintToChat(client"%s You must be alive to choose a trail!"CHAT_PREFIX);
        return 
Plugin_Handled;
    }
    
    if(
gB_AdminsOnly && !CheckCommandAccess(client"sm_trails_override"ADMFLAG_RESERVATION))
    {
        
CPrintToChat(client"%s Only admins may use this command."CHAT_PREFIX);
        return 
Plugin_Handled;
    }
    
    
Menu menu = new Menu(Menu_Handler);
    
menu.SetTitle("Choose Trail Color:");
    
    
menu.AddItem("0""NONE", (gI_SelectedColor[client] == 0)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("1""Red", (gI_SelectedColor[client] == 1)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("2""Orange", (gI_SelectedColor[client] == 2)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("3""Yellow", (gI_SelectedColor[client] == 3)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("4""Lime", (gI_SelectedColor[client] == 4)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("5""Green", (gI_SelectedColor[client] == 5)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("6""Emerald", (gI_SelectedColor[client] == 6)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("7""Cyan", (gI_SelectedColor[client] == 7)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("8""Light Blue", (gI_SelectedColor[client] == 8)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("9""Blue", (gI_SelectedColor[client] == 9)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("10""Purple", (gI_SelectedColor[client] == 10)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("11""Magenta", (gI_SelectedColor[client] == 11)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("12""Pink", (gI_SelectedColor[client] == 12)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("13""White", (gI_SelectedColor[client] == 13)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
    
menu.AddItem("x"""ITEMDRAW_SPACER);
    
menu.AddItem("14""Velocity", (gI_SelectedColor[client] == 14)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("15""Spectrum", (gI_SelectedColor[client] == 15)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
menu.AddItem("16""Wave", (gI_SelectedColor[client] == 16)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
    
    
menu.ExitButton true;
    
menu.Display(client20);
    
    return 
Plugin_Handled;
}

public 
int Menu_Handler(Menu menuMenuAction actionint param1int param2)
{
    if(
action == MenuAction_Select)
    {
        
char[] info = new char[16];
        
menu.GetItem(param2info16);
        
        
MenuSelection(param1info);
        
SetClientCookie(param1selectioninfo);
    }
    
    else if(
action == MenuAction_End)
    {
        
delete menu;
    }
    
    return 
0;
}

void MenuSelection(int clientchar[] info)
{
    
int choice;
    
char[] color = new char[32];
    
    if(
StrEqual(info"1"))
    {
        
choice 1;
        
FormatEx(color32"{darkred}RED{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"2"))
    {
        
choice 2;
        
FormatEx(color32"{orange}ORANGE{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"3"))
    {
        
choice 3;
        
FormatEx(color32"{yellow}YELLOW{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"4"))
    {
        
choice 4;
        
FormatEx(color32"{lime}LIME{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"5"))
    {
        
choice 5;
        
FormatEx(color32"{green}GREEN{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"6"))
    {
        
choice 6;
        
FormatEx(color32"{olive}EMERALD{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"7"))
    {
        
choice 7;
        
FormatEx(color32"{blue}CYAN{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"8"))
    {
        
choice 8;
        
FormatEx(color32"{lightblue}LIGHT BLUE{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"9"))
    {
        
choice 9;
        
FormatEx(color32"{darkblue}BLUE{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"10"))
    {
        
choice 10;
        
FormatEx(color32"{purple}PURPLE{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"11"))
    {
        
choice 11;
        
FormatEx(color32"{orchid}MAGENTA{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"12"))
    {
        
choice 12;
        
FormatEx(color32"{lightred}PINK{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"13"))
    {
        
choice 13;
        
FormatEx(color32"{grey2}WHITE{default}");
        
PrintTrailMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"14"))
    {
        
choice 14;
        
FormatEx(color32"{darkred}Velocity {green}Trail");
        
PrintSpecialMessage(clientchoicecolor);
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"15"))
    {
        
choice 15;
        
FormatEx(color32"{darkred}Spectrum {green}Cycle");
        
PrintSpecialMessage(clientchoicecolor);
        
        
gB_RedToYellow[client] = true;
        
gI_SelectedColor[client] = choice;
    }
    
    else if(
StrEqual(info"16"))
    {
        
choice 16;
        
FormatEx(color32"{darkred}Wave {green}Trail");
        
PrintSpecialMessage(clientchoicecolor);
        
        
gB_RedToYellow[client] = true;
        
gI_SelectedColor[client] = choice;
    }
    
    else
    {
        if(
gI_SelectedColor[client] != 0)
        {
            
CPrintToChat(client"%s Your trail is now {darkred}DISABLED{default}."CHAT_PREFIX);
        }
        
        
gI_SelectedColor[client] = 0;
    }
}

void PrintTrailMessage(int clientint choicechar[] color)
{
    if(
gI_SelectedColor[client] == 0)
    {
        
CPrintToChat(client"%s Your trail is now {green}ENABLED{default}."CHAT_PREFIX);
        
CPrintToChat(client"{default}Your beam color is %s."color);
    }
    
    if(
gI_SelectedColor[client] != && gI_SelectedColor[client] != choice)
    {
        
CPrintToChat(client"%s Your trail color is now %s."CHAT_PREFIXcolor);
    }
}

void PrintSpecialMessage(int clientint choicechar[] color)
{
    if(
gI_SelectedColor[client] == 0)
    {
        
CPrintToChat(client"%s Your trail is now {green}ENABLED{default}."CHAT_PREFIX);
        
CPrintToChat(client"%s {darkblue}ENABLED{default}."color);
    }
    
    if(
gI_SelectedColor[client] != && gI_SelectedColor[client] != choice)
    {
        
CPrintToChat(client"%s %s {darkblue}ENABLED{default}."CHAT_PREFIXcolor);
    }
}

public 
Action OnPlayerRunCmd(int client)
{
    
float origin[3];
    
GetClientAbsOrigin(clientorigin);
    
    
CreatePlayerTrail(clientorigin);
    
gF_LastPosition[client] = origin;
}

void CreatePlayerTrail(int clientfloat origin[3])
{
    if(!
gB_PluginEnabled || !IsPlayerAlive(client) || gB_TouchingTrigger[client])
    {
        return;
    }
    
    if(
gB_AdminsOnly && !CheckCommandAccess(client"sm_trails_override"ADMFLAG_RESERVATION))
    {
        return;
    }
    
    
float pos1[3];
    
pos1[0] = origin[0];
    
pos1[1] = origin[1];
    
pos1[2] = origin[2] + 5.0;
    
    
float pos2[3];
    
pos2[0] = gF_LastPosition[client][0];
    
pos2[1] = gF_LastPosition[client][1];
    
pos2[2] = gF_LastPosition[client][2] + 5.0;
    
    
int rgba[4];
    
rgba[3] = TRAIL_OPACITY;
    
    
int stepsize;
    
    switch(
gI_SelectedColor[client])
    {
        case 
1// Red trail
        
{
            
rgba[0] = 255rgba[1] = 0rgba[2] = 0;
        }
        
        case 
2// Orange trail
        
{
            
rgba[0] = 255rgba[1] = 128rgba[2] = 0;
        }
        
        case 
3// Yellow trail
        
{
            
rgba[0] = 255rgba[1] = 255rgba[2] = 0;
        }
        
        case 
4// Lime trail
        
{
            
rgba[0] = 128rgba[1] = 255rgba[2] = 0;
        }
        
        case 
5// Green trail
        
{
            
rgba[0] = 0rgba[1] = 255rgba[2] = 0;
        }
        
        case 
6// Emerald trail
        
{
            
rgba[0] = 0rgba[1] = 255rgba[2] = 128;
        }
        
        case 
7// Cyan trail
        
{
            
rgba[0] = 0rgba[1] = 255rgba[2] = 255;
        }
        
        case 
8// Light blue trail
        
{
            
rgba[0] = 0rgba[1] = 128rgba[2] = 255;
        }
        
        case 
9// Blue trail
        
{
            
rgba[0] = 0rgba[1] = 0rgba[2] = 255;
        }
        
        case 
10// Purple trail
        
{
            
rgba[0] = 128rgba[1] = 0rgba[2] = 255;
        }
        
        case 
11// Magenta trail
        
{
            
rgba[0] = 255rgba[1] = 0rgba[2] = 255;
        }
        
        case 
12// Pink trail
        
{
            
rgba[0] = 255rgba[1] = 64rgba[2] = 128;
        }
        
        case 
13// White trail
        
{
            
rgba[0] = 255rgba[1] = 255rgba[2] = 255;
        }
        
        case 
14// Velocity trail
        
{
            
float fAbsVelocity[3];
            
GetEntPropVector(clientProp_Data"m_vecAbsVelocity"fAbsVelocity);
            
float fCurrentSpeed SquareRoot(Pow(fAbsVelocity[0], 2.0) + Pow(fAbsVelocity[1], 2.0));
            
            
DrawVelocityTrail(clientfCurrentSpeed);
            
            
rgba[0] = gI_CycleColor[client][0]; rgba[1] = gI_CycleColor[client][1]; rgba[2] = gI_CycleColor[client][2];
        }
        
        case 
15// Spectrum trail
        
{
            
stepsize 1;
            
DrawSpectrumTrail(clientstepsize);
            
            
rgba[0] = gI_CycleColor[client][0]; rgba[1] = gI_CycleColor[client][1]; rgba[2] = gI_CycleColor[client][2];
        }
        
        case 
16// Wave trail
        
{
            
stepsize 15;
            
DrawSpectrumTrail(clientstepsize);
            
            
rgba[0] = gI_CycleColor[client][0]; rgba[1] = gI_CycleColor[client][1]; rgba[2] = gI_CycleColor[client][2];
        }
        
        default: 
// None
        
{
            return;
        }
    }
    
    
TE_SetupBeamPoints(pos1pos2gI_BeamSprite000gF_BeamLifegF_BeamWidthgF_BeamWidth100.0rgba0);
    
TE_SendToAll(0.0);
}

void DrawSpectrumTrail(int clientint stepsize)
{
    if(
gB_RedToYellow[client])
    {
        
gB_MagentaToRed[client] = false;
        
gI_CycleColor[client][0] = 255gI_CycleColor[client][1] += stepsizegI_CycleColor[client][2] = 0;
        
        if(
gI_CycleColor[client][0] >= 255 && gI_CycleColor[client][1] >= 255 && gI_CycleColor[client][2] <= 0)
            
gB_YellowToGreen[client] = true;
    }
    
    if(
gB_YellowToGreen[client])
    {
        
gB_RedToYellow[client] = false;
        
gI_CycleColor[client][0] -= stepsizegI_CycleColor[client][1] = 255gI_CycleColor[client][2] = 0;
        
        if(
gI_CycleColor[client][0] <= && gI_CycleColor[client][1] >= 255 && gI_CycleColor[client][2] <= 0)
            
gB_GreenToCyan[client] = true;
    }
    
    if(
gB_GreenToCyan[client])
    {
        
gB_YellowToGreen[client] = false;
        
gI_CycleColor[client][0] = 0gI_CycleColor[client][1] = 255gI_CycleColor[client][2] += stepsize;
        
        if(
gI_CycleColor[client][0] <= && gI_CycleColor[client][1] >= 255 && gI_CycleColor[client][2] >= 255)
            
gB_CyanToBlue[client] = true;
    }
    
    if(
gB_CyanToBlue[client])
    {
        
gB_GreenToCyan[client] = false;
        
gI_CycleColor[client][0] = 0gI_CycleColor[client][1] -= stepsizegI_CycleColor[client][2] = 255;
        
        if(
gI_CycleColor[client][0] <= && gI_CycleColor[client][1] <= && gI_CycleColor[client][2] >= 255)
            
gB_BlueToMagenta[client] = true;
    }
    
    if(
gB_BlueToMagenta[client])
    {
        
gB_CyanToBlue[client] = false;
        
gI_CycleColor[client][0] += stepsizegI_CycleColor[client][1] = 0gI_CycleColor[client][2] = 255;
        
        if(
gI_CycleColor[client][0] >= 255 && gI_CycleColor[client][1] <= && gI_CycleColor[client][2] >= 255)
            
gB_MagentaToRed[client] = true;
    }
    
    if(
gB_MagentaToRed[client])
    {
        
gB_BlueToMagenta[client] = false;
        
        
gI_CycleColor[client][0] = 255gI_CycleColor[client][1] = 0gI_CycleColor[client][2] -= stepsize;
        
        if(
gI_CycleColor[client][0] >= 255 && gI_CycleColor[client][1] <= && gI_CycleColor[client][2] <= 0)
            
gB_RedToYellow[client] = true;
    }
}

void DrawVelocityTrail(int clientfloat fCurrentSpeed)
{
    
int stepsize;
    
    if(
fCurrentSpeed <= 255.0)
    {
        
gI_CycleColor[client][0] = 0gI_CycleColor[client][1] = 0gI_CycleColor[client][2] = 255;
    }
    
    else if(
fCurrentSpeed 255.0 && fCurrentSpeed <= 510.0)
    {
        
stepsize RoundToFloor(fCurrentSpeed) - 255;
        
gI_CycleColor[client][0] = 0gI_CycleColor[client][1] = stepsizegI_CycleColor[client][2] = 255;
    }
    
    else if(
fCurrentSpeed 510.0 && fCurrentSpeed <= 765.0)
    {
        
stepsize RoundToFloor(-fCurrentSpeed) + 510;
        
gI_CycleColor[client][0] = 0gI_CycleColor[client][1] = 255gI_CycleColor[client][2] = stepsize;
    }
    
    else if(
fCurrentSpeed 765.0 && fCurrentSpeed <= 1020.0)
    {
        
stepsize RoundToFloor(fCurrentSpeed) - 765;
        
gI_CycleColor[client][0] = stepsizegI_CycleColor[client][1] = 255gI_CycleColor[client][2] = 0;
    }
    
    else if(
fCurrentSpeed 1020.0 && fCurrentSpeed <= 1275.0)
    {
        
stepsize RoundToFloor(-fCurrentSpeed) + 1020;
        
gI_CycleColor[client][0] = 255gI_CycleColor[client][1] = stepsizegI_CycleColor[client][2] = 0;
    }
    
    else if(
fCurrentSpeed 1275.0 && fCurrentSpeed <= 1530.0)
    {
        
stepsize RoundToFloor(fCurrentSpeed) - 1275;
        
gI_CycleColor[client][0] = 255gI_CycleColor[client][1] = 0gI_CycleColor[client][2] = stepsize;
    }
    
    else if(
fCurrentSpeed 1530.0 && fCurrentSpeed <= 1660.0)
    {
        
stepsize RoundToFloor(-fCurrentSpeed) + 1530;
        
gI_CycleColor[client][0] = stepsizegI_CycleColor[client][1] = 0gI_CycleColor[client][2] = 255;
    }
    
    else
    {
        
gI_CycleColor[client][0] = 125gI_CycleColor[client][1] = 0gI_CycleColor[client][2] = 255;
    }
}

/* Don't draw the trail after touching trigger_teleport */

public int StartTouchTrigger(const char[] outputint entityint clientfloat delay)
{
    if(
client || client MaxClients)
    {
        return;
    }
    
    if(!
IsClientInGame(client) || !IsPlayerAlive(client))
    {
        return;
    }
    
    
gB_TouchingTrigger[client] = true;
}

public 
int EndTouchTrigger(const char[] outputint entityint clientfloat delay)
{
    if(
client || client MaxClients)
    {
        return;
    }
    
    if(!
IsClientInGame(client) || !IsPlayerAlive(client))
    {
        return;
    }
    
    
CreateTimer(0.1BlockOffTriggerclientTIMER_FLAG_NO_MAPCHANGE);
}

public 
Action BlockOffTrigger(Handle timerany client)
{
    
gB_TouchingTrigger[client] = false;
    return 
Plugin_Stop;

____ is offline
PC Gamer
Senior Member
Join Date: Mar 2014
Old 12-28-2017 , 14:48   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #13

Thanks for the cookie addition!

Pros: It keeps the trail enabled when you spawn or change class.
Con: It does not enable trail on map change. It does remember your setting, it just doesn't enable the trails. To enable after map change you have to use the command !trail, change your trail from whatever you had last map to a new trail, and then it works.

Overall your cookie change is a huge improvement, because now I only have to change it on new map. That's much better than applying it every time I die/spawn/change class. Thanks!
PC Gamer is offline
cheating_anime
New Member
Join Date: Oct 2017
Old 12-28-2017 , 22:32   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #14

~fixed it, thanks it looks amazing

Last edited by cheating_anime; 12-29-2017 at 08:47.
cheating_anime is offline
Krysol
New Member
Join Date: Dec 2009
Old 01-13-2018 , 07:52   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #15

Can anybody of you guys upload the fixed version with cookies?

I can't compile it due to error "can't load the multicolors"

Krysol is offline
CrazyGhostRider
Member
Join Date: Apr 2014
Old 01-14-2018 , 18:49   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #16

Quote:
Originally Posted by Krysol View Post
Can anybody of you guys upload the fixed version with cookies?

I can't compile it due to error "can't load the multicolors"

Download the archive on the first page. There is include "multicolors".




Did not fix the bugs in the plugin:
At the first spawn of the player, a trail is drawn from the center of the world.
From the place of death of the player to the spawn a trail is drawn.
Between the teleports of the engineer is also drawn a trail.
An invisible spy draws a trail
__________________

Last edited by CrazyGhostRider; 01-14-2018 at 18:54.
CrazyGhostRider is offline
Nickelony
Junior Member
Join Date: Aug 2017
Location: Poland
Old 01-23-2018 , 08:53   Re: [ANY] Trails Chroma (Player Trails)
Reply With Quote #17

UPDATE 2.0 IS OUT NOW!

First, I want to apologise for not updating this plugin for so long. I just couldn't find time for a complete redesing of this plugin, which is what I did with this update.

The changelog is so big, I don't even know where to start x)

Main changes:
* Added new CVars, such as "sm_trails_cheap" and "sm_trails_respawn".
* Added KeyValues which allow to modify the trails using a .cfg file.
* Added cookies. (finally)
* Removed multicolors support (which means no more .inc files).
* Optimised the whole code.

Quote:
Originally Posted by CrazyGhostRider View Post
Did not fix the bugs in the plugin:
At the first spawn of the player, a trail is drawn from the center of the world. Fixed.
From the place of death of the player to the spawn a trail is drawn. Fixed.
Between the teleports of the engineer is also drawn a trail. I have no idea how the teleporter works in TF2. If it's not trigger_teleport, then I have no idea how to fix it.
An invisible spy draws a trail Can't be fixed... I think.
If you have any issues with this plugin, please post it here

Last edited by Nickelony; 01-23-2018 at 09:02.
Nickelony is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 01-23-2018 , 15:12   Re: [ANY] Trails Chroma (Player Trails) [23-01-2018]
Reply With Quote #18

For check if player teleported you do not must hooking teleport ents
my EZ method:

if(GetVectorDistance(origin, g_fLastPosition[client], false) > 50.0) return;

'50.0' is a reserve for high speed players

This method fixing all three bugs
At the first spawn of the player, a trail is drawn from the center of the world. Fixed.
From the place of death of the player to the spawn a trail is drawn. Fixed.
Between the teleports of the engineer is also drawn a trail. I have no idea how the teleporter works in TF2. If it's not trigger_teleport, then I have no idea how to fix it.
__________________

Last edited by _GamerX; 01-23-2018 at 15:13.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
nikita1811
Junior Member
Join Date: Aug 2016
Old 01-24-2018 , 12:44   Re: [ANY] Trails Chroma (Player Trails) [23-01-2018]
Reply With Quote #19

You can add !hide that players could hide display of trails?
nikita1811 is offline
sime0282
Junior Member
Join Date: Dec 2017
Old 01-30-2018 , 16:52   Re: [ANY] Trails Chroma (Player Trails) [23-01-2018]
Reply With Quote #20

How do i do so i give acces to all players or only vip?

Last edited by sime0282; 01-30-2018 at 16:52.
sime0282 is offline
Reply


Thread Tools
Display Modes

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 13:49.


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