Jump to content

masodikbela

Premium
  • Posts

    235
  • Joined

  • Last visited

  • Days Won

    28
  • Feedback

    100%

Everything posted by masodikbela

  1. Hmm if I understand you well, your problem is just you sometimes get negative number, and its can not be converted to time format. So if this is the problem, try to use math.abs(number). This will convert all numbers to its absolute value.
  2. Well I just made this two functions for you, but I didn't test it, so please do it for me (but it should work) Write these into the questlua_pc.cpp: int pc_get_another_pcs_flag(lua_State * L) { if (lua_gettop(L) != 3 && !lua_isstring(L, 1) && !lua_isstring(L, 2) && !lua_isstring(L, 3)) { lua_pushnumber(L, -1); return 1; } const char * sPC = lua_tostring(L, 1); std::string qName = lua_tostring(L, 2); std::string qFlag = lua_tostring(L, 3); LPCHARACTER selPC = CHARACTER_MANAGER::instance().FindPC(sPC); if (!selPC) { lua_pushnumber(L, -1); return 1; } PC * qPC = CQuestManager::instance().GetPCForce(selPC->GetPlayerID()); if (!qPC) { lua_pushnumber(L, -1); return 1; } lua_pushnumber(L, qPC->GetFlag(qName + "." + qFlag)); return 1; } int pc_set_another_pcs_flag(lua_State * L) { if (lua_gettop(L) != 4 && !lua_isstring(L, 1) && !lua_isstring(L, 2) && !lua_isstring(L, 3) && !lua_isnumber(L, 4)) return 0; const char * sPC = lua_tostring(L, 1); std::string qName = lua_tostring(L, 2); std::string qFlag = lua_tostring(L, 3); LPCHARACTER selPC = CHARACTER_MANAGER::instance().FindPC(sPC); if (!selPC) return 0; PC * qPC = CQuestManager::instance().GetPCForce(selPC->GetPlayerID()); if (!qPC) return 0; qPC->SetFlag(qName + "." + qFlag, int(rint(lua_tonumber(L, 4)))); return 0; } Then scroll down to it's end, and write these into the luaL_reg pc_functions[] matrix: { "get_otherpc_quest_flag", pc_get_another_pcs_flag }, { "set_otherpc_quest_flag", pc_set_another_pcs_flag }, The arguments the same that you wrote in the first post of this topic. If an error trigger durning get_otherpc_quest_flag, it will push back -1 as the flag's value. Note that it maybe works only if the other pc is online!
  3. Now, its an another error, you have a missing image: locale/de/ui/mapname/sd01.tga If you don't have this image, place a simple tga to this place.
  4. Open your system.py, then search: def __pack_import(name,globals=None,locals=None,fromlist=None): and write one more argument for this function, for example: def __pack_import(name,globals=None,locals=None,fromlist=None, arg5 = None):
  5. Well, you can use the ServerStateChecker. You can find it in an original intrologin.py, but I will try to show you how it works. Firstly, you need to create a new ServerStateChecker and give the current python module to this, which means it will call its functions from the current python script (eg. yourNewIntrologin.py). ServerStateChecker.Create(self) You must write it before you wants to do anything with the ServerStateChecker. Do it eg in the Open(self) function, or what you call first when you open the login window. After that write this: ServerStateChecker.Initialize(); ServerStateChecker.AddChannel(id, ip, udp_port) ServerStateChecker.Request() Then create a new function in the same class named NotifyChannelState(self, channelID, state) The ServerStateChecker will trigger this function, and you will get the state of the channel. Then you could do what you want with it. And last but not least, add this to the OnUpdate function: ServerStateChecker.Update() I hope it was understandable and helpful.
  6. I think the problem caused by the dead event trigger (or the kill event trigger, but it is unlikely). Did you do anything whit it? (I think yes, because I didn't find any string like Dead: QUEST no such pc id or Dead:) This problem possibly caused by void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) in char_battle.cpp but I'm not sure. Another possibility: (questmanager.cpp) void CQuestManager::Kill(unsigned int pc, unsigned int npc) If you modified any of this, try to replace with the original. I hope this will help a little
  7. Because the new clients use localeInfo instead of locale. If you watch your root, you can't see locale.py, but localeinfo.py. Maybe if you use import locale, you won't get any error, but it will call another module, because probably there is a locale.pyc in the client's lib folder. (anyway, your problem was global name 'locale' is not defined, what means you forgot to write import locale to your source, but if you do it, you will get another error, I explained why)
  8. You should replace locale. to localeInfo. here: self.wndMoney.SetText(locale.NumberToMoneyString(money)) So it should looks like this: self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
×
×
  • 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.