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) 

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

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) 

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.

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) 

  • Recently Browsing   0 members

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