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

Tail with a beam


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Master Cake
Junior Member
Join Date: May 2020
Location: Planet Earth
Old 05-27-2020 , 19:09   Tail with a beam
Reply With Quote #1

Hello again! I have a question.

I want to create tail for players with a beam sprite for TF2.

Here is code:
Code:
public OnMapStart()
{
	g_sprite = PrecacheModel("materials/sprites/laser.vmt");
}

public Action:OnPlayerRunCmd(myClient, &myButtons, &myImpulse, Float:fVel[3], Float:fAngles[3], &myWeapon)
{
	if(IsPlayerAlive(myClient) && IsValidClient(myClient) && JB_ENABLED[myClient] && ((myButtons & IN_FORWARD) || (myButtons & IN_BACK) || (myButtons & IN_MOVERIGHT) || (myButtons & IN_MOVELEFT) || (myButtons & IN_DUCK) || (myButtons & IN_JUMP)))
	{
    	color[0] = 255;
    	color[1] = 0;
    	color[2] = 239;
    	color[3] = 255;

    	GetClientEyePosition(myClient, FL_PosEnd[myClient]);
    	CreateTimer(0.1, DrawBeam, myClient);
	}
}

public Action:DrawBeam(Handle timer, int myClient)
{
    GetClientEyePosition(myClient, FL_Pos[myClient]);
    TE_SetupBeamPoints(FL_Pos[myClient], FL_PosEnd[myClient], g_sprite, 0, 0, 0, 5.0, 5.0, 5.0, 10, 0.0, color, 0);
    TE_SendToAll();
    return Plugin_Continue;
}
I use timer for this effect but that doesn't work properly. It has to be solid but it's not. It's just dotted when I move



How can I fix it?

P.s. I know about TE_SetupBeamFollow function but I don't want to use it

Last edited by Master Cake; 05-27-2020 at 19:15.
Master Cake is offline
 


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 02:25.


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