Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

GM - ADMIN ingame tags - Help

Newbie Spellweaver
Joined
Nov 14, 2013
Messages
33
Reaction score
2
Hey guys, I'm trying to set up a tag for the ingame staff. I have searched the forums found 1 or 2 posts that looked promising but they don't explain in great detail what is required. (there was one which was spoon fed But I did not want to use their code as that's no way to learn).

Any how lets get on with it.

This is my MoverRender.cpp file.

Now let me explain the issue before going into my code.
I know that the Admin - Game Master 3 & 2 colour work. My issue is a bit further down where the tags are added.

When I add the code small code below under the "ViP Developer" tag it compiles fine no issue BUT! when I log into the game there is either no tag or no name.
Code:
else
{
strName += " [ViP Head GM]";
}

Here is me being set as the GameMaster2 (which is my Head GM authroity) in the database:
tenchh - GM - ADMIN ingame tags - Help - RaGEZONE Forums


The funny thing is, when I set myself as the 'ADMIN' (Z Authority in DB) this happens:
tenchh - GM - ADMIN ingame tags - Help - RaGEZONE Forums


So here is the main code, AUTH_GAMEMASTER2 is the Head GM. I have removed it from the code below as it was throwing the above picture error.

Code:
        // 명성에 따른 색표시.#if __VER >= 13 // __HONORABLE_TITLE
        if( IsChaotic() )
            dwColor = prj.m_PKSetting.dwChaoColor;
        else if( IsPKPink() )
            dwColor = prj.m_PKSetting.dwReadyColor;
        else if( m_dwAuthorization >= AUTH_ADMINISTRATOR ) // GM / Admin colors
            dwColor = 0xff99CCFF;
        else if( m_dwAuthorization >= AUTH_GAMEMASTER3 )
            dwColor = 0xffFFFF00;
        else if( m_dwAuthorization >= AUTH_GAMEMASTER2 )
            dwColor = 0xffFFFF00;
        else
            dwColor = prj.m_PKSetting.dwGeneralColor;
        
        CString strFameName = GetTitle();
        if( strFameName.IsEmpty() == FALSE )
        {
            CString strName;
            strName = "]";
            strName += strFameName;
            strName += "[ ";
            strName += m_szName;
            strcpy( szName, (LPCTSTR)strName );
        }        


        // GM / Admin tag
        if(m_dwAuthorization >= AUTH_GAMEMASTER3)
        {
            CString strName;
            strName = szName;
            if(m_dwAuthorization >= AUTH_ADMINISTRATOR)
            {
                strName += " [ViP Owner]";
            }
            else 
            {
                strName += " [ViP Developer]";
            }
            strcpy( szName, (LPCTSTR)strName );
        }
#else

I have not changed the Authorization.h file this has been left as as normal. But here it is just incase:
Code:
#ifndef __AUTHORIZATION_H#define __AUTHORIZATION_H


// AUTHORAZATION 정의들. ADMINISTRATOR에 가까울 수룩 수퍼 계정이다.


#define AUTH_OBSERVER      'D' // 관찰자 계정 ; 방송용, 모니터링, 감시용
#define AUTH_GENERAL       'F' // 일반 사용자 유저
#define AUTH_LOGCHATTING   'G' // 채팅로그를 남길 일반유저 
#define AUTH_JOURNALIST    'H' // Youtubers - Gives ViP YouTube Tag
#define AUTH_HELPER        'J' // MODERATOR/ViP Helper - Gives ViP Helper Tag
#define AUTH_GAMEMASTER    'L' // NORMAL GM - RESTRICTED POWERS - Gives ViP GM Tag
#define AUTH_GAMEMASTER2   'M' // HEAD GM - HAS ADMIN POWERS - Gives ViP Head GM Tag
#define AUTH_GAMEMASTER3   'N' // ADMIN POWERS - USED FOR DEVELOPER - Gives ViP Developer Tag
#define AUTH_OPERATOR      'O' // System Operator - Not used**
#define AUTH_ADMINISTRATOR 'P' // VIP OWNER - FULL COMMANDS - GIVES ViP Owner Tag

Any help would be great, if I have not explained this very well please just reply and I will try and explain a bit clearer.

Many thanks

- Josh
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Here you go

Code:
//GM /ADMIN TAG
		if(m_dwAuthorization >= AUTH_GAMEMASTER)
		{
			CString strName;
			strName = szName;
			if(m_dwAuthorization == AUTH_ADMINISTRATOR)
			{
				strName += " [VIP Owner]";
			}
			else if(m_dwAuthorization >= AUTH_GAMEMASTER2 && m_dwAuthorization < AUTH_GAMEMASTER3)
			{
				strName = " [VIP Developer]"
			}
			else
			{
				//ETCETERA
			}
		}

The problem you had was the first line
if(m_dwAuthorization >= AUTH_GAMEMASTER3)

So that means only players that are auth with gamemaster 3 will only see the tags.
 
Newbie Spellweaver
Joined
Nov 14, 2013
Messages
33
Reaction score
2
Thank you so much Raventh! Top Lad!

*Edit*

Sorry to come back, i've been waiting for my internet to be installed at my new house (currently at work :) ) and wanted to know if you could explain this to me:

Code:
else if(m_dwAuthorization >= AUTH_GAMEMASTER2 && m_dwAuthorization < AUTH_GAMEMASTER3)

What does this actually do? My understanding of it is this:

If your the right authority - then - set as GameMaster2
Else
Set as GameMaster3

I bet I got it wrong thinking like that but if I am would you please explain it in laymen terms as I am trying to learn.

Also if I wanted for example a 'Head of Staff' tag the code would be this:

Code:
else if(m_dwAuthorization >= AUTH_GAMEMASTER3 && m_dwAuthorization < AUTH_GAMEMASTER4)
So I guess that if your a 'Developer' with AUTH_GM3 but you have AUTH_GM4 it will make you the 'Head of Staff'

Let me know if I am wrong as its the best way to learn.

Thanks again!
 
Last edited:
Newbie Spellweaver
Joined
Nov 14, 2013
Messages
33
Reaction score
2
edited my second post, just looking for some knowledge behind Raventh's help.
 
Newbie Spellweaver
Joined
Sep 8, 2011
Messages
67
Reaction score
252
Thank you so much Raventh! Top Lad!
Code:
else if(m_dwAuthorization >= AUTH_GAMEMASTER2 && m_dwAuthorization < AUTH_GAMEMASTER3


Well, looking at the defines, this is not needed. if (auth >= 'M' and auth is less than 'N') meaning it will always be 'M'. So, if (m_dwAuthorization == AUTH_GAMEMASTER2)
Code:
if (m_dwAuthorization > AUTH_GENERAL)
{
	//Admin is defined as P, you're using Z. This will make it show till max Auth
	if (m_dwAuthorization >= AUTH_ADMINISTRATOR)
	{ 
		strName += " [Admin]"; 
	} 
	//This setting GM2, GM3 and Operator to the same title.
	else if (m_dwAuthorization >= AUTH_GAMEMASTER2)
	{
		strName += " [Game Master]"; 
	} 
	//Any Auth above AUTH_GENERAL will be set to this besides the ones above.
	else{ strName += " [Staff]"; } 
}



Also, you could just do both the names and the colors at once.
Code:
	if (m_dwAuthorization >= AUTH_ADMINISTRATOR)
	{ 
		dwColor = 0xFF99CCfF; 
		strName += " [Admin]"; 
	}


You could use a switch statement if you want like this. However, without having a check above AUTH_ADMINISTRATOR (defined as P) and if your character is set to 'Z', you will appear as a normal player.
Code:
		switch (m_dwAuthorization)
		{
		case AUTH_GAMEMASTER:
		case AUTH_GAMEMASTER2:
			dwColor = 0xff99CCFF;
			strName += " [ViP Staff]";
			break;
		}


But, doing the names and the colors at one place (if they are before the honor titles) the name will be over-written.
Code:
	//Initialize cString first and set it to player name
	CString strName;
	strName = szName;

	if (IsChaotic()){ dwColor = prj.m_PKSetting.dwChaoColor; }
	else if (IsPKPink()){ dwColor = prj.m_PKSetting.dwReadyColor; }
	else if (m_dwAuthorization > AUTH_GENERAL)
	{
		switch (m_dwAuthorization)
		{
		case AUTH_GAMEMASTER:
		case AUTH_GAMEMASTER2:
			dwColor = 0xff99CCFF;
			strName += " [ViP Staff]";
			break;
		case AUTH_GAMEMASTER3:
			dwColor = 0xff99CCFF;
			strName += " [ViP GameMaster]";
			break;
		case AUTH_OPERATOR:
			dwColor = 0xff99CCFF;
			strName += " [ViP Head GM]";
			break;
		case AUTH_ADMINISTRATOR:
			dwColor = 0xff99CCFF;
			strName += " [ViP Admin]";
			break;
		}
	}

	CString strFameName = GetTitle();
        if (!strFameName.IsEmpty())
        {
		strName.Insert(0, CString("[" + strFameName + "] "));
	}
	strcpy(szName, (LPCSTR)strName);
 
Newbie Spellweaver
Joined
Nov 14, 2013
Messages
33
Reaction score
2
Well, looking at the defines, this is not needed. if (auth >= 'M' and auth is less than 'N') meaning it will always be 'M'. So, if (m_dwAuthorization == AUTH_GAMEMASTER2)
Code:
if (m_dwAuthorization > AUTH_GENERAL)
{
    //Admin is defined as P, you're using Z. This will make it show till max Auth
    if (m_dwAuthorization >= AUTH_ADMINISTRATOR)
    { 
        strName += " [Admin]"; 
    } 
    //This setting GM2, GM3 and Operator to the same title.
    else if (m_dwAuthorization >= AUTH_GAMEMASTER2)
    {
        strName += " [Game Master]"; 
    } 
    //Any Auth above AUTH_GENERAL will be set to this besides the ones above.
    else{ strName += " [Staff]"; } 
}



Also, you could just do both the names and the colors at once.
Code:
    if (m_dwAuthorization >= AUTH_ADMINISTRATOR)
    { 
        dwColor = 0xFF99CCfF; 
        strName += " [Admin]"; 
    }


You could use a switch statement if you want like this. However, without having a check above AUTH_ADMINISTRATOR (defined as P) and if your character is set to 'Z', you will appear as a normal player.
Code:
        switch (m_dwAuthorization)
        {
        case AUTH_GAMEMASTER:
        case AUTH_GAMEMASTER2:
            dwColor = 0xff99CCFF;
            strName += " [ViP Staff]";
            break;
        }


But, doing the names and the colors at one place (if they are before the honor titles) the name will be over-written.
Code:
    //Initialize cString first and set it to player name
    CString strName;
    strName = szName;

    if (IsChaotic()){ dwColor = prj.m_PKSetting.dwChaoColor; }
    else if (IsPKPink()){ dwColor = prj.m_PKSetting.dwReadyColor; }
    else if (m_dwAuthorization > AUTH_GENERAL)
    {
        switch (m_dwAuthorization)
        {
        case AUTH_GAMEMASTER:
        case AUTH_GAMEMASTER2:
            dwColor = 0xff99CCFF;
            strName += " [ViP Staff]";
            break;
        case AUTH_GAMEMASTER3:
            dwColor = 0xff99CCFF;
            strName += " [ViP GameMaster]";
            break;
        case AUTH_OPERATOR:
            dwColor = 0xff99CCFF;
            strName += " [ViP Head GM]";
            break;
        case AUTH_ADMINISTRATOR:
            dwColor = 0xff99CCFF;
            strName += " [ViP Admin]";
            break;
        }
    }

    CString strFameName = GetTitle();
        if (!strFameName.IsEmpty())
        {
        strName.Insert(0, CString("[" + strFameName + "] "));
    }
    strcpy(szName, (LPCSTR)strName);


Thanks Fenris, I understand it a lot more now. I appreciate the help!
 
Back
Top