Jump to content

Looking for a function


Recommended Posts

Theres no char.h as i am doing this in a client source. In

InstanceBaseEffect.cpp

 

and i am changing this code

void CInstanceBase::UpdateTextTailLevel(DWORD level)

to this

void CInstanceBase::UpdateTextTailLevel(DWORD level)
{
	static D3DXCOLOR s_kLevelColor = D3DXCOLOR(152.0f/255.0f, 255.0f/255.0f, 51.0f/255.0f, 1.0f);

	char szText[256];
	sprintf(szText, "Lv %d", level);
	CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kLevelColor);

	if (IsGameMaster()) //GM
	{
		sprintf(szText, "|cff87CEEB[DEV]|r Lv %d ", level);
		CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kLevelColor);
	}
}

 

But instead of isGameMaster i wanna change it to check ingame nickname.

so i basically want something like this

    if (ch->GetName() == "Name")
    {
        sprintf(szText, "|cff87CEEB[DEV]|r Lv %d ", level);
        CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kLevelColor);
    }

but its not working, has anyone got an idea how can i do it?

Link to comment
Share on other sites

  • Premium

I leave you here an example of how i did what you pretend:

 

void CInstanceBase::UpdateTextTailLevel (DWORD level)
{
	static D3DXCOLOR s_kLevelColor = D3DXCOLOR (152.0f / 255.0f, 255.0f / 255.0f, 51.0f / 255.0f, 1.0f);
	static D3DXCOLOR s_Red = D3DXCOLOR (0xFFFF0000);
	char szText[256];
	if (!strcmp (GetNameString(), "[Tierri]")) {
		sprintf (szText, "[Mr.Vector] ");
		CPythonTextTail::Instance().AttachLevel (GetVirtualID(), szText, s_Red);
	}
	else {
		sprintf (szText, " Level %d ", level);
		CPythonTextTail::Instance().AttachLevel (GetVirtualID(), szText, s_kLevelColor);
	}
}

If character name == [Tierri], it shows:

[Mr.Vector] [Tierri]

Instead of

Level 99 [Tierri]

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.