Jump to content

problema con setPedWeaponSlot


Plate

Recommended Posts

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) 

Link to comment
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) 

Link to comment

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) 

Link to comment
    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) 

Link to comment
  • Recently Browsing   0 members

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