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!

help how to put avatar by teams

Newbie Spellweaver
Joined
Jan 12, 2022
Messages
25
Reaction score
2
I would like to know how to put an avatar by teams, example: red team: woman with 1 avatar, man with another and the same in the blue team: woman with 1 avatar and a man with a different one in conclusion 4 avatar in a game mode let's say: team deathmatch

can help me please :(:
 
Last edited:
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
I would like to know how to put an avatar by teams, example: red team: woman with 1 avatar, man with another and the same in the blue team: woman with 1 avatar and a man with a different one in conclusion 4 avatar in a game mode let's say: team deathmatch

can help me please :(:

Easy, you can do it this way by going to this line 'void ZCharacter::InitProperties()' in ZCharacter.cpp and below it include this and edit it your way.

Code:
	if (ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DEATHMATCH_SOLO) //Add wherever the avatars included below work or are visible.
	{
		if (GetProperty()->nSex == MMS_FEMALE) 
		{
			m_Items.EquipItem(MMCIP_AVATAR, 530510); //sex female ID
		}
		else
		{
			m_Items.EquipItem(MMCIP_AVATAR, 530010); //sex male ID
		}
	}
 
Upvote 0
Newbie Spellweaver
Joined
Jan 12, 2022
Messages
25
Reaction score
2
Easy, you can do it this way by going to this line 'void ZCharacter::InitProperties()' in ZCharacter.cpp and below it include this and edit it your way.

Code:
    if (ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DEATHMATCH_SOLO) //Add wherever the avatars included below work or are visible.
    {
        if (GetProperty()->nSex == MMS_FEMALE) 
        {
            m_Items.EquipItem(MMCIP_AVATAR, 530510); //sex female ID
        }
        else
        {
            m_Items.EquipItem(MMCIP_AVATAR, 530010); //sex male ID
        }
    }

It works but I want to add team ( red and blue) avatars diferents too, how would I do it?
 
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
293
Reaction score
86
I would like to know how to put an avatar by teams, example: red team: woman with 1 avatar, man with another and the same in the blue team: woman with 1 avatar and a man with a different one in conclusion 4 avatar in a game mode let's say: team deathmatch

can help me please :(:

Here is the most correct way to use it.
Look for ZCharacter.cpp
----------------------------------------
Search by line: bool ZCharacter::Create(MTD_CharInfo* pCharInfo)
Find this: for (int i = 0; i < MMCIP_END; i++)
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
    }

Substitute for that.
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        MMatchStageSetting* StageSetting = ZGetGameClient()->GetMatchStageSetting();
        if (StageSetting->GetGameType() == GAMETYPE_DEATHMATCH_TEAM) // (Game Type: Team DeathMatch)
        {
            if (MMatchCharItemParts(i) == MMCIP_AVATAR)
            {
                ZIDLResource* pResource = ZGetGameInterface()->GetIDLResource();
                MButton* pRedBtn = (MButton*)pResource->FindWidget("StageTeamRed"); // Checkbox (Red Team).
                MButton* pBlueBtn = (MButton*)pResource->FindWidget("StageTeamBlue"); // Checkbox (Blue Team).
                if (ZGetGameInterface()->m_bTeamPlay)
                {
                    // (Red Team Avatar)
                    if (pRedBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }
                    // (Blue Team Avatar)
                    else if (pBlueBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }

                }
            }
        }
        else
        {
            m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
        }
    }
 
Last edited by a moderator:
Upvote 0
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
Here is the most correct way to use it.
Look for ZCharacter.cpp
----------------------------------------
Search by line: bool ZCharacter::Create(MTD_CharInfo* pCharInfo)
Find this: for (int i = 0; i < MMCIP_END; i++)
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
    }

