Problema Borrar item(Sterge item din inventar)

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
klaudyu14
Nivel 3

Nivel 3
Mesaje: 301
Membru din: 23 Iul 2014, 23:01
Server: www.metin2hyperx.com
Regat: Jinno
Aprecieri: 34  
Mulţumiri: 179  
 Contact:
Medalii

Salut. Am si eu o problema cu functia de borrar items.
Pun itemul pe cos dar nu se intampla nimic.
Functia era pusa dinainte in client. Eu folosesc serverfiles Gaz3rnr1
am facut exact cum era in acest tutorial
http://just4metin.ro/altele/sterge-item ... 33389.html
era la fel totul.
Am verificat si in sursa ce trebuia sa fie in questlua_item.cpp
si era pus deja ce trebuia sa pun eu acolo
cand pun quest-ul imi da core dumped Imagine Aveti idee de ce nu merge? Stiu ca erau niste fix-uri pentru svf gaz3r dar nu mai gasesc
Afișează semnătura
Avatar utilizator
.Duh
Mister Just4Metin

Mister Just4Metin
Mesaje: 435
Membru din: 06 Dec 2015, 22:22
Regat: Shinsoo
Aprecieri: 262  
Mulţumiri: 302  
Discord: Copiază ID
Medalii

le ai in quest_functions ? :S
Avatar utilizator
[Tupeu]
Membru de Elita

Membru de Elita
Mesaje: 4101
Membru din: 28 Oct 2015, 16:16
Aprecieri: 35  
Mulţumiri: 2304  
 Contact:
Medalii

klaudyu14 scrie:Salut. Am si eu o problema cu functia de borrar items.
Pun itemul pe cos dar nu se intampla nimic.
Functia era pusa dinainte in client. Eu folosesc serverfiles Gaz3rnr1
am facut exact cum era in acest tutorial
http://just4metin.ro/altele/sterge-item ... 33389.html
era la fel totul.
Am verificat si in sursa ce trebuia sa fie in questlua_item.cpp
si era pus deja ce trebuia sa pun eu acolo
cand pun quest-ul imi da core dumped Imagine Aveti idee de ce nu merge? Stiu ca erau niste fix-uri pentru svf gaz3r dar nu mai gasesc
Pune ce iti apare sub undeclared function in fisierul quest_functions din folderul quest.
Avatar utilizator
klaudyu14
Nivel 3

Nivel 3
Mesaje: 301
Membru din: 23 Iul 2014, 23:01
Server: www.metin2hyperx.com
Regat: Jinno
Aprecieri: 34  
Mulţumiri: 179  
 Contact:
Medalii

.Duh scrie:le ai in quest_functions ? :S
da duhule :)) le am si acolo
Afișează semnătura
Avatar utilizator
klaudyu14
Nivel 3

Nivel 3
Mesaje: 301
Membru din: 23 Iul 2014, 23:01
Server: www.metin2hyperx.com
Regat: Jinno
Aprecieri: 34  
Mulţumiri: 179  
 Contact:
Medalii

am rezolvat putin :))
dar tot nu se sterge itemul. Probabil e din quest acum Imagine apare chenarul ala dar cand dau pe da nu se sterge itemul.
Afișează semnătura
Avatar utilizator
[Tupeu]
Membru de Elita

Membru de Elita
Mesaje: 4101
Membru din: 28 Oct 2015, 16:16
Aprecieri: 35  
Mulţumiri: 2304  
 Contact:
Medalii

klaudyu14 scrie:am rezolvat putin :))
dar tot nu se sterge itemul. Probabil e din quest acum Imagine apare chenarul ala dar cand dau pe da nu se sterge itemul.
Nu ai functia din quest facuta cel mai probabil.
Avatar utilizator
.Duh
Mister Just4Metin

Mister Just4Metin
Mesaje: 435
Membru din: 06 Dec 2015, 22:22
Regat: Shinsoo
Aprecieri: 262  
Mulţumiri: 302  
Discord: Copiază ID
Medalii

Refa unele parti din game.py :) mic tutorial ce am gasit pe forumuri ..
### ConstInfo.py

BorrarItems = {
	"QID" : 0,
	"BORRAR" : "",
}

### Game.py

En el __ServerCommand_Build, pegar esto:

			"BORRAR"				: self.ManagerBorrar,

def BINARY_ServerCommand_Run(self, line):
Añadir:
	def ItemRemoveGetInputOff(self):
		constInfo.INPUT_IGNORE = 0
Buscar:
"MyShopPriceList"        : self.__PrivateShop_PriceList,
Añadir:
"InputStringEnd" : self.ItemRemoveGetInputOff,

Cambio
    def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)

Open constinfo.py and add this:
INPUT_IGNORE = 0

    def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)

