Greetings,can someone explain me some trick for a custom command “status” that must show character’s data
Example:
I have added some additional fields in account
to integrate a CMS with TC database.(age, gender, location, skype)
As long as i know “%s” allows you to echo characters and “%u” allows you to echo numbers,is there a universal way to echo both since when there is word in “%u” worldserver simply crash /emoticons/default_sad.png
When i try the command and all fields are set to “Wont Share” this is the result and if its changed to any diff value that might be for %s or for %u that will probably cause crash
Also how can i make it show the “lastIP” in a proper way?
http://s27.postimg.org/7fv8wg0gz/New_Bitmap_Image.jpg
WorldSession * m_session = player->GetSession();
QueryResult select = LoginDatabase.PQuery("SELECT username, last_ip, age, gender, location, skype FROM account WHERE id = '%u'", player->GetSession()->GetAccountId());
Field* fields = select->Fetch();
std::string username = fields[0].GetString();
std::string lastIp = fields[1].GetString();
std::string age = fields[2].GetString();
std::string gender = fields[3].GetString();
std::string location = fields[4].GetString();
std::string skype = fields[5].GetString();
handler->PSendSysMessage("Username: %s", username.c_str());
handler->PSendSysMessage("Last IP: %u", lastIp.c_str());
handler->PSendSysMessage("Age: %u", age.c_str());
handler->PSendSysMessage("Gender: %s", gender.c_str());
handler->PSendSysMessage("Location: %s", location.c_str());
handler->PSendSysMessage("Skype: %s", skype.c_str());
return true;