Why this code didnt work?
tablee = {}
col_table = {}
local function take(thePlayer)
if isElementWithinColShape(thePlayer,col) then
local ammo = getPickupAmmo(pickup)
local bron = getPickupWeapon(pickup)
giveWeapon(thePlayer,bron,ammo)
outputChatBox("test")
table.remove(col_table)
table.remove(tablee)
end
end
local function weapon_drop (thePlayer)
local bron = getPlayerWeapon(thePlayer)
local ammo = getPedTotalAmmo(thePlayer)
local slot = getPedWeaponSlot(thePlayer)
local x,y,z = getElementPosition(thePlayer)
local pickup_bron = getPedWeapon(thePlayer)
local p = getPedWeapon(thePlayer)
if slot >= 0 then
if ammo >= 0 then
pickup = createPickup(x,y,z,2,p,0,ammo)
col = createColSphere(x,y,z,1.0)
table.insert(col_table,col)
takeWeapon(thePlayer,p,ammo)
table.insert(tablee,pickup)
addEventHandler("onPickupHit",pickup,take)
end
end
end
addCommandHandler("bind_q",function(thePlayer)
bindKey(thePlayer,"U","down",weapon_drop,thePlayer)
bindKey(thePlayer,"I","down",take,thePlayer)
end)