Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. local isRadarExtended = false
  2.  
  3. Citizen.CreateThread(function()
  4.  
  5. while true do
  6.  
  7. Wait( 1 )
  8.  
  9. -- extend minimap on keypress
  10. if IsControlJustPressed( 0, 20 ) then
  11.  
  12. if not isRadarExtended then
  13.  
  14. SetRadarBigmapEnabled( false, false) --включение увеличенной карты на Z
  15. isRadarExtended = true
  16.  
  17. Citizen.CreateThread(function()
  18.  
  19. run = true
  20.  
  21. while run do
  22.  
  23. for i = 0, 500 do
  24.  
  25. Wait(1)
  26.  
  27. if not isRadarExtended then
  28.  
  29. run = false
  30. break
  31.  
  32. end
  33.  
  34. end
  35.  
  36. SetRadarBigmapEnabled( false, false )
  37. isRadarExtended = false
  38.  
  39. end
  40.  
  41. end)
  42.  
  43. else
  44.  
  45. SetRadarBigmapEnabled( false, false )
  46. isRadarExtended = false
  47.  
  48. end
  49.  
  50. end
  51.  
  52. -- show blips
  53. for id = 0, 64 do
  54.  
  55. if NetworkIsPlayerActive( id ) and GetPlayerPed( id ) ~= GetPlayerPed( -1 ) then
  56.  
  57. ped = GetPlayerPed( id )
  58. blip = GetBlipFromEntity( ped )
  59.  
  60. -- HEAD DISPLAY STUFF --
  61.  
  62. -- Create head display (this is safe to be spammed)
  63. --headId = Citizen.InvokeNative( 0xBFEFE3321A3F5015, ped, GetPlayerName, true, true, "", true )
  64. wantedLvl = GetPlayerWantedLevel( id )
  65.  
  66. -- Wanted level display
  67. if wantedLvl then
  68.  
  69. Citizen.InvokeNative( 0x63BB75ABEDC1F6A0, headId, 7, true ) -- Add wanted sprite
  70. Citizen.InvokeNative( 0xCF228E2AA03099C3, headId, wantedLvl ) -- Set wanted number
  71.  
  72. else
  73.  
  74. Citizen.InvokeNative( 0x63BB75ABEDC1F6A0, headId, 7, false ) -- Remove wanted sprite
  75.  
  76. end
  77.  
  78. -- Speaking display
  79. if NetworkIsPlayerTalking( id ) then
  80.  
  81. Citizen.InvokeNative( 0x63BB75ABEDC1F6A0, headId, 9, true ) -- Add speaking sprite
  82.  
  83. else
  84.  
  85. Citizen.InvokeNative( 0x63BB75ABEDC1F6A0, headId, 9, false ) -- Remove speaking sprite
  86.  
  87. end
  88.  
  89. -- BLIP STUFF --
  90.  
  91. if not DoesBlipExist( blip ) then -- Add blip and create head display on player
  92.  
  93. blip = AddBlipForEntity( ped )
  94. SetBlipSprite( blip, 1 )
  95. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, true ) -- Player Blip indicator
  96.  
  97. else -- update blip
  98.  
  99. veh = GetVehiclePedIsIn( ped, false )
  100. blipSprite = GetBlipSprite( blip )
  101.  
  102. if not GetEntityHealth( ped ) then -- dead
  103.  
  104. if blipSprite ~= 274 then
  105.  
  106. SetBlipSprite( blip, 274 )
  107. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  108.  
  109. end
  110.  
  111. elseif veh then
  112.  
  113. vehClass = GetVehicleClass( veh )
  114. vehModel = GetEntityModel( veh )
  115.  
  116. if vehClass == 15 then -- jet
  117.  
  118. if blipSprite ~= 422 then
  119.  
  120. SetBlipSprite( blip, 422 )
  121. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  122.  
  123. end
  124.  
  125. elseif vehClass == 16 then -- plane
  126.  
  127. if vehModel == GetHashKey( "besra" ) or vehModel == GetHashKey( "hydra" )
  128. or vehModel == GetHashKey( "lazer" ) then -- jet
  129.  
  130. if blipSprite ~= 424 then
  131.  
  132. SetBlipSprite( blip, 424 )
  133. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  134.  
  135. end
  136.  
  137. elseif blipSprite ~= 423 then
  138.  
  139. SetBlipSprite( blip, 423 )
  140. Citizen.InvokeNative (0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  141.  
  142. end
  143.  
  144. elseif vehClass == 14 then -- boat
  145.  
  146. if blipSprite ~= 427 then
  147.  
  148. SetBlipSprite( blip, 427 )
  149. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  150.  
  151. end
  152.  
  153. elseif vehModel == GetHashKey( "insurgent" ) or vehModel == GetHashKey( "insurgent2" )
  154. or vehModel == GetHashKey( "limo2" ) then -- insurgent (+ turreted limo cuz limo blip wont work)
  155.  
  156. if blipSprite ~= 426 then
  157.  
  158. SetBlipSprite( blip, 426 )
  159. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  160.  
  161. end
  162.  
  163. elseif vehModel == GetHashKey( "rhino" ) then -- tank
  164.  
  165. if blipSprite ~= 421 then
  166.  
  167. SetBlipSprite( blip, 421 )
  168. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, false ) -- Player Blip indicator
  169.  
  170. end
  171.  
  172. elseif blipSprite ~= 1 then -- default blip
  173.  
  174. SetBlipSprite( blip, 1 )
  175. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, true ) -- Player Blip indicator
  176.  
  177. end
  178.  
  179. -- Show number in case of passangers
  180. passengers = GetVehicleNumberOfPassengers( veh )
  181.  
  182. if passengers then
  183.  
  184. if not IsVehicleSeatFree( veh, -1 ) then
  185.  
  186. passengers = passengers + 1
  187.  
  188. end
  189.  
  190. ShowNumberOnBlip( blip, passengers )
  191.  
  192. else
  193.  
  194. HideNumberOnBlip( blip )
  195.  
  196. end
  197.  
  198. else
  199.  
  200. -- Remove leftover number
  201. HideNumberOnBlip( blip )
  202.  
  203. if blipSprite ~= 1 then -- default blip
  204.  
  205. SetBlipSprite( blip, 1 )
  206. Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, true ) -- Player Blip indicator
  207.  
  208. end
  209.  
  210. end
  211.  
  212. SetBlipRotation( blip, math.ceil( GetEntityHeading( veh ) ) ) -- update rotation
  213. SetBlipNameToPlayerName( blip, id ) -- update blip name
  214. SetBlipScale( blip, 0.85 ) -- set scale
  215.  
  216. -- set player alpha
  217. if IsPauseMenuActive() then
  218.  
  219. SetBlipAlpha( blip, 255 )
  220.  
  221. else
  222.  
  223. x1, y1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
  224. x2, y2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
  225. distance = ( math.floor( math.abs( math.sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ) ) / -1 ) ) + 900
  226. -- Probably a way easier way to do this but whatever im an idiot
  227.  
  228. if distance < 0 then
  229.  
  230. distance = 0
  231.  
  232. elseif distance > 255 then
  233.  
  234. distance = 255
  235.  
  236. end
  237.  
  238. SetBlipAlpha( blip, distance )
  239.  
  240. end
  241.  
  242. end
  243.  
  244. end
  245.  
  246. end
  247.  
  248. end
  249.  
  250. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement