Jump to content

Shang

Bronze
  • Posts

    276
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Community Answers

  1. Shang's post in Transparent/size 0 board - UI element was marked as the answer   
    Just change the type of the object from board to window.
  2. Shang's post in Problem at creating a simply lua function C++ was marked as the answer   
    int pc_get_rank(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (!ch) { lua_pushnumber(L, 0); return 1; } char szQuery[512]; snprintf(szQuery, sizeof(szQuery), "SELECT rank FROM player.player WHERE name='%s'", ch->GetName()); std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery)); if (pMsg->Get()->uiNumRows > 0) { MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); int iRank = 0; str_to_number(iRank, row[0]); lua_pushnumber(L, iRank); return 1; } lua_pushnumber(L, 0); return 1; } You are not pushing the query return value, you're pushing 0 all the time.
    Not tested. Oh, and it is better to declare first the LPCHARACTER to avoid core crashes if it doesn't exists.
    PS: Where did you get the Dev member? In a bet?
×
×
  • Create New...

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.