function drawNotification(text) SetNotificationTextEntry("STRING") AddTextComponentString(text) DrawNotification(true, true) end function DisplayHelpText(str) SetTextComponentFormat("STRING") AddTextComponentString(str) DisplayHelpTextFromStringLabel(0, 0, 1, -1) end local sitting = false local girlInComming = false local girlArrived = false local girl = nil Citizen.CreateThread(function() for i=1, #Config.Npc, 1 do local model= RequestModel(GetHashKey(Config.Npc[i].model)) while not HasModelLoaded(GetHashKey(Config.Npc[i].model)) do Wait(1) end dmvmainped = CreatePed(4, model, Config.Npc[i].x, Config.Npc[i].y,Config.Npc[i].z, false, true) end end) Citizen.CreateThread(function() while true do Citizen.Wait(0) for i=1, #Config.ServiceZone, 1 do if (GetDistanceBetweenCoords( GetEntityCoords(GetPlayerPed(-1)), Config.ServiceZone[i].x , Config.ServiceZone[i].y , Config.ServiceZone[i].z , true)<3 ) then if sitting == false then DisplayHelpText("Appuyez sur ~INPUT_CONTEXT~ pour payer un ~b~service ~r~(+18)") if(IsControlJustReleased(1, 38))then local player = GetPlayerPed(-1) local pos = GetEntityCoords(player) local r = math.random(1, 5) dmvmainped = CreatePed(4, Config.Bitch[r].model,108.43 ,-1305.9080,29.78,202.358 ,false, true) girl = dmvmainped drawNotification("Une charmante demoiselle arrive ... ") TaskGoToCoordAnyMeans(girl,pos.x,pos.y-0.50,pos.z, 1.0,0, false, 0,786603, 0.0) TaskStartScenarioAtPosition(player, "PROP_HUMAN_SEAT_BENCH",Config.ServiceZone[i].x, Config.ServiceZone[i].y,Config.ServiceZone[i].z, Config.ServiceZone[i].a, 0, true, true) sitting = true while (not girlInComming)do Citizen.Wait(0) print(GetDistanceBetweenCoords(GetEntityCoords(player,true),GetEntityCoords(girl,true),true)) if(GetDistanceBetweenCoords(GetEntityCoords(player,true),GetEntityCoords(girl,true),true)<=1) then drawNotification("Profitez du spectacle ...") girlInComming = true girlArrived = true end end if(girlArrived)then TaskPlayAnim(girl, Config.Bitch[i].lib, Config.Bitch[i].anim, 8.0, 8.0, -1,1, 0, false, false, false) end end else DisplayHelpText('Appuyez sur ~INPUT_VEH_DUCK~ pour vous lever.') if IsControlJustPressed(0,73) then player = GetPlayerPed(-1) pos = GetEntityCoords(player, true) ClearPedTasks(player) ClearPedTasks(girl) SetEntityCoords(player, Config.ServiceZone[i].x , Config.ServiceZone[i].y , Config.ServiceZone[i].z) FreezeEntityPosition(player, false) sitting = false TaskGoToCoordAnyMeans(girl,108.43 ,-1305.90,29.78, 1.0,0, false, 0,786603, 0.0) Wait(13000) DeleteEntity(girl) girlInComming = false girlArrived = false end end end end end end) Citizen.CreateThread(function() for i=1, #Config.Bitch, 1 do local model= RequestModel(GetHashKey(Config.Bitch[i].model)) while not HasModelLoaded(GetHashKey(Config.Bitch[i].model)) do Wait(1) end RequestAnimDict(Config.Bitch[i].lib) while not HasAnimDictLoaded(Config.Bitch[i].lib) do Citizen.Wait(0) end if HasAnimDictLoaded(Config.Bitch[i].lib) then end dmvmainped = CreatePed(4, model, Config.Bitch[i].x, Config.Bitch[i].y, Config.Bitch[i].z, Config.Bitch[i].a, false, true) TaskPlayAnim(dmvmainped, Config.Bitch[i].lib, Config.Bitch[i].anim, 8.0, 8.0, -1,1, 0, false, false, false) end end)