Advertisement
MadDevil

police blips

Sep 25th, 2023
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | Software | 0 0
  1. -- police blips for if he ride car or in foot
  2.  
  3. local function CreateDutyBlips(playerId, playerLabel, playerJob, playerLocation)
  4.     local ped = GetPlayerPed(playerId)
  5.     local blip = GetBlipFromEntity(ped)
  6.     local pedinvehicle = IsPedInAnyVehicle(ped)
  7.     if not DoesBlipExist(blip) then
  8.         if NetworkIsPlayerActive(playerId) then
  9.             blip = AddBlipForEntity(ped)
  10.         else
  11.             blip = AddBlipForCoord(playerLocation.x, playerLocation.y, playerLocation.z)
  12.         end
  13.         if pedinvehicle then
  14.             SetBlipSprite(blip, 225)
  15.             ShowHeadingIndicatorOnBlip(blip, false)
  16.         else
  17.             -- SetBlipSprite(blip, 41)
  18.             ShowHeadingIndicatorOnBlip(blip, true)
  19.         end
  20.         SetBlipRotation(blip, math.ceil(playerLocation.w))
  21.         SetBlipScale(blip, 1.0)
  22.         if playerJob == "police" then
  23.             SetBlipColour(blip, 53)
  24.         else
  25.             SetBlipColour(blip, 53)
  26.         end
  27.         SetBlipAsShortRange(blip, true)
  28.         BeginTextCommandSetBlipName('STRING')
  29.         AddTextComponentString(playerLabel)
  30.         EndTextCommandSetBlipName(blip)
  31.         DutyBlips[#DutyBlips+1] = blip
  32.     end
  33.  
  34.     if GetBlipFromEntity(PlayerPedId()) == blip then
  35.         -- Ensure we remove our own blip.
  36.         RemoveBlip(blip)
  37.     end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement