• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How get some players information in characterlist.lua?

Exedion

Active Member
Joined
Jun 11, 2007
Messages
628
Reaction score
30
Hello otland! to many years without post here! Greetings for all

i need some help,i want to make a character list showing info of the character like outfit, health, mana, lvl, etc like some custom clients of others users, i take the code from other otclient and try incorporate to the mine, but never can gen another player information m, ore than "Name", "World" "IP" and some others, can any help me to understend what i can do?

here an example of my adapted code

http://pastebin.com/UNR13xBK

Note: i dont try to steal anything, i only try to understend how make something that i will share for the good of the comunity

i try to add to parse the info in the source but get this error

Code:
Error   1   error C2758: 'Game::m_health' : a member of reference type must be initialized   C:\otclient\src\client\game.cpp   40   1   otclient
Error   2   error C2511: 'void Game::loginWorld(const std::string &,const std::string &,const std::string &,const std::string &,int,const std::string &,const std::string &,double,double,double,double,double,const std::string &,const std::string &)' : overloaded member function not found in 'Game'   C:\otclient\src\client\game.cpp   532   1   otclient
Error   3   error C2352: 'Game::isOnline' : illegal call of non-static member function   C:\otclient\src\client\game.cpp   533   1   otclient
Error   4   error C2597: illegal reference to non-static member 'Game::m_protocolVersion'   C:\otclient\src\client\game.cpp   536   1   otclient
Error   5   error C3867: 'Game::m_protocolVersion': function call missing argument list; use '&Game::m_protocolVersion' to create a pointer to member   C:\otclient\src\client\game.cpp   536   1   otclient
Error   6   error C2352: 'Game::resetGameStates' : illegal call of non-static member function   C:\otclient\src\client\game.cpp   540   1   otclient
Error   7   error C2597: illegal reference to non-static member 'Game::m_localPlayer'   C:\otclient\src\client\game.cpp   542   1   otclient
Error   8   error C2227: left of '->setName' must point to class/struct/union/generic type   C:\otclient\src\client\game.cpp   543   1   otclient
Error   9   error C2227: left of '->setHealth' must point to class/struct/union/generic type   C:\otclient\src\client\game.cpp   544   1   otclient
Error   10   error C2227: left of '->setMana' must point to class/struct/union/generic type   C:\otclient\src\client\game.cpp   545   1   otclient
Error   11   error C2227: left of '->setLevel' must point to class/struct/union/generic type   C:\otclient\src\client\game.cpp   546   1   otclient
Error   12   error C2597: illegal reference to non-static member 'Game::m_protocolGame'   C:\otclient\src\client\game.cpp   548   1   otclient
Error   13   error C2227: left of '->login' must point to class/struct/union/generic type   C:\otclient\src\client\game.cpp   549   1   otclient
Error   14   error C2597: illegal reference to non-static member 'Game::m_characterName'   C:\otclient\src\client\game.cpp   550   1   otclient
Error   15   error C2597: illegal reference to non-static member 'Game::m_worldName'   C:\otclient\src\client\game.cpp   551   1   otclient
Error   16   error C2597: illegal reference to non-static member 'Game::m_health'   C:\otclient\src\client\game.cpp   552   1   otclient
Error   17   error C2597: illegal reference to non-static member 'Game::m_maxHealth'   C:\otclient\src\client\game.cpp   553   1   otclient
Error   18   error C2597: illegal reference to non-static member 'Game::m_level'   C:\otclient\src\client\game.cpp   554   1   otclient
Error   19   error C2597: illegal reference to non-static member 'Game::m_levelPercent'   C:\otclient\src\client\game.cpp   555   1   otclient
Error   20   error C2597: illegal reference to non-static member 'Game::m_mana'   C:\otclient\src\client\game.cpp   556   1   otclient
Error   21   error C2597: illegal reference to non-static member 'Game::m_maxMana'   C:\otclient\src\client\game.cpp   557   1   otclient
   22   IntelliSense: no suitable constructor exists to convert from "uint16" to "std::basic_string<char, std::char_traits<char>, std::allocator<char>>"   c:\otclient\src\client\game.cpp   549   91   otclient
   23   IntelliSense: no suitable constructor exists to convert from "uint16" to "std::basic_string<char, std::char_traits<char>, std::allocator<char>>"   c:\otclient\src\client\game.cpp   549   107   otclient
   24   IntelliSense: too many arguments in function call   c:\otclient\src\client\game.cpp   549   126   otclient
   25   IntelliSense: identifier "m_manaMax" is undefined   c:\otclient\src\client\game.cpp   557   2   otclient

this is my edit
Code:
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldName, const std::string& worldHost, int worldPort, const std::string& characterName, double health, double maxHealth, double level, double levelPercent, double mana, double maxMana, const std::string& authenticatorToken, const std::string& sessionKey)
{
  if(m_protocolGame || isOnline())
  stdext::throw_exception("Unable to login into a world while already online or logging.");

  if(m_protocolVersion == 0)
  stdext::throw_exception("Must set a valid game protocol version before logging.");

  // reset the new game state
  resetGameStates();

  m_localPlayer = LocalPlayerPtr(new LocalPlayer);
  m_localPlayer->setName(characterName);
   m_localPlayer->setHealth(health, maxHealth);
  m_localPlayer->setMana(mana, maxMana);
   m_localPlayer->setLevel(level, levelPercent);

  m_protocolGame = ProtocolGamePtr(new ProtocolGame);
  m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName, (uint16)health, (uint16)maxHealth, (uint16)level, (uint16)levelPercent, (uint16)mana, (uint16)maxMana, authenticatorToken, sessionKey);
  m_characterName = characterName;
  m_worldName = worldName;
   m_health = health;
   m_maxHealth = maxHealth;
   m_level = level;
   m_levelPercent = levelPercent;
   m_mana = mana;
   m_manaMax = maxMana;
}
 
Last edited by a moderator:
Back
Top