Jump to content

Ayuda Vida


Plate

Recommended Posts

Posted

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

Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

Posted

Escribiste mal el evento:

addEventHandler("onClientGUIClcik", Usar, useItemHealth, false) 

Debe ser asi

addEventHandler("onClientGUIClick", Usar, useItemHealth, false) 

State: Inactive

Posted

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

Posted

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

Posted

Mira la foto no dropea el item ni lo usa nose por que

Nisiquiera da error

mtascreen20130425233938.png

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...