fork(3) download
  1.  
  2.  
  3. function drawNotification(text)
  4. SetNotificationTextEntry("STRING")
  5. AddTextComponentString(text)
  6. DrawNotification(true, true)
  7. end
  8. function DisplayHelpText(str)
  9. SetTextComponentFormat("STRING")
  10. AddTextComponentString(str)
  11. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  12. end
  13.  
  14.  
  15. local sitting = false
  16. local girlInComming = false
  17. local girlArrived = false
  18. local girl = nil
  19.  
  20. Citizen.CreateThread(function()
  21. for i=1, #Config.Npc, 1 do
  22.  
  23. local model= RequestModel(GetHashKey(Config.Npc[i].model))
  24. while not HasModelLoaded(GetHashKey(Config.Npc[i].model)) do
  25. Wait(1)
  26. end
  27. dmvmainped = CreatePed(4, model, Config.Npc[i].x, Config.Npc[i].y,Config.Npc[i].z, false, true)
  28. end
  29. end)
  30.  
  31. Citizen.CreateThread(function()
  32. while true do
  33. Citizen.Wait(0)
  34. for i=1, #Config.ServiceZone, 1 do
  35.  
  36. if (GetDistanceBetweenCoords(
  37. GetEntityCoords(GetPlayerPed(-1)),
  38. Config.ServiceZone[i].x ,
  39. Config.ServiceZone[i].y ,
  40. Config.ServiceZone[i].z , true)<3 ) then
  41. if sitting == false then
  42. DisplayHelpText("Appuyez sur ~INPUT_CONTEXT~ pour payer un ~b~service ~r~(+18)")
  43. if(IsControlJustReleased(1, 38))then
  44. local player = GetPlayerPed(-1)
  45. local pos = GetEntityCoords(player)
  46. local r = math.random(1, 5)
  47. dmvmainped = CreatePed(4, Config.Bitch[r].model,108.43 ,-1305.9080,29.78,202.358 ,false, true)
  48. girl = dmvmainped
  49. drawNotification("Une charmante demoiselle arrive ... ")
  50. TaskGoToCoordAnyMeans(girl,pos.x,pos.y-0.50,pos.z, 1.0,0, false, 0,786603, 0.0)
  51.  
  52.  
  53. 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)
  54. sitting = true
  55.  
  56. while (not girlInComming)do
  57. Citizen.Wait(0)
  58.  
  59. print(GetDistanceBetweenCoords(GetEntityCoords(player,true),GetEntityCoords(girl,true),true))
  60. if(GetDistanceBetweenCoords(GetEntityCoords(player,true),GetEntityCoords(girl,true),true)<=1) then
  61. drawNotification("Profitez du spectacle ...")
  62. girlInComming = true
  63. girlArrived = true
  64.  
  65. end
  66. end
  67.  
  68. if(girlArrived)then
  69. TaskPlayAnim(girl, Config.Bitch[i].lib, Config.Bitch[i].anim, 8.0, 8.0, -1,1, 0, false, false, false)
  70.  
  71. end
  72.  
  73.  
  74. end
  75.  
  76. else
  77. DisplayHelpText('Appuyez sur ~INPUT_VEH_DUCK~ pour vous lever.')
  78.  
  79. if IsControlJustPressed(0,73) then
  80. player = GetPlayerPed(-1)
  81. pos = GetEntityCoords(player, true)
  82. ClearPedTasks(player)
  83. ClearPedTasks(girl)
  84. SetEntityCoords(player, Config.ServiceZone[i].x ,
  85. Config.ServiceZone[i].y ,
  86. Config.ServiceZone[i].z)
  87. FreezeEntityPosition(player, false)
  88. sitting = false
  89. TaskGoToCoordAnyMeans(girl,108.43 ,-1305.90,29.78, 1.0,0, false, 0,786603, 0.0)
  90. Wait(13000)
  91. DeleteEntity(girl)
  92. girlInComming = false
  93. girlArrived = false
  94.  
  95.  
  96. end
  97.  
  98. end
  99. end
  100.  
  101. end
  102. end
  103. end)
  104.  
  105.  
  106. Citizen.CreateThread(function()
  107. for i=1, #Config.Bitch, 1 do
  108.  
  109.  
  110. local model= RequestModel(GetHashKey(Config.Bitch[i].model))
  111. while not HasModelLoaded(GetHashKey(Config.Bitch[i].model)) do
  112. Wait(1)
  113. end
  114. RequestAnimDict(Config.Bitch[i].lib)
  115. while not HasAnimDictLoaded(Config.Bitch[i].lib) do
  116. Citizen.Wait(0)
  117. end
  118. if HasAnimDictLoaded(Config.Bitch[i].lib) then
  119. end
  120. dmvmainped = CreatePed(4, model, Config.Bitch[i].x, Config.Bitch[i].y, Config.Bitch[i].z, Config.Bitch[i].a, false, true)
  121.  
  122.  
  123. TaskPlayAnim(dmvmainped, Config.Bitch[i].lib, Config.Bitch[i].anim, 8.0, 8.0, -1,1, 0, false, false, false)
  124.  
  125.  
  126.  
  127.  
  128.  
  129. end
  130. end)
  131.  
Runtime error #stdin #stdout #stderr 0s 14104KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
lua5.3: prog.lua:20: attempt to index a nil value (global 'Citizen')
stack traceback:
	prog.lua:20: in main chunk
	[C]: in ?