Plate Posted May 5, 2013 Share Posted May 5, 2013 Hola tengo una duda es que esto no anda y por que no anda? function pullItem(item, ammo) local x, y ,z = getElementPosition(source) theWeapon = createObject(358, x, y, z- 1, 70, 0, 0) local colshape = createColTube ( x, y, z, 0.5, 0.5 ) setElementData(colshape, "Arma", 34) setElementData(colshape, "Municion", ammo) takeWeapon(source, 34) end addEvent("onPlayerPullSniper", true) addEventHandler("onPlayerPullSniper", getRootElement(), pullItem) function pickupWeapon(player) if isElementWithinColShape(colshape, source) then outputChatBox("/a", source, 0, 255, 255) giveWeapon(source, getElementData(colshape, "Arma"), getElementData(colshape, "Municion")) destroyElement(colshape) destroyElement(theWapon) end end addCommandHandler("a", pickupWeapon) Link to comment
Sasu Posted May 5, 2013 Share Posted May 5, 2013 Intenta asi: function pullItem(item, ammo) local x, y ,z = getElementPosition(source) theWeapon = createObject(358, x, y, z- 1, 70, 0, 0) colshape = createColTube ( x, y, z, 0.5, 0.5 ) setElementData(colshape, "Arma", 34) setElementData(colshape, "Municion", ammo) takeWeapon(source, 34) end addEvent("onPlayerPullSniper", true) addEventHandler("onPlayerPullSniper", getRootElement(), pullItem) function pickupWeapon(source) if isElementWithinColShape(source, colshape) then outputChatBox("/a", source, 0, 255, 255) giveWeapon(source, tonumber(getElementData(colshape, "Arma")), tonumber(getElementData(colshape, "Municion"))) destroyElement(colshape) destroyElement(theWeapon) end end addCommandHandler("a", pickupWeapon) Link to comment
Plate Posted May 5, 2013 Author Share Posted May 5, 2013 Gracias sasuke me funciona de 10 pero como podria hacer que por ejemplo si alguien tira 2 snipers y alguien levanta 1 despues no se puede levantar el otro como lo podria arreglar? Link to comment
Recommended Posts