Jump to content

Ayuda createPickup


Plate

Recommended Posts

Posted

Hola alguien me podria decir por que este script no anda tampoco me da error

function dejar() 
            local row, col = guiGridListGetSelectedItem ( itemGrid ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                local item = guiGridListGetItemText ( itemGrid, row, 1 ) 
                local ammo = guiGridListGetItemText ( itemGrid, row, 2 ) 
                local x, y ,z = getElementPosition(localPlayer) 
                local pickup = createPickup(x + 5, y, z, 2, item, 3000, ammo) 
end 
end 
addEventHandler("onClientGUIClick", tirar, dejar, false) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
function dejar() 
            local row, col = guiGridListGetSelectedItem ( itemGrid ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                local item = guiGridListGetItemText ( itemGrid, row, 1 ) 
                local ammo = guiGridListGetItemText ( itemGrid, row, 2 ) 
                local itemName = getWeaponIDFromName(item) 
                local x, y ,z = getElementPosition(localPlayer) 
                local pickup = createPickup(x + 5, y, z, 2, itemName, 3000, tonumber(ammo)) 
                triggerServerEvent("onPlayerPullItem", localPlayer, itemName, ammo) 
end 
end 
addEventHandler("onClientGUIClick", tirar, dejar, false) 

pero tengo que usar onPickupHit no para que le de el arma con la ammo

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Por que cuando paso por el pickup no pasa nada supongo que tengo que usar onPickupHit

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
function dejar() 
if source == tirar then 
            local row, col = guiGridListGetSelectedItem ( itemGrid ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                local item = guiGridListGetItemText ( itemGrid, row, 1 ) 
                local ammo = guiGridListGetItemText ( itemGrid, row, 2 ) 
                local itemName = getWeaponIDFromName(item) 
                local x, y ,z = getElementPosition(localPlayer) 
                local pickup = createPickup(x + 5, y, z, 2, itemName, 3000, tonumber(ammo)) 
                triggerServerEvent("onPlayerPullItem", localPlayer, itemName, ammo) 
end 
end 
end 
addEventHandler("onClientGUIClick", root, dejar) 

State: Inactive

Posted

ya le agregue el tonumber ammo pero igual no lo levanta

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Y si creas el evento en el server y lo triggeas. Porque hay funciones que desde client no funcionan para usarlo. Como el createVehicle que no te puedes subir si lo creas en client.

State: Inactive

Posted

es verdad sasuke ahora pruebo men

function destroyMyPickup() 
if (isElement(pickup)) then 
if (source == pickup) then 
destroyElement(pickup) 
end 
end 
end 
addEventHandler("onPickupHit", pickup, destroyMyPickup) 

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