Hi, i’ve been trying to make a simple script that gives you the basic weapons for police on a marker but i can’t give weapon to my player, here is the code, there are no errors on console and it only don’t gives the weapons to the players.
Here is the code with all the ways that i’ve tryied to:
– FIVEM WEAPON HASHES GTA-5 Hash list objects, cars with pictures, skins, weapons, animations | All Objects
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local markerPos = vector3(480.53, -995.3, 30.69)
local ped = GetPlayerPed(-1)
local playerCoords = GetEntityCoords(ped)
local distance = #(playerCoords - markerPos)
local pedId = PlayerPedId()
if distance < 8.0 then
DrawMarker(20, 480.53, -995.3, 30.69, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0, 0, 0, 100, true, true, 2, nil, nil, false)
if IsControlJustPressed(0, 38) and distance < 1.0 then
GiveWeaponToPed(pedId, GetHashKey('weapon_pistol'), 2, false, false)
GiveWeaponToPed(pedId, GetHashKey("WEAPON_FLASHLIGHT"), 1, false, false)
GiveWeaponToPed(ped, GetHashKey("WEAPON_NIGHTSTICK"), 1, false, false)
GiveWeaponToPed(PlayerPedId(), -1075685676, 1, false, false)
exports['origen_notify']:ShowNotification("Se te ha dado el armamento reglamentario")
end
else
Citizen.Wait(1500)
end
end
end)