Jump to content
Forgot your email address? ×
×
×
  • Create New...
  • 0

Python client -> pc.get_sex?


Necro

Question

11 answers to this question

Recommended Posts

  • 0
  • Premium

Try:

PythonPlayer.h

search:

DWORD	GetRace();

under add this:

const char * GetSex();

PythonPlayer.cpp

 

search:

DWORD CPythonPlayer::GetRace()

under add this:

const char * CPythonPlayer::GeSex()
{
	switch(GetRace())
	{
		case MAIN_RACE_WARRIOR_W:
		case MAIN_RACE_ASSASSIN_W:
		case MAIN_RACE_SURA_W:
		case MAIN_RACE_SHAMAN_W:
			return "w";
			break;
		case MAIN_RACE_WARRIOR_M:
		case MAIN_RACE_ASSASSIN_M:
		case MAIN_RACE_SURA_M:
		case MAIN_RACE_SHAMAN_M:
			return "m";
			break;

	}
		return "m"; //this is the default value
}

PythonPlayerModule.cpp

search:

PyObject * playerGetRace(PyObject* poSelf, PyObject* poArgs)

under add this:

PyObject * PlayerGetSex(PyObject* poSelf, PyObject* poArgs)
{
	return PyBuildValue("s", CPythonPlayer::Instance().GetSex());
}

now search:

{ "GetRace",					playerGetRace,						METH_VARARGS },

under add this:

{ "GetSex",						PlayerGetSex,						METH_VARARGS },
  • Love 2
Link to comment
  • 0
  • Moon

Python form ;

import playerSettingModule
import net

def IsFemale(raceIndex):
	if (playerSettingModule.RACE_WARRIOR_W == raceIndex or playerSettingModule.RACE_ASSASSIN_W == raceIndex or playerSettingModule.RACE_SURA_W == raceIndex or player.SettingModule.RACE_SHAMAN_W == raceIndex):
		return True
	else:
		return False
		

def IsMale(raceIndex):
	if (playerSettingModule.RACE_WARRIOR_M == raceIndex or playerSettingModule.RACE_ASSASSIN_M == raceIndex or playerSettingModule.RACE_SURA_M == raceIndex or player.SettingModule.RACE_SHAMAN_M == raceIndex or playerSettingModule.RACE_WOLFMAN_M == raceIndex):
		return True
	else:
		return False
		


## Use
race = net.GetMainActorRace()
print(IsMale(race))

Kind Regards

Ken

Edited by Ken
  • Love 1

Do not be sorry, be better.

Link to comment
  • 0
  • Moon

chr.RacetoSex(net.GetMainActorRace())

chr.RaceToSex(net.GetMainActorRace())

Python is always care something all time.

Thanks for information.

 

Kind Regards

Ken

Do not be sorry, be better.

Link to comment
  • 0

Also if you want to get the gender during select screen like I wanted to you will have to use the following syntax:
 

import chr
import net

chr.RaceToSex(chr.GetRace(net.ACCOUNT_CHARACTER_SLOT_ID))

And as @RatCatcher said, it will return an integer value: 1 for males and 0 for females

Cheers!

  • Love 1
for brain_cells in xrange(brain):
  if brain_cells == 0:
    print("0x3703c7 Fatal error occurred. Please replace the brain.")
    break
  if brain_cells == "damaged":
    print("0x3703c7 Error occurred. Please repair damaged brain_cells")
    break
  
  print("brain_cells are at 100% capacity.")

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


  • Read our Rules
  • Activity

    1. 0

      Visual Studio 2010 Ultimate

    2. 1

      Reduce server memory usage

    3. 31

      Metin2 Project - How to create à Metin2 private server on virtual machine

    4. 1

      Use BeltInventory slots without Belt

    5. 47

      Paid service - Vegas Projects

    6. 44

      Changelogs

    7. 79

      3D Shop - Mark Service

  • Recently Browsing

    • No registered users viewing this page.

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.