Substitute for that.
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        MMatchStageSetting* StageSetting = ZGetGameClient()->GetMatchStageSetting();
        if (StageSetting->GetGameType() == GAMETYPE_DEATHMATCH_TEAM) // (Game Type: Team DeathMatch)
        {
            if (MMatchCharItemParts(i) == MMCIP_AVATAR)
            {
                ZIDLResource* pResource = ZGetGameInterface()->GetIDLResource();
                MButton* pRedBtn = (MButton*)pResource->FindWidget("StageTeamRed"); // Checkbox (Red Team).
                MButton* pBlueBtn = (MButton*)pResource->FindWidget("StageTeamBlue"); // Checkbox (Blue Team).
                if (ZGetGameInterface()->m_bTeamPlay)
                {
                    // (Red Team Avatar)
                    if (pRedBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }
                    // (Blue Team Avatar)
                    else if (pBlueBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }

                }
            }
        }
        else
        {
            m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
        }
    }

ahh, he was referring to this, I couldn't understand what he was trying to say concretely.
 
Upvote 0
Newbie Spellweaver
Joined
Jan 12, 2022
Messages
25
Reaction score
2
Here is the most correct way to use it.
Look for ZCharacter.cpp
----------------------------------------
Search by line: bool ZCharacter::Create(MTD_CharInfo* pCharInfo)
Find this: for (int i = 0; i < MMCIP_END; i++)
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
    }

Substitute for that.
Code:
    for (int i = 0; i < MMCIP_END; i++)
    {
        MMatchStageSetting* StageSetting = ZGetGameClient()->GetMatchStageSetting();
        if (StageSetting->GetGameType() == GAMETYPE_DEATHMATCH_TEAM) // (Game Type: Team DeathMatch)
        {
            if (MMatchCharItemParts(i) == MMCIP_AVATAR)
            {
                ZIDLResource* pResource = ZGetGameInterface()->GetIDLResource();
                MButton* pRedBtn = (MButton*)pResource->FindWidget("StageTeamRed"); // Checkbox (Red Team).
                MButton* pBlueBtn = (MButton*)pResource->FindWidget("StageTeamBlue"); // Checkbox (Blue Team).
                if (ZGetGameInterface()->m_bTeamPlay)
                {
                    // (Red Team Avatar)
                    if (pRedBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }
                    // (Blue Team Avatar)
                    else if (pBlueBtn->GetCheck()) 
                    {
                        if (ZGetMyInfo()->GetSex() == MMS_FEMALE) 
                        {
                            // FEMALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Female (ID: 00000).
                        }
                        else 
                        {
                            // MALE
                            m_Items.EquipItem(MMatchCharItemParts(i), 00000, 1); // Avatar Male (ID: 00000).
                        }
                    }

                }
            }
        }
        else
        {
            m_Items.EquipItem(MMatchCharItemParts(i), pCharInfo->nEquipedItemDesc[i], pCharInfo->nEquipedItemCount[i]);
        }
    }

source have a bug

when I'm on the blue team I see myself with the corresponding avatar

HuGo579 - help how to put avatar by teams - RaGEZONE Forums


but the one from the red team sees me with another avatar.... which is the men's avatar but from the red team

HuGo579 - help how to put avatar by teams - RaGEZONE Forums



how do I solve it ??? :*:
 
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
293
Reaction score
86
source have a bug

when I'm on the blue team I see myself with the corresponding avatar

HuGo579 - help how to put avatar by teams - RaGEZONE Forums


but the one from the red team sees me with another avatar.... which is the men's avatar but from the red team

HuGo579 - help how to put avatar by teams - RaGEZONE Forums



how do I solve it ??? :*:

This error and when the IDs are different from each other.
You need to use the same ID you used on the red team and put it on the blue team.
 
Upvote 0
Newbie Spellweaver
Joined
Jan 12, 2022
Messages
25
Reaction score
2
This error and when the IDs are different from each other.
You need to use the same ID you used on the red team and put it on the blue team.

but I want the avatars to be different, man and woman from the blue team 2 different avatars and the same in the red team man and woman with 2 other avatars more different from those of the blue team
Can be done ?
 
Upvote 0
Newbie Spellweaver
Joined
Jan 12, 2022
Messages
25
Reaction score
2
but I want the avatars to be different, man and woman from the blue team 2 different avatars and the same in the red team man and woman with 2 other avatars more different from those of the blue team
Can be done ?

bump, I'm still looking for the solution :(:
 
Upvote 0
Back
Top