Raised This Month: $ Target: $400
 0% 

engfunc : EngFunc_InfoKeyValue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ish12321
Veteran Member
Join Date: May 2016
Old 05-01-2018 , 05:33   engfunc : EngFunc_InfoKeyValue
Reply With Quote #1

engfunc(EngFunc_InfoKeyValue, buffer, "name", val, 31)

Could someone explain what does this part of code does ?
I searched funcwiki but found nothing about engfunc
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-01-2018 , 07:30   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #2

https://wiki.alliedmods.net/FakeMeta...d_Descriptions

Most probably it is using engfunc to store name :/
( Guess )

Take Reference from this too : https://forums.alliedmods.net/showthread.php?t=204620

Last edited by instinctpt1; 05-01-2018 at 07:35. Reason: .
instinctpt1 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 05-01-2018 , 23:04   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #3

Quote:
Originally Posted by instinctpt1 View Post
https://wiki.alliedmods.net/FakeMeta...d_Descriptions

Most probably it is using engfunc to store name :/
( Guess )

Take Reference from this too : https://forums.alliedmods.net/showthread.php?t=204620
In that case, is it same as get_user_name?
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 05-05-2018 , 14:46   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #4

Code:
public RG_Hook_ClientUserInfoChanged(const id, infobuffer[])
{
	if((g_IsStarted || g_KnifeRound) && get_pcvar_num(g_iPCvars[CVAR_TEAMTAG]))
	{
		if(is_user_connected(id))
		{
			new szName[MAX_NAME_LENGTH], szNewName[MAX_NAME_LENGTH];
			get_user_name(id, szName, charsmax(szName));

			copy(szNewName, charsmax(szNewName), szName);
			if (g_bSecondHalf)
			{
				if (get_member(id, m_iTeam) == TEAM_TERRORIST)
				{
					if(contain(szNewName, "B.") != 0)
					{
						format(szNewName, charsmax(szNewName), "%L %s", LANG_PLAYER, "TEAM_B", szNewName);
					}
				}
				else if(get_member(id, m_iTeam) == TEAM_CT)
				{
					if(contain(szNewName, "A.") != 0)
					{
						format(szNewName, charsmax(szNewName), "%L %s", LANG_PLAYER, "TEAM_A", szNewName)
					}
				}
			}
			else
			{
				if(get_member(id, m_iTeam) == TEAM_TERRORIST)
				{
					if(contain(szNewName, "A.") != 0)
					{
						format(szNewName, charsmax(szNewName), "%L %s", LANG_PLAYER, "TEAM_A", szNewName)
					}
				}
				else if(get_member(id, m_iTeam) == TEAM_CT)
				{
					if(contain(szNewName, "B.") != 0)
					{
						format(szNewName, charsmax(szNewName), "%L %s", LANG_PLAYER, "TEAM_B", szNewName);
					}
				}
			}
			
			if(!equal(szName, szNewName))
			{
				set_user_info(id, "name", szNewName);
			}			
		}
	}
}
Could someone point out error in it ? get_user_name is not getting the name to which the player is just changing name to but his previous name .. !! :-\ Do I need use EngFunc_InfoKeyValue ?
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-05-2018 , 15:52   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #5

Quote:
Originally Posted by ish12321 View Post
engfunc(EngFunc_InfoKeyValue, buffer, "name", val, 31)
In the FM_ClientUserInfoChanged message, the hasn't yet changed. So, get_user_name() will return the actual current name (can be thought of as "old name"). The info in the buffer will contain all the new information that will be used to update your info. That means that this buffer will contain the "new name". The engfunc() retreives that name from the buffer.
__________________

Last edited by fysiks; 05-05-2018 at 15:55.
fysiks is offline
fvRate
Junior Member
Join Date: May 2018
Old 05-05-2018 , 16:47   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #6

Maybe changing names is already block is some other hooked function.
Also don't check the whole name, since you are only concerned about the first two chars, then make it check only the first two chars.
fvRate is offline
Reply


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 04:34.


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