Jump to content

problema con setPedWeaponSlot


Plate

Recommended Posts

Posted

Hola tengo un problema con este script el problema es que cuando toco el boton "equipar" me pone el arma default ( el puño)

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

EDIT:

Tambien probe asi

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

Posted

Es para equiparse el arma cuando toques el boton ( hay una gridlist de armas que te dice tus armas y vos tocas equipar y se te tiene que poner el arma selecionada)

Posted
function setweapon(weaponName) 
    local row, col = guiGridListGetSelectedItem ( lista ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local team = guiGridListGetItemText ( lista, row, 1 ) 
setPedWeaponSlot(localPlayer, getSlotFromWeapon(weaponName)) 
end 
addEventHandler("onClientGUIClick", equipar, setweapon, false) 

Posted

Por lo menos presta atencion si vas a copiar de otro tema.

"weaponName" no esta definido, ademas de que es un string seguramente.

Te falta un "end".

Posted

weponName es un argument no copie de otro tema sino de otro de mis scripts en los que vos me ayudastes

function setweapon() 
    local row, col = guiGridListGetSelectedItem ( lista ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local weaponName = guiGridListGetItemText ( lista, row, 1 ) 
setPedWeaponSlot(localPlayer, getSlotFromWeapon(weaponName)) 
end 
end 
addEventHandler("onClientGUIClick", equipar, setweapon, false) 

Posted
    function setweapon(weaponName) 
        local row, col = guiGridListGetSelectedItem ( lista ) 
        if ( row and col and row ~= -1 and col ~= -1 ) then 
            local weaponName = guiGridListGetItemText ( lista, row, 1 ) 
        local theWeapon = getWeaponIDFromName(weaponName) 
    setPedWeaponSlot(localPlayer, getSlotFromWeapon(theWeapon)) 
    end 
    end 
    addEventHandler("onClientGUIClick", equipar, setweapon, false) 

  • Recently Browsing   0 members

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