View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 09-13-2018 , 17:10   Re: [CS:GO] Create glow around player.
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
Looks like some of my code from my Admin ESP plugin, however the transmit is terrible for server performance. You can always set the owner of the prop_dynamic_glow and retrieve it within the transmit instead of looping every single player in the game.
Code:
CreateGlow(client)
{
	ClientGlow[client] = 0;
	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 weapon
	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);
	
	new fEffects = GetEntProp(GlowEnt, Prop_Send, "m_fEffects");
	SetEntProp(GlowEnt, Prop_Send, "m_fEffects", fEffects|EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|EF_PARENT_ANIMATES);

	// Give glowing effect to the entity
	SetEntProp(GlowEnt, Prop_Send, "m_bShouldGlow", true, true);
	SetEntProp(GlowEnt, Prop_Send, "m_nGlowStyle", 1);
	SetEntPropFloat(GlowEnt, Prop_Send, "m_flGlowMaxDist", 10000.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);
	
	SetVariantString("primary");
	AcceptEntityInput(GlowEnt, "SetParentAttachment", GlowEnt, GlowEnt, 0);
	
	AcceptEntityInput(GlowEnt, "TurnOn");
	
	SetEntPropEnt(GlowEnt, Prop_Send, "m_hOwnerEntity", client);
	
	SDKHook(GlowEnt, SDKHook_SetTransmit, Hook_ShouldSeeGlow);
	ClientGlow[client] = GlowEnt;

}
Works given HookShouldSeeGlow blocks seeing my own glow.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline