Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. local generalLoaded = false
  2.  
  3. local ShopClerk = {
  4. {id = 1, modelHash = "mp_m_shopkeep_01", x = -2511.16479492188, y = 3616.90478515625, z = 13.6422147750854, heading = 245.000457763672},
  5. {id = 2, modelHash = "mp_m_shopkeep_01", x = 24.392505645752, y = -1345.41369628906, z = 29.4970207214355, heading = 264.900115966797},
  6. {id = 3, modelHash = "mp_m_shopkeep_01", x = -47.3110542297363, y = -1758.62475585938, z = 29.4209995269775, heading = 48.1558074951172},
  7. {id = 4, modelHash = "mp_m_shopkeep_01", x = -1222.634765625, y = -908.70556640625, z = 12.3263559341431, heading = 32.385929107666},
  8. {id = 5, modelHash = "mp_m_shopkeep_01", x = -1485.60900878906, y = -378.485992431641, z = 40.1634254455566, heading = 133.654083251953},
  9. {id = 6, modelHash = "mp_m_shopkeep_01", x = 372.526092529297, y = 327.311004638672, z = 103.566375732422, heading = 253.517913818359},
  10. {id = 7, modelHash = "mp_m_shopkeep_01", x = 1165.26245117188, y = -323.534149169922, z = 69.2050704956055, heading = 102.875175476074},
  11. {id = 8, modelHash = "mp_m_shopkeep_01", x = 1134.07702636719, y = -981.830200195313, z = 46.4158401489258, heading = 276.562408447266},
  12. {id = 9, modelHash = "mp_m_shopkeep_01", x = -1819.32421875, y = 793.415771484375, z = 138.084075927734, heading = 124.403091430664},
  13. {id = 10, modelHash = "mp_m_shopkeep_01", x = -2966.45776367188, y = 390.181335449219, z = 15.0433120727539, heading = 95.99169921875},
  14. {id = 11, modelHash = "mp_m_shopkeep_01", x = -3242.6884765625, y = 999.86572265625, z = 12.8307065963745, heading = 354.164581298828},
  15. {id = 12, modelHash = "mp_m_shopkeep_01", x = 549.142761230469, y = 2670.9423828125, z = 42.156494140625, heading = 107.451248168945},
  16. {id = 13, modelHash = "mp_m_shopkeep_01", x = 2556.3447265625, y = 380.845031738281, z = 108.622970581055, heading = 355.404998779297},
  17. {id = 14, modelHash = "mp_m_shopkeep_01", x = 2677.27709960938, y = 3279.62060546875, z = 55.2411308288574, heading = 332.322631835938},
  18. {id = 15, modelHash = "mp_m_shopkeep_01", x = 1959.64953613281, y = 3740.59716796875, z = 32.3437423706055, heading = 301.815490722656},
  19. {id = 16, modelHash = "mp_m_shopkeep_01", x = 1391.99658203125, y = 3606.1640625, z = 34.9809265136719, heading = 196.150482177734},
  20. {id = 17, modelHash = "mp_m_shopkeep_01", x = 1697.28686523438, y = 4923.3740234375, z = 42.0636367797852, heading = 331.761840820313},
  21. {id = 18, modelHash = "mp_m_shopkeep_01", x = 1728.24340820313, y = 6415.97509765625, z = 35.0372276306152, heading = 253.649108886719},
  22. }
  23.  
  24. Citizen.CreateThread(function()
  25. while true do
  26. Citizen.Wait(0)
  27.  
  28. if (not generalLoaded) then
  29.  
  30. for i=1, #ShopClerk do
  31. RequestModel(GetHashKey(ShopClerk[i].modelHash))
  32. while not HasModelLoaded(GetHashKey(ShopClerk[i].modelHash)) do
  33. Wait(1)
  34. end
  35.  
  36. ShopClerk[i].id = CreatePed(2, ShopClerk[i].modelHash, ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, ShopClerk[i].heading, false, true)
  37. SetPedFleeAttributes(ShopClerk[i].id, 0, 0)
  38.  
  39. end
  40. generalLoaded = true
  41.  
  42. end
  43.  
  44. end
  45. end)
  46.  
  47. local PlayingAnim = false
  48. Citizen.CreateThread(function()
  49. while true do
  50. Citizen.Wait(0)
  51. RequestAnimDict("random@shop_gunstore")
  52. while (not HasAnimDictLoaded("random@shop_gunstore")) do
  53. Citizen.Wait(0)
  54. end
  55.  
  56. local ply = GetPlayerPed(-1)
  57. local plyCoords = GetEntityCoords(ply, 0)
  58. for k,v in pairs(ShopClerk) do
  59. local doordist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, v.x, v.y, v.z)
  60. if (doordist < 6) then
  61. if PlayingAnim == false then
  62. TaskPlayAnim(v.id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
  63. PlayingAnim = true
  64. Citizen.Wait(4000)
  65. else
  66. TaskPlayAnim(v.id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
  67. Citizen.Wait(4000)
  68. end
  69. else
  70. TaskPlayAnim(v.id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
  71. --PlayingAnim = false
  72. end
  73. end
  74. end
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement