Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local generalLoaded = false
- local playingAnimation = 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 = -2504.181640625, y = 3599.275390625, z = 14.4641599655151, heading = 146.33984375},
- }
- local blips = {
- {x = -2511.164, y = 3616.904, z = 13.64},
- {x = 24.392, y = -1345.413, z = 29.497},
- {x = -47.311, y = -1758.624, z = 29.420},
- {x = -2504.181, y = 3599.275, z = 14.464},
- }
- for _, item in pairs(blips) do
- item.blip = AddBlipForCoord(item.x, item.y, item.z)
- SetBlipSprite(item.blip, 52)
- SetBlipColour(item.blip, 5)
- SetBlipAsShortRange(item.blip, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString('Clerks')
- EndTextCommandSetBlipName(item.blip)
- end
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- playerPed = GetPlayerPed(-1)
- playerCoords = GetEntityCoords(playerPed, 0)
- if (not generalLoaded) then
- for i=1, #ShopClerk do
- RequestModel(ShopClerk[i].modelHash)
- while not HasModelLoaded(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, true)
- end
- generalLoaded = true
- end
- RequestAnimDict("random@shop_gunstore")
- while (not HasAnimDictLoaded("random@shop_gunstore")) do
- Citizen.Wait(0)
- end
- for i=1, #ShopClerk do
- distance = GetDistanceBetweenCoords(ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, GetEntityCoords(GetPlayerPed(-1)))
- if distance < 6 and PlayingAnim ~= true then
- TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
- PlayingAnim = true
- Citizen.Wait(4000)
- if PlayingAnim == true then
- TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
- end
- else
- TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
- end
- end
- end
- end)
- Citizen.CreateThread(function() -- This Sortoff fixes it, not the cleanest fix but "working".
- while true do
- Citizen.Wait(0)
- local Door = {{x = 29.054, y = -1350.059, z = 29.33}}
- for _, Door in pairs(Door) do
- DrawMarker(1, Door.x, Door.y, Door.z, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 0, 255, 0, 255, 0, 0, 0, 0)
- local luld = GetDistanceBetweenCoords(Door.x, Door.y, Door.z, GetEntityCoords(GetPlayerPed(-1)))
- if luld < 1 then
- PlayingAnim = false
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement