avertuss 48 Posted February 17, 2018 Share Posted February 17, 2018 Hi. How to fix that bug? i already have if (item2->IsEquipped()) return false; but i'm using quest with gui quest nixo_kd begin state start begin when login begin cmdchat("KD_QUEST "..q.getcurrentquestindex()) end when button or info begin if pc.count_item(25100) >= 1 then info = get_input("KD_SEND") splited = string.split(info, '|') if item.select_cell(tonumber(splited[1])) then if item.vnum == tonumber(splited[2]) then if item.get_type() == 1 or item.get_type() == 2 and item.get_sub_type() == 0 then for i = 0, 2 do if item.get_socket(i) == tonumber(splited[3]) then if item.get_socket(i) > 20000 and item.get_socket(i) != 28960 then item.set_socket(i, 1) pc.give_item2(tonumber(splited[3])) pc.remove_item(25100, 1) break end end end end end end end end end end and this bugfix doesn't work. Any ideas? Link to comment Share on other sites More sharing options...
Den 46 Posted February 17, 2018 Share Posted February 17, 2018 You can make a new lua function in source then use it. int item_is_equipped(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPITEM item = q.GetCurrentItem(); if (item) lua_pushboolean(L, item->IsEquipped()); else lua_pushboolean(L, false); return 1; } 1 Link to comment Share on other sites More sharing options...
avertuss 48 Posted February 17, 2018 Author Share Posted February 17, 2018 26 minut temu, Den napisał: You can make a new lua function in source then use it. int item_is_equipped(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPITEM item = q.GetCurrentItem(); if (item) lua_pushboolean(L, item->IsEquipped()); else lua_pushboolean(L, false); return 1; } I added your function, it worked one time but now it doesn't work XD Quest: quest nixo_kd begin state start begin when login begin cmdchat("KD_QUEST "..q.getcurrentquestindex()) end when button or info begin if not pc.can_warp() then chat("You need to wait 10s.") return end if item.is_equipped() then chat("You can't do this! ") return end if pc.count_item(25100) >= 1 then info = get_input("KD_SEND") splited = string.split(info, '|') if item.select_cell(tonumber(splited[1])) then if item.vnum == tonumber(splited[2]) then if item.get_type() == 1 or item.get_type() == 2 and item.get_sub_type() == 0 then for i = 0, 2 do if item.get_socket(i) == tonumber(splited[3]) then if item.get_socket(i) > 20000 and item.get_socket(i) != 28960 then item.set_socket(i, 1) pc.give_item2(tonumber(splited[3])) pc.remove_item(25100, 1) break end end end end end end end end end end Any ideas? Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2423 Posted February 17, 2018 Developer Share Posted February 17, 2018 3 hours ago, avertuss said: if item.is_equipped() then chat("You can't do this! ") return end use this under 3 hours ago, avertuss said: if item.select_cell(tonumber(splited[1])) then and not before.. 1 My youtube channel on which you can see my works here 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