Advertisement
npointon

Untitled

Mar 12th, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. function onduty()
  2. IsCop = true
  3. local player = GetPlayerPed(-1)
  4. local model = GetHashKey("s_m_y_sheriff_01") -- Change model name here <-
  5. RequestModel(model)
  6. while not HasModelLoaded(model) do
  7. RequestModel(model)
  8. IsEMS = false
  9. Citizen.Wait(0)
  10. end
  11. SetPlayerModel(PlayerId(), model)
  12. SetModelAsNoLongerNeeded(model)
  13. SetPlayerModel(player, GetHashKey(model))
  14. SetModelAsNoLongerNeeded(model)
  15. SetPedArmour(player, 200)
  16. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 1000, false)
  17. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  18. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLARE"), 5, false)
  19. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 1000, false)
  20. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 1000, false)
  21. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 1000, false)
  22. end
  23.  
  24. function offduty()
  25. IsCop = false
  26. local model = GetHashKey("mp_m_freemode_01") -- Change model name here <-
  27. RequestModel(model)
  28. while not HasModelLoaded(model) do
  29. RequestModel(model)
  30. Citizen.Wait(0)
  31. end
  32. SetPlayerModel(PlayerId(), model)
  33. SetModelAsNoLongerNeeded(model)
  34. SetPlayerModel(player, GetHashKey(model))
  35. SetModelAsNoLongerNeeded(model)
  36. SetPedComponentVariation(GetPlayerPed(-1), 8, 1, 0, 0) --shirt
  37. SetPedComponentVariation(GetPlayerPed(-1), 11, 3, 7, 0) --torso2 (shirt/jacket)
  38. SetPedComponentVariation(GetPlayerPed(-1), 9, 13, 0, 0) --armour
  39. SetPedComponentVariation(GetPlayerPed(-1), 3, 16, 0, 0) --arms
  40. SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0) --trousers
  41. SetPedComponentVariation(GetPlayerPed(-1), 7, 8, 0, 0) --chain
  42. SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 0) --gloves
  43. SetPedComponentVariation(GetPlayerPed(-1), 6, 3, 0, 0) --shoes
  44. local player = GetPlayerPed(-1)
  45. RemoveAllPedWeapons(player, true)
  46. end
  47.  
  48.  
  49. --Sign on/off--
  50.  
  51. Citizen.CreateThread(function()
  52. while true do
  53. local player = GetPlayerPed(-1)
  54. local pl = GetEntityCoords(player)
  55. Citizen.Wait(0)
  56. if GetDistanceBetweenCoords(pl.x, pl.y, pl.z, 1856.72, 3689.58, 34.27) < 1.0 and IsCop == false then -- <-- Sandy Shores --
  57. DrawText3Ds(1856.72, 3689.58, 34.27, "~w~Press [~g~E~w~] To Go on duty")
  58. if IsControlJustReleased(1, 38) then
  59. onduty()
  60. end
  61. elseif
  62. Vdist2(pl.x, pl.y, pl.z, -449.85, 6016.22, 31.72) < 1.0 and IsCop == false then -- <-- Paleto Bay --
  63. DrawText3Ds(-449.85, 6016.22, 31.72, "~w~Press [~g~E~w~] To Go on duty")
  64. if IsControlJustReleased(1, 38) then
  65. onduty()
  66. end
  67. elseif
  68. Vdist2(pl.x, pl.y, pl.z, 440.48, -976.32, 30.69) < 1.0 and IsCop == false then -- <-- Mission Row --
  69. DrawText3Ds(440.48, -976.32, 30.69, "~w~Press [~g~E~w~] To Go on duty")
  70. if IsControlJustReleased(1, 38) then
  71. onduty()
  72. end
  73. elseif GetDistanceBetweenCoords(pl.x, pl.y, pl.z, 1856.72, 3689.58, 34.27) < 1.0 and IsCop == true then
  74. DrawText3Ds(1856.72, 3689.58, 34.27, "~w~Press [~g~E~w~] To Go off duty")
  75. if IsControlJustReleased(1, 38) then
  76. offduty()
  77. end
  78. elseif GetDistanceBetweenCoords(pl.x, pl.y, pl.z, -449.85, 60.22, 31.72) < 1.0 and IsCop == true then
  79. DrawText3Ds(-449.85, 6016.22, 31.72, "~w~Press [~g~E~w~] To Go off duty")
  80. if IsControlJustReleased(1, 38) then
  81. offduty()
  82. end
  83. elseif GetDistanceBetweenCoords(pl.x, pl.y, pl.z, 440.48, -976.32, 30.69) < 1.0 and IsCop == true then
  84. DrawText3Ds(440.48, -976.32, 30.69, "~w~Press [~g~E~w~] To Go off duty")
  85. if IsControlJustReleased(1, 38) then
  86. offduty()
  87. end
  88. end
  89. end
  90. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement