View Single Post
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 09-12-2018 , 16:55   [CS:GO] Create glow around player.
Reply With Quote #1

I'm trying a stock to create glow around player, but it creates another player which glows. If it was somehow possible to like make the glow's model invisible but the glow remain, it would probably work.

Code:
CreateGlow(client)
{
	new String:Model[PLATFORM_MAX_PATH];
	new Float:Origin[3], Float:Angles[3];

	// Get the original model path
	GetEntPropString(client, Prop_Data, "m_ModelName", Model, sizeof(Model));
	
	// Find the location of the player
	GetClientEyePosition(client, Origin);
	Origin[2] -= 75.0;
	GetClientEyeAngles(client, Angles);
	new GlowEnt = CreateEntityByName("prop_dynamic_glow");
	
	DispatchKeyValue(GlowEnt, "model", Model);
	DispatchKeyValue(GlowEnt, "disablereceiveshadows", "1");
	DispatchKeyValue(GlowEnt, "disableshadows", "1");
	DispatchKeyValue(GlowEnt, "solid", "0");
	DispatchKeyValue(GlowEnt, "spawnflags", "256");
	DispatchKeyValue(GlowEnt, "renderamt", "0");
	SetEntProp(GlowEnt, Prop_Send, "m_CollisionGroup", 11);
		
	// Spawn and teleport the entity
	DispatchSpawn(GlowEnt);
	TeleportEntity(GlowEnt, Origin, Angles, NULL_VECTOR);

	// Give glowing effect to the entity
	SetEntProp(GlowEnt, Prop_Send, "m_bShouldGlow", true, true);
	SetEntPropFloat(GlowEnt, Prop_Send, "m_flGlowMaxDist", 69420.0);

	// Set glowing color
	SetVariantColor({255, 255, 255, 255});
	AcceptEntityInput(GlowEnt, "SetGlowColor");

	// Set the activator and group the entity
	SetVariantString("!activator");
	AcceptEntityInput(GlowEnt, "SetParent", client);
	
	AcceptEntityInput(GlowEnt, "TurnOn");

}
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline