Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local generalLoaded = false
- local ShopClerk = {
- {id = 1, modelHash = "mp_m_shopkeep_01", x = -2511.16479492188, y = 3616.90478515625, z = 13.6422147750854, heading = 245.000457763672},
- {id = 2, modelHash = "mp_m_shopkeep_01", x = 24.392505645752, y = -1345.41369628906, z = 29.4970207214355, heading = 264.900115966797},
- {id = 3, modelHash = "mp_m_shopkeep_01", x = -47.3110542297363, y = -1758.62475585938, z = 29.4209995269775, heading = 48.1558074951172},
- {id = 4, modelHash = "mp_m_shopkeep_01", x = -1222.634765625, y = -908.70556640625, z = 12.3263559341431, heading = 32.385929107666},
- {id = 5, modelHash = "mp_m_shopkeep_01", x = -1485.60900878906, y = -378.485992431641, z = 40.1634254455566, heading = 133.654083251953},
- {id = 6, modelHash = "mp_m_shopkeep_01", x = 372.526092529297, y = 327.311004638672, z = 103.566375732422, heading = 253.517913818359},
- {id = 7, modelHash = "mp_m_shopkeep_01", x = 1165.26245117188, y = -323.534149169922, z = 69.2050704956055, heading = 102.875175476074},
- {id = 8, modelHash = "mp_m_shopkeep_01", x = 1134.07702636719, y = -981.830200195313, z = 46.4158401489258, heading = 276.562408447266},
- {id = 9, modelHash = "mp_m_shopkeep_01", x = -1819.32421875, y = 793.415771484375, z = 138.084075927734, heading = 124.403091430664},
- {id = 10, modelHash = "mp_m_shopkeep_01", x = -2966.45776367188, y = 390.181335449219, z = 15.0433120727539, heading = 95.99169921875},
- {id = 11, modelHash = "mp_m_shopkeep_01", x = -3242.6884765625, y = 999.86572265625, z = 12.8307065963745, heading = 354.164581298828},
- {id = 12, modelHash = "mp_m_shopkeep_01", x = 549.142761230469, y = 2670.9423828125, z = 42.156494140625, heading = 107.451248168945},
- {id = 13, modelHash = "mp_m_shopkeep_01", x = 2556.3447265625, y = 380.845031738281, z = 108.622970581055, heading = 355.404998779297},
- {id = 14, modelHash = "mp_m_shopkeep_01", x = 2677.27709960938, y = 3279.62060546875, z = 55.2411308288574, heading = 332.322631835938},
- {id = 15, modelHash = "mp_m_shopkeep_01", x = 1959.64953613281, y = 3740.59716796875, z = 32.3437423706055, heading = 301.815490722656},
- {id = 16, modelHash = "mp_m_shopkeep_01", x = 1391.99658203125, y = 3606.1640625, z = 34.9809265136719, heading = 196.150482177734},
- {id = 17, modelHash = "mp_m_shopkeep_01", x = 1697.28686523438, y = 4923.3740234375, z = 42.0636367797852, heading = 331.761840820313},
- {id = 18, modelHash = "mp_m_shopkeep_01", x = 1728.24340820313, y = 6415.97509765625, z = 35.0372276306152, heading = 253.649108886719},
- }
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if (not generalLoaded) then
- for i=1, #ShopClerk do
- RequestModel(GetHashKey(ShopClerk[i].modelHash))
- while not HasModelLoaded(GetHashKey(ShopClerk[i].modelHash)) do
- Wait(1)
- end
- ShopClerk[i].id = CreatePed(2, ShopClerk[i].modelHash, ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, ShopClerk[i].heading, false, true)
- SetPedFleeAttributes(ShopClerk[i].id, 0, 0)
- end
- generalLoaded = true
- end
- end
- end)
- local PlayingAnim = false
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- RequestAnimDict("random@shop_gunstore")
- while (not HasAnimDictLoaded("random@shop_gunstore")) do
- Citizen.Wait(0)
- end
- local ply = GetPlayerPed(-1)
- local plyCoords = GetEntityCoords(ply, 0)
- for k,v in pairs(ShopClerk) do
- local doordist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, v.x, v.y, v.z)
- if (doordist < 6) then
- if PlayingAnim == false then
- TaskPlayAnim(v.id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
- PlayingAnim = true
- Citizen.Wait(4000)
- else
- TaskPlayAnim(v.id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
- Citizen.Wait(4000)
- end
- else
- TaskPlayAnim(v.id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
- --PlayingAnim = false
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement