Randomize 16 Posted August 31, 2014 Share Posted August 31, 2014 Hello! How can I call a function from char.cpp in other cpp? Regards, Randomize Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 31, 2014 Share Posted August 31, 2014 I didn't test the 1st way,but I think it's gonna work #include "char.h" #include "char_manager.h" #include "questmanager.h" char_event_info* info = dynamic_cast<char_event_info*>( event->info ); LPCHARACTER ch = info->ch; ch->ChatPacket(CHAT_TYPE_INFO,"GetRaceNum(): %d",ch->GetRaceNum()); //For quests LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); ch->ChatPacket(CHAT_TYPE_INFO,"GetRaceNum(): %d",ch->GetRaceNum()); Link to comment Share on other sites More sharing options...
Randomize 16 Posted August 31, 2014 Author Share Posted August 31, 2014 I don't understand. Can you write an example, how can I use the "GetRaceNum()" function? Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 31, 2014 Share Posted August 31, 2014 See my post again Link to comment Share on other sites More sharing options...
Randomize 16 Posted August 31, 2014 Author Share Posted August 31, 2014 Ok. Now I have an other problem, when I try compile the game. I tried set the character's sex with this commnand: ch->m_points.job = MAIN_RACE_SURA_W; And I get something like "CHARACTER_POINT is protected" or what... Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 31, 2014 Share Posted August 31, 2014 ch->SetPolymorph(vnum) Link to comment Share on other sites More sharing options...
Randomize 16 Posted August 31, 2014 Author Share Posted August 31, 2014 (edited) But it does not set the sex to other for permanently, or yes? Now I try other way: put the function I wrote to char.cpp I will share the result after it finished compiling. Edited August 31, 2014 by Randomize Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 31, 2014 Share Posted August 31, 2014 It's like the gm command /poly x Link to comment Share on other sites More sharing options...
Solution Randomize 16 Posted September 1, 2014 Author Solution Share Posted September 1, 2014 Now I try other way: put the function I wrote to char.cpp It works, but thank you the help. 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