gweilo321 1 Posted November 6, 2018 Share Posted November 6, 2018 Hi guys im looking for a function in c++ source to get players name. I tried " if((chrGetName)== "name") " but its not working, anyone got an idea whats the function? Link to comment Share on other sites More sharing options...
Premium North 1175 Posted November 6, 2018 Premium Share Posted November 6, 2018 49 minutes ago, gweilo321 said: Hi guys im looking for a function in c++ source to get players name. I tried " if((chrGetName)== "name") " but its not working, anyone got an idea whats the function? if (ch->GetName() == "something") This is probably what it should look like Link to comment Share on other sites More sharing options...
gweilo321 1 Posted November 7, 2018 Author Share Posted November 7, 2018 23 hours ago, Fleon said: if (ch->GetName() == "something") This is probably what it should look like Not working :/ anyone got an idea? Link to comment Share on other sites More sharing options...
gweilo321 1 Posted November 8, 2018 Author Share Posted November 8, 2018 I just want to add [GAMEMASTER] [MOD] nexto Name in Game. So i just want to define someones name in game and set it. Anyone got an idea how can i get someones ingame name put it in a if? Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted November 9, 2018 Premium Share Posted November 9, 2018 c++ is not same like LUA... DO YOU KNOW strcmp() ?!?!?!? STRING COMPARE (STRING1,STRING2) 1 Link to comment Share on other sites More sharing options...
ruizuinho-o 12 Posted November 9, 2018 Share Posted November 9, 2018 if u work in char archives: if (GetName() == "") if u work in others archives, first import char.h if (ch->GetName() == "xxx") Link to comment Share on other sites More sharing options...
gweilo321 1 Posted November 9, 2018 Author Share Posted November 9, 2018 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 More sharing options...
gweilo321 1 Posted November 10, 2018 Author Share Posted November 10, 2018 ref Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted November 10, 2018 Premium Share Posted November 10, 2018 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] 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now