Jump to content

Como se puede?


Plate

Recommended Posts

Me parece que hize cualquier cosa

function armas() 
local weapons = getPedWeapon(source) 
for _,weapons in ipairs(weapons) 
local row = guiGridListAddRow ( lista ) 
 guiGridListSetItemText ( lista, row, armas, weapons, false, false ) 
end 
end 

o capas que

function armas() 
for _,weapons in ipairs(getPedWeapon(source)) 
local row = guiGridListAddRow ( lista ) 
 guiGridListSetItemText ( lista, row, armas, weapons, false, false ) 
end 
end 

Link to comment

Si, me temo que hiciste cualquier cosa.

function armas ( ) 
    for slot = 0, 12 do 
        local weapon = getPedWeapon ( localPlayer, slot ) 
        if ( weapon > 0 ) then 
            local row = guiGridListAddRow ( lista ) 
            guiGridListSetItemText ( lista, row, armas, getWeaponNameFromID ( weapon ), false, false ) 
        end 
    end 
end 

getPedWeapon no es una tabla, devuelve un arma, el for-loop era de 0 a 12 ( el slot ).

Link to comment
GUIEditor_TabPanel = {} 
  
GUIEditor_TabPanel[1] = guiCreateTabPanel(315,183,290,299,false) 
Tab_Armas = guiCreateTab("Armas",GUIEditor_TabPanel[1]) 
lista = guiCreateGridList(38,36,208,187,false,Tab_Armas) 
guiGridListSetSelectionMode(lista,2) 
  
armas = guiGridListAddColumn(lista,"Armas",0.6) 
  
guiGridListAddColumn(lista,"Municion",0.5) 
equipar = guiCreateButton(36,229,65,25,"Equipar",false,Tab_Armas) 
Tirar = guiCreateButton(149,230,65,25,"Tirar",false,Tab_Armas) 
Tab_Medicinas = guiCreateTab("Medicinas",GUIEditor_TabPanel[1]) 
Grid_Medicina = guiCreateGridList(34,21,218,185,false,Tab_Medicinas) 
guiGridListSetSelectionMode(Grid_Medicina,2) 
  
guiGridListAddColumn(Grid_Medicina,"Medicinas",0.2) 
Usar = guiCreateButton(33,222,74,26,"Usar",false,Tab_Medicinas) 
tirar_medicina = guiCreateButton(139,222,74,26,"Tirar",false,Tab_Medicinas) 
  
  
  
guiSetVisible(GUIEditor_TabPanel[1], false) 
function ver() 
guiSetVisible(GUIEditor_TabPanel[1], true) 
showCursor(true) 
end 
addCommandHandler("prueva",ver) 
function lol() 
guiSetVisible(GUIEditor_TabPanel[1], false) 
showcursor(false) 
end 
addCommandHandler("prueva2",lol) 
function armas ( ) 
    for slot = 0, 12 do 
        local weapon = getPedWeapon ( localPlayer, slot ) 
        if ( weapon > 0 ) then 
            local row = guiGridListAddRow ( lista ) 
            guiGridListSetItemText ( lista, row, armas, getWeaponNameFromID ( weapon ), false, false ) 
        end 
    end 
end 
  

Link to comment
GUIEditor_TabPanel = {} 
  
GUIEditor_TabPanel[1] = guiCreateTabPanel(315,183,290,299,false) 
Tab_Armas = guiCreateTab("Armas",GUIEditor_TabPanel[1]) 
lista = guiCreateGridList(38,36,208,187,false,Tab_Armas) 
guiGridListSetSelectionMode(lista,2)  
guiGridListAddColumn(lista,"Armas",0.6) 
  
guiGridListAddColumn(lista,"Municion",0.5) 
equipar = guiCreateButton(36,229,65,25,"Equipar",false,Tab_Armas) 
Tirar = guiCreateButton(149,230,65,25,"Tirar",false,Tab_Armas) 
Tab_Medicinas = guiCreateTab("Medicinas",GUIEditor_TabPanel[1]) 
Grid_Medicina = guiCreateGridList(34,21,218,185,false,Tab_Medicinas) 
guiGridListSetSelectionMode(Grid_Medicina,2) 
  
guiGridListAddColumn(Grid_Medicina,"Medicinas",0.2) 
Usar = guiCreateButton(33,222,74,26,"Usar",false,Tab_Medicinas) 
tirar_medicina = guiCreateButton(139,222,74,26,"Tirar",false,Tab_Medicinas) 
  
guiSetVisible(GUIEditor_TabPanel[1], false) 
  
function ver() 
    guiSetVisible(GUIEditor_TabPanel[1], true) 
    showCursor(true) 
    armas ( ) 
end 
addCommandHandler("prueba",ver) 
  
function lol() 
    guiSetVisible(GUIEditor_TabPanel[1], false) 
    showCursor(false) 
end 
addCommandHandler("prueba2",lol) 
  
function armas ( ) 
    for slot = 0, 12 do 
        local weapon = getPedWeapon ( localPlayer, slot ) 
        if ( weapon > 0 ) then 
            local row = guiGridListAddRow ( lista ) 
            guiGridListSetItemText ( lista, row, 1, getWeaponNameFromID ( weapon ), false, false ) 
        end 
    end 
end 

No estabas ejecutando "armas" en ninguna parte, ademas de haber llamado a una variable "armas" igual que la funcion.

P.D: Es "prueba" no "prueva".

Link to comment

Hace como 2 horas que estoy probando y me sale siempre lo mismo

Bad Argument setPedWeaponSlot y getSlotFromWeapon

function setweapon() 
local ID = getSlotFromWeapon(name) 
setPedWeaponSlot(source, ID) 
end 
addEventHandler("onClientGUIClick", equipar, setweapon, false) 
  

Link to comment
function setweapon() 
local ID = getSlotFromWeapon() 
setPedWeaponSlot(localPlayer, ID) 
end 
addEventHandler("onClientGUIClick", equipar, setweapon, false) 

y tambien probe con

function setweapon() 
local name = getWeaponNameFromID() 
local ID = getSlotFromWeapon(name) 
setPedWeaponSlot(localPlayer, ID) 
end 
addEventHandler("onClientGUIClick", equipar, setweapon, false) 

Link to comment
  • Recently Browsing   0 members

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