Plate Posted April 24, 2013 Posted April 24, 2013 Hola podria esto funcionar? es para agregar el item de Vida a mi inventario function itemHealth() local itemH = getElementData(localPlayer, "Itemh") if itemH > 0 then local row = guiGridListAddRow(itemGrid) guiGridListSetItemText ( itemGrid, row, 1, "Vida + 50", false, false ) guiGridListSetItemText ( itemGrid, row, 2, tonumber(itemH)..", false, false ) end end Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted April 24, 2013 Posted April 24, 2013 guiGridListSetItemText ( itemGrid, row, 2, tonumber(itemH)..", false, false ) Esta mal esa linea, deberia ser: guiGridListSetItemText ( itemGrid, row, 2, tostring(itemH), false, false ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted April 24, 2013 Author Posted April 24, 2013 function useItemHealth() local row, col = guiGridListGetSelectedItem ( itemGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local itemH = guiGridListGetItemText ( itemGrid, row, 1 ) if (itemH == "Vida") then setElementHealth(localPlayer, 100) end end end addEventHandler("onClientGUIClcik", Usar, useItemHealth, false) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Sasu Posted April 24, 2013 Posted April 24, 2013 Escribiste mal el evento: addEventHandler("onClientGUIClcik", Usar, useItemHealth, false) Debe ser asi addEventHandler("onClientGUIClick", Usar, useItemHealth, false) State: Inactive
Plate Posted April 24, 2013 Author Posted April 24, 2013 Toco el boton pero no pasa nada Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Sasu Posted April 24, 2013 Posted April 24, 2013 Estas seguro que en el row dice 'Vida' no? Igual proba asi: function useItemHealth() if source == Usar then local row, col = guiGridListGetSelectedItem ( itemGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local itemH = guiGridListGetItemText ( itemGrid, row, 1 ) if (itemH == "Vida") then setElementHealth(localPlayer, 100) end end end end addEventHandler("onClientGUIClick", root, useItemHealth) State: Inactive
Plate Posted April 25, 2013 Author Posted April 25, 2013 si el row 1 dice "Vida" pero nose por que no anda Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Plate Posted April 26, 2013 Author Posted April 26, 2013 Mira la foto no dropea el item ni lo usa nose por que Nisiquiera da error Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Recommended Posts