Advertisement
Trsak

Untitled

Jan 6th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. if players[i].job.name == "sheriff" then
  2. local id = GetPlayerFromServerId(players[i].source)
  3. if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then
  4. createBlip(id)
  5. end
  6. elseif players[i].job.name == "sahp" then
  7. local id = GetPlayerFromServerId(players[i].source)
  8. if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then
  9. createBlipSAHP(id)
  10. end
  11. elseif players[i].job.name == "police" then
  12. local id = GetPlayerFromServerId(players[i].source)
  13. if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then
  14. createBlipPolice(id)
  15. end
  16. elseif players[i].job.name == "ambulance" then
  17. local id = GetPlayerFromServerId(players[i].source)
  18. if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then
  19. createBlipEMS(id)
  20. end
  21. end
  22.  
  23.  
  24. function createBlip(id)
  25. local ped = GetPlayerPed(id)
  26. local blip = GetBlipFromEntity(ped)
  27.  
  28. if not DoesBlipExist(blip) then -- Add blip and create head display on player
  29. blip = AddBlipForEntity(ped)
  30. SetBlipSprite(blip, 1)
  31. ShowHeadingIndicatorOnBlip(blip, true) -- Player Blip indicator
  32. SetBlipRotation(blip, math.ceil(GetEntityHeading(ped))) -- update rotation
  33. SetBlipScale(blip, 0.85) -- set scale
  34. SetBlipAsShortRange(blip, true)
  35. SetBlipColour(blip, 5)
  36.  
  37. BeginTextCommandSetBlipName("STRING")
  38. AddTextComponentSubstringPlayerName("Jednotka BSCO")
  39. EndTextCommandSetBlipName(blip)
  40.  
  41. table.insert(blipsCops, blip) -- add blip to array so we can remove it later
  42. end
  43. end
  44.  
  45. function createBlipSAHP(id)
  46. local ped = GetPlayerPed(id)
  47. local blip = GetBlipFromEntity(ped)
  48.  
  49. if not DoesBlipExist(blip) then -- Add blip and create head display on player
  50. blip = AddBlipForEntity(ped)
  51. SetBlipSprite(blip, 1)
  52. ShowHeadingIndicatorOnBlip(blip, true) -- Player Blip indicator
  53. SetBlipRotation(blip, math.ceil(GetEntityHeading(ped))) -- update rotation
  54. SetBlipScale(blip, 0.85) -- set scale
  55. SetBlipAsShortRange(blip, true)
  56. SetBlipColour(blip, 28)
  57.  
  58. BeginTextCommandSetBlipName("STRING")
  59. AddTextComponentSubstringPlayerName("Jednotka SAHP")
  60. EndTextCommandSetBlipName(blip)
  61.  
  62. table.insert(blipsCops, blip) -- add blip to array so we can remove it later
  63. end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement