[Release] Simple outlaw alert (11-04-2017)

Anyone else experience any problems with this since the update to FiveM a couple of days ago? Worked fine, then the update happened and it has not worked for me. Anyone else having this issue? Any ideas on solutions?

Feel free to modify if player have suppressor = no alert !

if IsPedShooting(GetPlayerPed(-1)) then
  local ped = PlayerPedId()
  local currentWeaponHash = GetSelectedPedWeapon(ped)
  local havesilence = false
  if currentWeaponHash == GetHashKey("WEAPON_PISTOL") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("component_at_pi_supp_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_PISTOL50") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_COMBATPISTOL") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_APPISTOL") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_APPISTOL"), GetHashKey("COMPONENT_AT_PI_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_HEAVYPISTOL") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYPISTOL"), GetHashKey("COMPONENT_AT_PI_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_VINTAGEPISTOL") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_VINTAGEPISTOL"), GetHashKey("COMPONENT_AT_PI_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_SMG") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_SMG"), GetHashKey("COMPONENT_AT_PI_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_MICROSMG") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_MICROSMG"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTSMG") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSMG"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTRIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTRIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_CARBINERIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_ADVANCEDRIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_ADVANCEDRIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_SPECIALCARBINE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_SPECIALCARBINE"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_BULLPUPRIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_BULLPUPRIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTSHOTGUN") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSHOTGUN"), GetHashKey("COMPONENT_AT_AR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_HEAVYSHOTGUN") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYSHOTGUN"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_BULLPUPSHOTGUN") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_BULLPUPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_PUMPSHOTGUN") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_SR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_MARKSMANRIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_MARKSMANRIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP"))
  elseif currentWeaponHash == GetHashKey("WEAPON_SNIPERRIFLE") then
    havesilence = HasPedGotWeaponComponent(GetPlayerPed(-1), GetHashKey("WEAPON_SNIPERRIFLE"), GetHashKey("COMPONENT_AT_AR_SUPP_02"))
  elseif currentWeaponHash == GetHashKey("WEAPON_STUNGUN") then
    havesilence = true
  end
  if not havesilence then
    origin = true
    DecorSetInt(GetPlayerPed(-1), "IsOutlaw", 2)
    local male = IsPedMale(GetPlayerPed(-1))
    if male then
      sex = "a men"
    elseif not male then
      sex = "a women"
    end
    TriggerServerEvent('gunshotInProgressPos', plyPos.x, plyPos.y, plyPos.z)
    if s2 == 0 then
      TriggerServerEvent('gunshotInProgressS1', street1, sex)
    elseif s2 ~= 0 then
      TriggerServerEvent("gunshotInProgress", street1, street2, sex)
    end
    Wait(2000)
    origin = false
  end
end
1 Like

Does the vRP version from July still work in vRP?

Using the version from @JinkLeft for vRP, I’m seeing this in my log file:

Error loading script server.lua in resource vrp-outlawalert: server.lua:2: attempt to call a nil value (global 'require')
stack traceback:
	server.lua:2: in main chunk
Failed to load script server.lua.
Started resource vrp-outlawalert

mini Map not working???

does the civ just nicks a car and auto alerts cops?

Where abouts would I add this code and would I need to remove any code?

Any ideals on how to change the language When ever I get an alert, it is NOT in english.

Has anybody made a whitelist for weapons, so that it doesen’t show when throwing a snowball? :smiley:

not working for whitelisted cops with custom GTAO online characters, it still displays to the whole server

Where do I put this?

Hi! I have a good idea for alerting! I’m using gc_phone but I can’t send dispatches to the polices etc… so I would like to connect the outlawalert with gc_phone so the game will send an alert and a blip to the police officers when somebody called them like the carjacking blip! Can you make this? I’m really glad to your that you did that script so can you please help me what to do?

1 Like

Can anyone help?
i am trying to get the text to display in chat insted since i think that chat box is disapering to fast but cant get it to work :S

can you tell me how to expand the radar distance for carjacking, gunshot, and melee?

Anyone got code for silencers? Including MK2 weapon silencers?

Anyone know how to add DRUG SALES alerts into the script please I would appreciate it very much!

Thanks for the awesome work @nynjardin

1 Like

BrutalSoldier-HUN

Feb 18

Hi! I have a good idea for alerting! I’m using gc_phone but I can’t send dispatches to the polices etc… so I would like to connect the outlawalert with gc_phone so the game will send an alert and a blip to the police officers when somebody called them like the carjacking blip! Can you make this? I’m really glad to your that you did that script so can you please help me what to do?

You ever find a answer ? I have same question

il possibile change “local PedModels” to vrp pex?? “alert.police”

how can i make it work for police withour peds i mean all work in police

Anyone knows how to make the alert blips appear on the minimap?