Al final del game.py pegar esto:

	def ManagerBorrar(self, cmd):
		cmd = cmd.split("|")
		if cmd[0] == "QID":
			constInfo.BorrarItems["QID"] = int(cmd[1])
		elif cmd[0] == "SEND":
			net.SendQuestInputStringPacket(str(constInfo.BorrarItems["BORRAR"]))
			constInfo.BorrarItems["BORRAR"] = ""
		elif cmd[0] == "INPUT":
			constInfo.INPUT_IGNORE = int(cmd[1])
			
### uiInventory.py
import event
Debajo de 

			wndEquip = self.GetChild("EquipmentSlot")

Pegar esto:

			wndBorrar = self.GetChild("BorrarSlot")
			
Debajo de:

			self.costumeButton = self.GetChild2("CostumeButton")

Pegar:

			self.borrar_items = self.GetChild2("BorrarItems")
			
Debajo de:

		self.attachMetinDialog.Hide()

Pegar esto:

		self.drag = ui.Bar()
		self.drag.SetPosition(13+50,538)
		self.drag.SetParent(self)
		self.drag.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.0))
		self.drag.SetSize(32,32)
		self.drag.OnMouseLeftButtonUp = lambda: self.Add_Item()
		self.drag.Show()

		wndBorrar.SetOverInItemEvent(ui.__mem_func__(self.OverBorrarIn))
		wndBorrar.SetOverOutItemEvent(ui.__mem_func__(self.OverBorrarOut))
		
		self.RemoveQuestion = uiCommon.QuestionDialog()
		self.RemoveQuestion.SetAcceptEvent(lambda arg = TRUE: self.Borrar_Item(arg))
		self.RemoveQuestion.SetCancelEvent(lambda arg = FALSE: self.Borrar_Item(arg))
		self.RemoveQuestion.Close()
		
Debajo del def Close(self):

Pegar esto:

	def OverBorrarIn(self):
		self.ShowToolTip(0)
		
	def OverBorrarOut(self):
		self.tooltipItem.HideToolTip()
		
	def Add_Item(self):
		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedSlotVnum = mouseModule.mouseController.GetAttachedItemIndex()
				
			# item.SelectItem(attachedSlotVnum)
			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				item.SelectItem(attachedSlotVnum)
				self.RemoveQuestion.SetText("¿Seguro que quieres borrar "+str(item.GetItemName())+"?")
				self.RemoveQuestion.Open()
				constInfo.BorrarItems["BORRAR"] = ""
				constInfo.BorrarItems["BORRAR"] = "BORRAR|"+str(attachedSlotPos)+"|"+str(attachedSlotVnum)
				#chat.AppendChat(1, constInfo.BorrarItems["BORRAR"])
				
			mouseModule.mouseController.DeattachObject()
		
	def Borrar_Item(self, arg):
		if arg:
			event.QuestButtonClick(constInfo.BorrarItems["QID"])
			
		self.RemoveQuestion.Close()

### locale/inventorywindow.py

Debajo de:

				## Item Slot
				{
					"name" : "ItemSlot",
					"type" : "grid_table",

					"x" : 8,
					"y" : 246,

					"start_index" : 0,
					"x_count" : 5,
					"y_count" : 9,
					"x_step" : 32,
					"y_step" : 32,

					"image" : "d:/ymir work/ui/public/Slot_Base.sub"
				},
				
Pegar esto:

				## Borar Items Slot
				{
					"name" : "BorrarItems",
					"type" : "image",

					"x" : 13,
					"y" : 538,

					"image" : "locale/es/ui/inventario/borrar_items.tga",

					"children" :
					(
						{
							"name" : "BorrarSlot",
							"type" : "slot",

							"x" : 0,
							"y" : 0,

							"width" : 32,
							"height" : 32,

							"slot" : (
										{"index":0, "x":0, "y":0, "width":32, "height":32},
									),
						},
					),
				},
quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
			cmdchat("InputStringEnd")
		end
	end
end
Avatar utilizator
klaudyu14
Nivel 3

Nivel 3
Mesaje: 301
Membru din: 23 Iul 2014, 23:01
Server: www.metin2hyperx.com
Regat: Jinno
Aprecieri: 34  
Mulţumiri: 179  
 Contact:
Medalii

.Duh scrie:Refa unele parti din game.py :) mic tutorial ce am gasit pe forumuri ..
### ConstInfo.py

BorrarItems = {
	"QID" : 0,
	"BORRAR" : "",
}

### Game.py

En el __ServerCommand_Build, pegar esto:

			"BORRAR"				: self.ManagerBorrar,

def BINARY_ServerCommand_Run(self, line):
Añadir:
	def ItemRemoveGetInputOff(self):
		constInfo.INPUT_IGNORE = 0
Buscar:
"MyShopPriceList"        : self.__PrivateShop_PriceList,
Añadir:
"InputStringEnd" : self.ItemRemoveGetInputOff,

