Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. local tamirKordinat1 = createColSphere (2064.0107421875, -1831.5400390625, 13.546875, 4)
  2. local tamirKordinat2 = createColSphere (1911.21484375, -1776.421875, 13.40468788147, 4)
  3. local tamirKordinat3 = createColSphere (1017.654296875, -917.7080078125, 42.1796875, 3)
  4. armoredCars = { [427]=true, [528]=true, [432]=true, [601]=true, [428]=true } -- Enforcer, FBI Truck, Rhino, SWAT Tank, Securicar
  5.  
  6.  
  7. function tamirColShape(thePlayer, seat)
  8. if isElementWithinColShape(thePlayer, tamirKordinat1) or isElementWithinColShape(thePlayer, tamirKordinat2) or isElementWithinColShape(thePlayer, tamirKordinat3) then
  9. if getPedOccupiedVehicle(thePlayer) or seat == 0 then
  10. local para = exports.global:getMoney(thePlayer)
  11. local theVeh = getPedOccupiedVehicle(thePlayer)
  12. if getElementData(theVeh, "engine") == 0 then
  13. if getElementData(thePlayer, "vipver") == 3 then
  14.  
  15. setElementFrozen(theVeh, true)
  16. setVehicleLocked(theVeh, true)
  17. toggleAllControls(thePlayer, false, true, false)
  18. setElementData(thePlayer, "tamirKilit", 1)
  19. outputChatBox("[!] #ffffffAracınız tamir ediliyor, lütfen bekleyin (10sn).", thePlayer, 0, 0, 255, true)
  20. setTimer(
  21. function()
  22. outputChatBox("[!] #ffffffAracınız VIP 3 olduğunuz için ücretsiz tamir edilmiştir.", thePlayer, 0, 255, 0, true)
  23. setElementFrozen(theVeh, false)
  24. setVehicleLocked(theVeh, false)
  25. toggleAllControls(thePlayer, true)
  26. setElementData(thePlayer, "tamirKilit", 0)
  27. fixVehicle(theVeh)
  28. for i = 0, 5 do
  29. setVehicleDoorState(theVeh, i, 0)
  30. end
  31. setElementHealth(theVeh, 1000)
  32.  
  33. if armoredCars[ getElementModel( theVeh ) ] then
  34. setVehicleDamageProof(theVeh, true)
  35. else
  36. setVehicleDamageProof(theVeh, false)
  37. end
  38. if (getElementData(theVeh, "Impounded") == 0) then
  39. exports.anticheat:changeProtectedElementDataEx(theVeh, "enginebroke", 0, false)
  40. end
  41. end
  42. , 10000, 1)
  43. else
  44. --[[local toplamHasar = getElementHealth(theVeh)
  45. if toplamHasar == 1000 then
  46. outputChatBox("[!] #ffffffAracınızda hasar bulunmamaktadır.", thePlayer, 0, 0, 255, true)
  47. return
  48. end]]--
  49.  
  50.  
  51. local toplamHasar = (1000 - getElementHealth(theVeh)) * 4
  52. if para >= toplamHasar then
  53. if getElementHealth(theVeh) == 1000 then
  54. outputChatBox("[!] #ffffffAracınızda hasar bulunmamaktadır.", thePlayer, 0, 0, 255, true)
  55. return
  56. end
  57. exports.global:takeMoney(thePlayer, toplamHasar)
  58.  
  59. setElementFrozen(theVeh, true)
  60. setVehicleLocked(theVeh, true)
  61. toggleAllControls(thePlayer, false, true, false)
  62. setElementData(thePlayer, "tamirKilit", 1)
  63. outputChatBox("[!] #ffffffAracınız tamir ediliyor, lütfen bekleyin (10sn).", thePlayer, 0, 0, 255, true)
  64. outputChatBox("[!] #ffffffTamir masrafınız: ".. toplamHasar .."$", thePlayer, 0, 0, 255, true)
  65. setTimer(
  66. function()
  67. outputChatBox("[!] #ffffffAracınız başarıyla tamir edilmiştir.", thePlayer, 0, 255, 0, true)
  68. setElementFrozen(theVeh, false)
  69. setVehicleLocked(theVeh, false)
  70. toggleAllControls(thePlayer, true)
  71. setElementData(thePlayer, "tamirKilit", 0)
  72. fixVehicle(theVeh)
  73. for i = 0, 5 do
  74. setVehicleDoorState(theVeh, i, 0)
  75. end
  76. setElementHealth(theVeh, 1000)
  77.  
  78. if armoredCars[ getElementModel( theVeh ) ] then
  79. setVehicleDamageProof(theVeh, true)
  80. else
  81. setVehicleDamageProof(theVeh, false)
  82. end
  83. if (getElementData(theVeh, "Impounded") == 0) then
  84. exports.anticheat:changeProtectedElementDataEx(theVeh, "enginebroke", 0, false)
  85. end
  86. end
  87. , 10000, 1)
  88. else
  89. outputChatBox("[!] #ffffffBu işlemi yapabilmek için 1000$'a ihtiyacın var.", thePlayer, 255, 0, 0, true)
  90. end
  91. end
  92. else
  93. outputChatBox("[!] #ffffffBu işlemi yapabilmek için aracınızın motoru kapalı olmalıdır.", thePlayer, 255, 0, 0, true)
  94. end
  95. else
  96. outputChatBox("[!] #ffffffAracın içinde ve şoför koltuğunda olmalısınız.", thePlayer, 255, 0, 0, true)
  97. end
  98. end
  99. end
  100. addCommandHandler("tamir", tamirColShape)
  101.  
  102. --------------------------------------------------------------------------------------------------------------------------------------------------
  103.  
  104. function findProperty(thePlayer, dimension)
  105. local dbid = dimension or (thePlayer and getElementDimension( thePlayer ) or 0)
  106. if dbid and tonumber(dbid) and tonumber(dbid) > 0 then
  107. dbid = tonumber(dbid)
  108. local foundInterior = exports.pool:getElement("interior", dbid)
  109. if foundInterior then
  110. local interiorEntrance = getElementData(foundInterior, "entrance")
  111. local interiorExit = getElementData(foundInterior, "exit")
  112. local interiorStatus = getElementData(foundInterior, "status")
  113. return dbid, interiorEntrance, interiorExit, interiorStatus[INTERIOR_TYPE], foundInterior
  114. end
  115. end
  116. return 0
  117. end
  118.  
  119. local tamirhaneKordinat1 = createColSphere (538.12890625, 87.5283203125, 1044.474609375, 3)
  120. local mysql = exports.mysql
  121.  
  122. function tamirColShape(thePlayer, seat)
  123. if isElementWithinColShape(thePlayer, tamirhaneKordinat1) then
  124. if getPedOccupiedVehicle(thePlayer) or seat == 0 then
  125. local para = exports.global:getMoney(thePlayer)
  126. local theVeh = getPedOccupiedVehicle(thePlayer)
  127. if getElementData(theVeh, "engine") == 0 then
  128. if para >= 50 then
  129. if getElementData(thePlayer, "tamirci") == 1 then
  130. if getElementData(thePlayer, "tamirciMeslek") == 1 then
  131. setElementFrozen(theVeh, true)
  132. setVehicleLocked(theVeh, true)
  133. toggleAllControls(thePlayer, false, true, false)
  134. setElementData(thePlayer, "tamirKilit", 1)
  135. setVehicleDamageProof(theVeh, false)
  136. outputChatBox("[!] #ffffffAracınız tamir ediliyor, lütfen bekleyin (10sn).", thePlayer, 0, 0, 255, true)
  137. setTimer(
  138. function()
  139. exports.global:takeMoney(thePlayer, 50)
  140. outputChatBox("[!] #ffffffAracınız başarıyla tamir edilmiştir.", thePlayer, 0, 255, 0, true)
  141. setElementFrozen(theVeh, false)
  142. setVehicleLocked(theVeh, false)
  143. toggleAllControls(thePlayer, true)
  144. setElementData(thePlayer, "tamirKilit", 0)
  145. --setVehicleDamageProof(theVeh, false)
  146. local success = setVehicleDamageProof(theVeh, false)
  147. if success then
  148. outputChatBox("kod çalışıyor", thePlayer)
  149. end
  150. fixVehicle(theVeh)
  151. exports.anticheat:changeProtectedElementDataEx(theVeh, "enginebroke", 0, false)
  152. for i = 0, 5 do
  153. setVehicleDoorState(theVeh, i, 0)
  154. end
  155. end
  156. , 10000, 1)
  157. else
  158. outputChatBox("[!] #ffffffTamirci mesleğinde iş başı yapmamışsınız.", thePlayer, 255, 0, 0, true)
  159. end
  160. else
  161. outputChatBox("[!] #ffffffTamirci değilsiniz.", thePlayer, 255, 0, 0, true)
  162. end
  163. else
  164. outputChatBox("[!] #ffffffBu işlemi yapabilmek için 100$'a ihtiyacın var.", thePlayer, 255, 0, 0, true)
  165. end
  166. else
  167. outputChatBox("[!] #ffffffBu işlemi yapabilmek için aracınızın motoru kapalı olmalıdır.", thePlayer, 255, 0, 0, true)
  168. end
  169. else
  170. outputChatBox("[!] #ffffffAracın içinde ve şoför koltuğunda olmalısınız.", thePlayer, 255, 0, 0, true)
  171. end
  172. end
  173. end
  174. addCommandHandler("tamir", tamirColShape)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement