Raised This Month: $ Target: $400
 0% 

Trying to pull property m_bGlowEnabled from object


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Galdabrast
New Member
Join Date: Apr 2024
Old 04-01-2024 , 11:01   Trying to pull property m_bGlowEnabled from object
Reply With Quote #1

Hi all,

I am new to scripting and have been having fun making some tfbot enablers for new maps.

I am trying to do pd_suijin, where periodically one set of signs glow, signalling the capture point is open.

I want to pull the property m_bGlowEnabled and return the index if it is true, however when I run this code, the script kind of just dies. I assume it is an error from GetEntProp, though it is annoying that there seems to be no way to safeguard it.

This is the code snippet, after many hours spent trying to debug why it dies. signEnt finds the correct value. targetname is "cap_a_sign1":

Code:
stock int FindTheGlow(const char[] targetname)
{
	int index = -1;
	int signEnt = FindEntityByTargetname(targetname, "prop_dynamic");
	int glowEffect = 0;
	ServerCommand("say Gloweffect %d", glowEffect);
	
	if(-1 != signEnt)
	{
		glowEffect = GetEntProp(signEnt, Prop_Data, "m_bGlowEnabled");
		index = signEnt;
	}
	return(index);
}
Any help would be appreciated, as the code dies uncermoniously right after attempting to assign glowEffect.
Galdabrast is offline
 



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 14:44.


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