Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. x, y, z = 1744.1080322266,-1623.0484619141,112.63006591797
  2.  
  3. Citizen.CreateThread(function()
  4.   hooker = GetHashKey( "csb_oscar" )
  5.   RequestModel( hooker )
  6.   while ( not HasModelLoaded( hooker ) ) do
  7.     Citizen.Wait( 1 )
  8.   end
  9.   theHooker = CreatePed(4, hooker, x, y, z, 90, false, false)
  10.   SetModelAsNoLongerNeeded(hooker)
  11.   SetEntityHeading(theHooker, 110.0)
  12.   FreezeEntityPosition(theHooker, false)
  13.   SetEntityInvincible(theHooker, true)
  14.   SetBlockingOfNonTemporaryEvents(theHooker, true)
  15.   TaskStartScenarioAtPosition(theHooker, "mp_player_int_uppersalute",x, y, z-0.35, GetEntityHeading(theHooker), 0, 0, true)
  16. end)
  17.  
  18. local function DrawText3D(coords, text, size)
  19.     local onScreen, x, y = World3dToScreen2d(coords.x, coords.y, coords.z)
  20.     local camCoords      = GetGameplayCamCoords()
  21.     local dist           = GetDistanceBetweenCoords(camCoords, coords.x, coords.y, coords.z, true)
  22.     local size           = size
  23.  
  24.     if size == nil then
  25.         size = 1
  26.     end
  27.  
  28.     local scale = (size / dist) * 2
  29.     local fov   = (1 / GetGameplayCamFov()) * 100
  30.     local scale = scale * fov
  31.  
  32.     if onScreen then
  33.         SetTextScale(0.0 * scale, 0.55 * scale)
  34.         SetTextFont(0)
  35.         SetTextProportional(1)
  36.         local rgb = RGBRainbow(1)
  37.         SetTextColour(rgb.r, rgb.g, rgb.b, 255)
  38.         SetTextDropshadow(0, 0, 0, 0, 255)
  39.         SetTextEdge(2, 0, 0, 0, 150)
  40.         SetTextDropShadow()
  41.         SetTextOutline()
  42.         SetTextEntry('STRING')
  43.         SetTextCentre(1)
  44.  
  45.         AddTextComponentString(text)
  46.         DrawText(x, y)
  47.     end
  48. end
  49.  
  50. function RGBRainbow(frequency)
  51.   local result = {}
  52.   local curtime = GetGameTimer() / 1200
  53.  
  54.   result.r = math.floor(math.sin(curtime * frequency + 0) * 127 + 128)
  55.   result.g = math.floor(math.sin(curtime * frequency + 2) * 127 + 128)
  56.   result.b = math.floor(math.sin(curtime * frequency + 4) * 127 + 128)
  57.  
  58.   return result
  59. end
  60.  
  61. Citizen.CreateThread(function()
  62.   while true do
  63.     local pos = GetEntityCoords(GetPlayerPed(-1), true)
  64.     if(GetDistanceBetweenCoords(pos.x, pos.y, pos.z, x, y, z) < 4.5)then
  65.       DrawText3D({x = x, y = y, z = z+0.9}, "Gunoier", 0.8)
  66.     end
  67.     Citizen.Wait(0)
  68.   end
  69. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement