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 , 23:04   Re: engfunc : EngFunc_InfoKeyValue
Reply With Quote #1

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 #2

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


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