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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

onClientGUIClick no tiene ningun argumento de armas.

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

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)

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Tenes que obtener el item seleccionado, usa:

guiGridListGetSelectedItem 
guiGridListGetItemText 

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 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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

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

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

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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Usa:

getWeaponIDFromName 

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 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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Ok, de nada entonces.

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.

  • Recently Browsing   0 members

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