You want to replace the bind with a command? if so:
throwWeaponPickup = {}
function throwWeapon(thePlayer)
if (not isPedInVehicle(thePlayer)) then
local theIDweapon = getPedWeapon(thePlayer)
local theTotalAmmo = getPedTotalAmmo(thePlayer)
if theIDweapon then
local x,y,z = getElementPosition(thePlayer)
local rot = getPedRotation(thePlayer)
x = x + ((math.cos(math.rad(rot + 90))) * 2.5)
y = y + ((math.sin(math.rad(rot + 90))) * 2.5)
for i,players in ipairs(getElementsByType("player")) do
local px,py,pz = getElementPosition(players)
if getDistanceBetweenPoints2D(x, y, px,py) < 2 then --//If the distance from the player's point of pickup truck dumping jetty is given weapons to this player.
if (getPedWeapon(players, getSlotFromWeapon(theIDweapon)) == 0) then --//Check whether the player has a slot for this weapon, it is not blocked.
takeWeapon(thePlayer, theIDweapon)
giveWeapon(players, theIDweapon, theTotalAmmo)
outputChatBox(getPlayerName(thePlayer).." gave you [Weapons]: "..getWeaponNameFromID(theIDweapon)..", [Patrons]: "..tostring(theTotalAmmo), players, 184, 138, 0)
outputChatBox("you have transferred [Weapons]: "..getWeaponNameFromID(theIDweapon)..", [Patrons]: "..tostring(theTotalAmmo)..", "..getPlayerName(players), thePlayer, 184, 138, 0)
return 0
else
outputChatBox(getPlayerName(players).." already has weapons of this type! ", thePlayer, 184, 138, 0)
return 0
end
end
end
takeWeapon(thePlayer, theIDweapon)
throwWeaponPickup[#throwWeaponPickup+1] = createPickup(x, y, z, 2, theIDweapon, 10000, theTotalAmmo)
end
end
end
addCommandHandler ( "dropwep", throwWeapon )