DEBUG ERROR: bad argument @ 'attachElements' [Expected element at argument 1, got boolean]
I've no idea why.
local helicopter = {
["Police Maverick"] = true,
["Sparrow"] = true,
["Cargobob"] = true,
["Hunter"] = true,
}
function SwatRope()
local myVehicle = getPedOccupiedVehicle(localPlayer)
if myVehicle and helicopter[getVehicleName(myVehicle)] then
local x,y,z = getElementPosition(myVehicle)
local loc = createSWATRope(x, y, z, 10000)
attachElements(loc, localPlayer, 0, 0, 5)
end
end
addCommandHandler("rope", SwatRope)