Cambio
    def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)

Open constinfo.py and add this:
INPUT_IGNORE = 0

    def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)

Al final del game.py pegar esto:

	def ManagerBorrar(self, cmd):
		cmd = cmd.split("|")
		if cmd[0] == "QID":
			constInfo.BorrarItems["QID"] = int(cmd[1])
		elif cmd[0] == "SEND":
			net.SendQuestInputStringPacket(str(constInfo.BorrarItems["BORRAR"]))
			constInfo.BorrarItems["BORRAR"] = ""
		elif cmd[0] == "INPUT":
			constInfo.INPUT_IGNORE = int(cmd[1])
			
### uiInventory.py
import event
Debajo de 

			wndEquip = self.GetChild("EquipmentSlot")

Pegar esto:

			wndBorrar = self.GetChild("BorrarSlot")
			
Debajo de:

			self.costumeButton = self.GetChild2("CostumeButton")

Pegar:

			self.borrar_items = self.GetChild2("BorrarItems")
			
Debajo de:

		self.attachMetinDialog.Hide()

Pegar esto:

		self.drag = ui.Bar()
		self.drag.SetPosition(13+50,538)
		self.drag.SetParent(self)
		self.drag.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.0))
		self.drag.SetSize(32,32)
		self.drag.OnMouseLeftButtonUp = lambda: self.Add_Item()
		self.drag.Show()

		wndBorrar.SetOverInItemEvent(ui.__mem_func__(self.OverBorrarIn))
		wndBorrar.SetOverOutItemEvent(ui.__mem_func__(self.OverBorrarOut))
		
		self.RemoveQuestion = uiCommon.QuestionDialog()
		self.RemoveQuestion.SetAcceptEvent(lambda arg = TRUE: self.Borrar_Item(arg))
		self.RemoveQuestion.SetCancelEvent(lambda arg = FALSE: self.Borrar_Item(arg))
		self.RemoveQuestion.Close()
		
Debajo del def Close(self):

Pegar esto:

	def OverBorrarIn(self):
		self.ShowToolTip(0)
		
	def OverBorrarOut(self):
		self.tooltipItem.HideToolTip()
		
	def Add_Item(self):
		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedSlotVnum = mouseModule.mouseController.GetAttachedItemIndex()
				
			# item.SelectItem(attachedSlotVnum)
			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				item.SelectItem(attachedSlotVnum)
				self.RemoveQuestion.SetText("¿Seguro que quieres borrar "+str(item.GetItemName())+"?")
				self.RemoveQuestion.Open()
				constInfo.BorrarItems["BORRAR"] = ""
				constInfo.BorrarItems["BORRAR"] = "BORRAR|"+str(attachedSlotPos)+"|"+str(attachedSlotVnum)
				#chat.AppendChat(1, constInfo.BorrarItems["BORRAR"])
				
			mouseModule.mouseController.DeattachObject()
		
	def Borrar_Item(self, arg):
		if arg:
			event.QuestButtonClick(constInfo.BorrarItems["QID"])
			
		self.RemoveQuestion.Close()

### locale/inventorywindow.py

Debajo de:

				## Item Slot
				{
					"name" : "ItemSlot",
					"type" : "grid_table",

					"x" : 8,
					"y" : 246,

					"start_index" : 0,
					"x_count" : 5,
					"y_count" : 9,
					"x_step" : 32,
					"y_step" : 32,

					"image" : "d:/ymir work/ui/public/Slot_Base.sub"
				},
				
Pegar esto:

				## Borar Items Slot
				{
					"name" : "BorrarItems",
					"type" : "image",

					"x" : 13,
					"y" : 538,

					"image" : "locale/es/ui/inventario/borrar_items.tga",

					"children" :
					(
						{
							"name" : "BorrarSlot",
							"type" : "slot",

							"x" : 0,
							"y" : 0,

							"width" : 32,
							"height" : 32,

							"slot" : (
										{"index":0, "x":0, "y":0, "width":32, "height":32},
									),
						},
					),
				},
quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
			cmdchat("InputStringEnd")
		end
	end
end
intra pe skype
Afișează semnătura
Avatar utilizator
Pongo A.K.A Titan
Utilizator interzis !

Utilizator interzis !
Mesaje: 2028
Membru din: 01 Sep 2016, 16:08
Regat: Jinno
Aprecieri: 35  
Mulţumiri: 261  
 Contact:
Medalii

Subiect inactiv arhivat !
 ! Mesaj de la: Pongo A.K.A Titan
Cand credeati ca am sa mor
M-am ridicat ca un invingator
Afișează semnătura
Închis
Răspunsuri
3
Vizualizări
1268
Răspunsuri
6
Vizualizări
508
Răspunsuri
1
Vizualizări
256

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie