As the title said, this script is gonna drop your weapon on ground ( if you have a weapon in your hand ) , it’s not gonna do anything if you don’t have a weapon in your hand .
To do list : Add the actual weapon model drop ( atm it’s gonna be a ammunition charger .) - If possible
There is a famous GTA Online quote : Not on my screen
Conclusion : i don’t know what code you have in your server that’s preventing this script to work proper.
is there anyway to trigger the drop weapon by a key press ? trying to avoid using chat at all for any functions , thanks in advance for any help that can be given
thanks would really appreciate a version with key press , i hope you figure out how to make the gun drop instead of it turning into a ammo clip too , and make it pick up-able by others , maybe look at the games native function when someone with a gun dies and it drops to the ground to see how that works.
And when you’re finished could you also send me a list of all the possible keys? i know lua has it in numbers but i haven’t been able to find a list of it yet.
RegisterNetEvent("dropweapon")
AddEventHandler('dropweapon', function()
local ped = GetPlayerPed(-1)
if DoesEntityExist(ped) and not IsEntityDead(ped) then
SetPedDropsWeapon(ped)
ShowNotification("~r~You have dropped your weapon.")
end
end)
function ShowNotification(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(false, false)
end
Citizen.CreateThread(function()
while true do
Wait(0)
if IsControlJustPressed(1, 81) then
TriggerServerEvent("drops")
end
end
end)
Same thing here. I drop one weapon and then the avatar rearms another weapon instantly. I’m not even running many resources really and nothing else conflicts or works improperly, but this resource. It’s a good idea, but needs some kinks worked out I think to work better with other resource scripts.
When you drop your weapon another one is equipped. I believe this is just how GTA does it. You can use the native givepedweapon and use the unarmed hash. Put the code right after setpeddropsweapon(ped). Not at home, can’t test.