Jump to content

Ayuda colshape


Plate

Recommended Posts

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

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
  • Recently Browsing   0 members

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