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

GetEntProp reported: Property "m_humanSpectatorUserID" not found


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-21-2018 , 15:23   GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #1

Quote:
L 03/18/2018 - 187:14: [SM] Native "GetEntProp" reported: Property "m_humanSpectatorUserID" not found (entity 3/player)
L 03/18/2018 - 187:14: [SM] Displaying call stack trace for plugin "MuLS.smx":
L 03/18/2018 - 187:14: [SM] [0] Line 823, plugin.sp::IsClientIdle()
L 03/18/2018 - 187:14: [SM] [1] Line 205, plugin.sp::evtPlayerActivate()
Code:
public bool HasIdlePlayer(int bot)
{
	if(!IsFakeClient(bot))
		return false
	
	if(IsClientConnected(bot) && IsClientInGame(bot))
	{
		if((GetClientTeam(bot) == TEAM_SURVIVORS) && IsAlive(bot))
		{
			if(IsFakeClient(bot))
			{
				int client = GetClientOfUserId(GetEntProp(bot, Prop_Send, "m_humanSpectatorUserID"))			
				if(client)
				{
					if(!IsFakeClient(client) && (GetClientTeam(client) == TEAM_SPECTATORS))
						return true
				}
			}
		}
	}
	return false
}
Why he is thinking client entity has no such property after all validations are passed?

Thanks.
Dragokas is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-21-2018 , 15:33   Re: GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #2

Like music dont have property color
This entity dont have this property

Last edited by Indarello; 03-21-2018 at 16:03.
Indarello is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-21-2018 , 16:12   Re: GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #3

PHP Code:
stock bool:HasSpectator(client)
{
    
decl String:sNetClass[12];
    
GetEntityNetClass(clientsNetClasssizeof(sNetClass));

    if( 
strcmp(sNetClass"SurvivorBot") == )
    {
        if( !
GetEntProp(clientProp_Send"m_humanSpectatorUserID") )
            return 
false;
    }
    return 
true;


SurvivorBot - survivor_bot
The only entity with: m_humanSpectatorUserID

https://wiki.alliedmods.net/Entity_p...ceMod_Commands
"sm_dump_netprops netprops.txt"
"sm_dump_datamaps datamaps.txt"
__________________
Silvers is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-22-2018 , 04:43   Re: GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #4

Indarello, understood.

Silvers, thank you for example of property class determination.
I'll certainly examine the list of properties.
Dragokas is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-26-2018 , 12:10   Re: GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #5

This is what I have, maybe you can find it useful for something:

PHP Code:
bool bHasIdlePlayer(int client)
{
    
int iIdler GetClientOfUserId(GetEntData(clientFindSendPropInfo("SurvivorBot""m_humanSpectatorUserID")));
    if (
iIdler)
    {
        if (
IsClientInGame(iIdler) && !IsFakeClient(iIdler) && (GetClientTeam(iIdler) != 2))
        {
            return 
true;
        }
    }

    return 
false;
}

bool bIsPlayerIdle(int client)
{
    for (
int iPlayer 1iPlayer <= MaxClientsiPlayer++)
    {
        if (!
IsClientConnected(iPlayer) || !IsClientInGame(iPlayer) || GetClientTeam(iPlayer) != || !IsFakeClient(iPlayer) || !bHasIdlePlayer(iPlayer))
        {
            continue;
        }

        
int iIdler GetClientOfUserId(GetEntData(iPlayerFindSendPropInfo("SurvivorBot""m_humanSpectatorUserID")));
        if (
iIdler == client)
        {
            return 
true;
        }
    }

    return 
false;
}

bool bIsHumanSurvivor(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == && IsPlayerAlive(client) && !IsClientInKickQueue(client) && !IsFakeClient(client) && !bHasIdlePlayer(client) && !bIsPlayerIdle(client));

__________________
Psyk0tik is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 03-28-2018 , 17:09   Re: GetEntProp reported: Property "m_humanSpectatorUserID" not found
Reply With Quote #6

Quote:
Originally Posted by Dragokas View Post
Code:
public bool HasIdlePlayer(int bot)
{
	if(!IsFakeClient(bot))
		return false
	
	if(IsClientConnected(bot) && IsClientInGame(bot))
	{
		if((GetClientTeam(bot) == TEAM_SURVIVORS) && IsAlive(bot))
		{
			if(IsFakeClient(bot))
			{
				int client = GetClientOfUserId(GetEntProp(bot, Prop_Send, "m_humanSpectatorUserID"))			
				if(client)
				{
					if(!IsFakeClient(client) && (GetClientTeam(client) == TEAM_SPECTATORS))
						return true
				}
			}
		}
	}
	return false
}
Why he is thinking client entity has no such property after all validations are passed?

Thanks.
This should suffice...however it will only get actual afk players, not spectators...use crashers for idle and spectate.

Code:
public bool HasIdlePlayer(int bot)
{
	if(bot > 0 && bot <= MaxClients && IsClientInGame(bot) && GetClientTeam(bot) == 2)
	{
		if (HasEntProp(bot, Prop_Send, "m_humanSpectatorUserID")) //Seeings how survivor bots are the only ones with this netprop, clients will fail this check
		{
			int client = GetClientOfUserId(GetEntProp(bot, Prop_Send, "m_humanSpectatorUserID"));

			if(client > 0 && client <= MaxClients && IsClientInGame(client) && IsClientObserver(client))
			{
				//PrintToChatAll("%N HasIdlePlayer", bot);
				return true;
			}

			//PrintToChatAll("%N !HasIdlePlayer", bot);
		}
	}

	return false;
}

Last edited by MasterMind420; 03-29-2018 at 07:42.
MasterMind420 is offline
Reply



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 21:57.


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