Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.38 KB | None | 0 0
  1. function pickup ()
  2.  
  3. objects = {                                  
  4.  
  5. {2244.84790, -1664.08313, 15.47656},
  6. } --
  7.  
  8.  
  9. for i, pos in ipairs(objects) do
  10. local ob = createObject(1210, unpack(objects[i]))
  11. setObjectScale(ob, 2)
  12. setElementCollisionsEnabled(ob, false)
  13. local x, y, z = getElementPosition(ob)
  14. setTimer(moveObject, 2000, 0, ob, 2000, x, y, z, 0, 0, 360)
  15. end
  16.  
  17. local levelnecessario = 12
  18.  
  19. colcorreio = createColSphere(2244.84790, -1664.08313, 15.47656, 1)
  20. end
  21. addEventHandler("onResourceStart", resourceRoot, pickup)
  22.  
  23. local MarkTrabLixo = createMarker(2244.68750, -1664.47791, 15, "cylinder", 1.2, 0, 0, 0, 0)
  24.  
  25. local blipLixos = createBlip (2244.68750, -1664.47791, 15.47656,42)
  26. setBlipVisibleDistance(blipLixos, 99999)
  27.  
  28.  
  29. local MarkFimLixo = createMarker(2078.0749511719,-1729.763671875,13.420462608337-1, "cylinder", 5, 255, 255, 0, 155)
  30. local blipFimLixo = createBlip (2078.0749511719,-1729.763671875,13.420462608337, 41)
  31.  
  32. local MarkFimLixo2 = createMarker(1911.1558837891,-1609.5885009766,13.4184865951541-1, "cylinder", 5, 255, 255, 0, 155)
  33. local blipFimLixo2 = createBlip (1911.1558837891,-1609.5885009766,13.418486595154, 41)
  34.  
  35. local MarkFimLixo3 = createMarker(1457.5473632813,-1361.5632324219,13.418420791626, "cylinder", 5, 255, 255, 0, 155)
  36. local blipFimLixo3 = createBlip (1457.5473632813,-1361.5632324219,13.418420791626, 41)
  37.  
  38. local MarkFimLixo4 = createMarker(1632.3642578125,-1164.0872802734,23.930870056152-1, "cylinder", 5, 255, 255, 0, 155)
  39. local blipFimLixo4 = createBlip (1632.3642578125,-1164.0872802734,23.930870056152, 41)
  40.  
  41. local MarkFimLixo5 = createMarker(1934.3735351563,-1131.5266113281,25.210243225098-1, "cylinder", 5, 255, 255, 0, 155)
  42. local blipFimLixo5 = createBlip (1934.3735351563,-1131.5266113281,25.210243225098, 41)
  43.  
  44. local MarkFimLixo6 = createMarker(2133.4956054688,-1431.3592529297,23.86385345459-1, "cylinder", 5, 255, 255, 0, 155)
  45. local blipFimLixo6 = createBlip (2133.4956054688,-1431.3592529297,23.86385345459, 41)
  46.  
  47.  
  48. setElementVisibleTo ( MarkFimLixo, root, false )
  49. setElementVisibleTo ( blipFimLixo, root, false )
  50. setElementVisibleTo ( MarkFimLixo2, root, false )
  51. setElementVisibleTo ( blipFimLixo2, root, false )
  52. setElementVisibleTo ( MarkFimLixo3, root, false )
  53. setElementVisibleTo ( blipFimLixo3, root, false )
  54. setElementVisibleTo ( MarkFimLixo4, root, false )
  55. setElementVisibleTo ( blipFimLixo4, root, false )
  56. setElementVisibleTo ( MarkFimLixo5, root, false )
  57. setElementVisibleTo ( blipFimLixo5, root, false )
  58. setElementVisibleTo ( MarkFimLixo6, root, false )
  59. setElementVisibleTo ( blipFimLixo6, root, false )
  60.  
  61.  
  62.  
  63. veiculo = {}
  64.  
  65.  
  66. function TrabIniciarLixo (source)
  67.  
  68.     outputChatBox ('#ffff00[correio] #ffffffdigite /trabalhar para começar o emprego de sedex', source, 255, 255, 255, true)
  69. end
  70. addEventHandler ("onMarkerHit", MarkTrabLixo, TrabIniciarLixo)
  71.  
  72. function TrabLixo (source)
  73. local account = getAccountName (getPlayerAccount(source))
  74. local x,y,z = getElementPosition(source)
  75.  local id = getElementModel ( source )
  76.     if isElementWithinMarker (source, MarkTrabLixo ) then
  77.     if (getElementData(source, "Trab", true)) then outputChatBox ("#ffff00[correio] #ffffffVoce ja esta trabalhando", source, 255, 255, 255, true) return end
  78.     local level = getElementData(source,"Level") or 0
  79.     if level => levelnecessario then
  80. setElementData(source,"Skin",id)
  81. setElementData(source, "trab", true)
  82. setPedSkin(source, 29)
  83.      
  84.      
  85.     veiculo[source] = createVehicle (440, 2257.12769, -1666.29309, 15.46608)
  86.     setElementRotation(veiculo[source], 0,0,360)
  87.     warpPedIntoVehicle (source, veiculo[source])
  88.  
  89.     outputChatBox("#ffff00[correio] #ffffffVoce começou emprego de sedex faça as entrega nas residencia da populaçao", source, 255, 255, 255, true)
  90.     outputChatBox("#ffff00[correio] #ffffffOs locais sao as bolinha #ff0000vermelha #ffffff que apareçem no radar ou veja no f11", source, 255, 255, 255, true)
  91.  
  92.         setElementData(source, "Trab", true)
  93.         setElementVisibleTo ( MarkFimLixo, source, true )
  94.         setElementVisibleTo ( blipFimLixo, source, true )
  95.     else
  96.         outputChatBox("#ff0000[ERRO] #ffffffVocê não tem o nivel " ..levelnecessario.. " para pegar este emprego", source, 255, 255, 255, true)
  97.  
  98.     ----outputChatBox ('#000000►#FFFFFF Você tem que estar no lugar do trabalho 1 para digitar esse comando',source,255,255,255,true)
  99. end
  100. end
  101. end
  102. addCommandHandler("trabalhar", TrabLixo)
  103.  
  104.  
  105.  
  106. function Emprego ( source )
  107. if getElementData(source, "trab", true) then
  108. outputChatBox("#ffff00/trabalhar #ffffffPara trabalhar no correio", source, 255, 255, 255, true)
  109. outputChatBox("#ffff00/sairemprego #ffffffPara sair do emprego", source, 255, 255, 255, true)
  110. outputChatBox("#ffff00[correio] #fffffffaça as entregas em todos blip de bolinha vermelha ate o final", source, 255, 255, 255, true)
  111. else                     
  112.  end
  113.                   end
  114. addCommandHandler("emprego", Emprego )
  115.  
  116.  
  117. function TrabLixoChego (source)
  118.     if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  119.     outputChatBox ('#ffff00[correio] #ffffffVoce chegou na primeira entrega aguarde alguns segundos para entregar e ir para proxima residencia', source, 255, 255, 255, true)
  120.     setElementVisibleTo ( MarkFimLixo, source, false )
  121.     setElementVisibleTo ( blipFimLixo, source, false )
  122.     setElementVisibleTo ( MarkFimLixo2, source, true )
  123.     setElementVisibleTo ( blipFimLixo2, source, true )
  124.  
  125.     local vehicle = getPedOccupiedVehicle(source)
  126.     setTimer(unfreezeLixo,3000,1,source)
  127.     setElementFrozen ( vehicle, true )
  128. end
  129. end
  130. addEventHandler ("onMarkerHit", MarkFimLixo, TrabLixoChego)
  131.  
  132. function TrabLixoChego2 (source)
  133.     if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  134.     outputChatBox ('#ffff00[correio] #ffffffVoce chegou na segunda entrega aguarde alguns segundos para entregar e ir para proxima residencia', source, 255, 255, 255, true)
  135.     setElementVisibleTo ( MarkFimLixo2, source, false )
  136.     setElementVisibleTo ( blipFimLixo2, source, false )
  137.     setElementVisibleTo ( MarkFimLixo3, source, true )
  138.     setElementVisibleTo ( blipFimLixo3, source, true )
  139.     local vehicle = getPedOccupiedVehicle(source)
  140.     setTimer(unfreezeLixo,3000,1,source)
  141.     setElementFrozen ( vehicle, true )
  142. end
  143. end
  144. addEventHandler ("onMarkerHit", MarkFimLixo2, TrabLixoChego2)
  145.  
  146.            
  147. function TrabLixoChego3 (source)
  148.     if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  149.     outputChatBox ('#ffff00[correio] #ffffffVoce chegou na terceira entrega aguarde alguns segundos para entregar e ir para proxima residencia', source, 255, 255, 255, true)
  150.     setElementVisibleTo ( MarkFimLixo3, source, false )
  151.     setElementVisibleTo ( blipFimLixo3, source, false )
  152.     setElementVisibleTo ( MarkFimLixo4, source, true )
  153.     setElementVisibleTo ( blipFimLixo4, source, true )
  154.     local vehicle = getPedOccupiedVehicle(source)
  155.     setTimer(unfreezeLixo,3000,1,source)
  156.     setElementFrozen ( vehicle, true )
  157. end
  158. end
  159. addEventHandler ("onMarkerHit", MarkFimLixo3, TrabLixoChego3)
  160.  
  161.            
  162. function TrabLixoChego4 (source)
  163.     if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  164.     outputChatBox ('#ffff00[correio] #ffffffVoce chegou na quarta entrega aguarde alguns segundos para entregar e ir para proxima residencia', source, 255, 255, 255, true)
  165.     setElementVisibleTo ( MarkFimLixo4, source, false )
  166.     setElementVisibleTo ( blipFimLixo4, source, false )
  167.     setElementVisibleTo ( MarkFimLixo5, source, true )
  168.     setElementVisibleTo ( blipFimLixo5, source, true )
  169.     local vehicle = getPedOccupiedVehicle(source)
  170.     setTimer(unfreezeLixo,3000,1,source)
  171.     setElementFrozen ( vehicle, true )
  172. end
  173. end
  174. addEventHandler ("onMarkerHit", MarkFimLixo4, TrabLixoChego4)
  175.  
  176.            
  177. function TrabLixoChego5 (source)
  178.     if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  179.     outputChatBox ('#ffff00[correio] #ffffffVoce chegou na quinta entrega aguarde alguns segundos para entregar e ir para proxima residencia', source, 255, 255, 255, true)
  180.     setElementVisibleTo ( MarkFimLixo5, source, false )
  181.     setElementVisibleTo ( blipFimLixo5, source, false )
  182.     setElementVisibleTo ( MarkFimLixo6, source, true )
  183.     setElementVisibleTo ( blipFimLixo6, source, true )
  184.     local vehicle = getPedOccupiedVehicle(source)
  185.     setTimer(unfreezeLixo2,3000,1,source)
  186.     setElementFrozen ( vehicle, true )
  187. end
  188. end
  189. addEventHandler ("onMarkerHit", MarkFimLixo5, TrabLixoChego5)
  190.  
  191.            
  192. function TrabLixoChego6 (source)
  193. if veiculo[source] and isElement(veiculo[source]) and getElementData (source, "Trab", true) then
  194.     setElementData(source, "Trab", false)
  195.     givePlayerMoney (source, 1000)
  196.     outputChatBox ('#ffff00[correio] #ffffff Voce completou todas entregas e recebeu 1000$ Reais ao total', source, 255, 255, 255, true)
  197.     setElementVisibleTo ( MarkFimLixo6, source, false )
  198.     setElementVisibleTo ( blipFimLixo6, source, false )
  199.     destroyElement(veiculo[source])
  200.  
  201. end
  202. end
  203. addEventHandler ("onMarkerHit", MarkFimLixo6, TrabLixoChego6)
  204.  
  205. function unfreezeLixo(source)
  206.     local vehicle = getPedOccupiedVehicle(source)
  207.  
  208.     setElementFrozen ( vehicle, false )
  209.  
  210.     outputChatBox ('#ffff00[correio] #ffffffVoce fez a entrega continue a rota!', source, 255, 255, 255, true)
  211.  
  212. end
  213.  
  214. function unfreezeLixo2(source)
  215.     local vehicle = getPedOccupiedVehicle(source)
  216.  
  217.     setElementFrozen ( vehicle, false )
  218.  
  219.     outputChatBox ('#ffff00[correio] #ffffffVoce fez a entrega continue a rota!', source, 255, 255, 255, true)
  220.  
  221. end
  222.    
  223.  
  224. function SaiuVehLixo (source)
  225. if (veiculo[source]) and isElement(veiculo[source]) then
  226. outputChatBox ('#ffff00[correio] #FFFFFF Você desistiu do trabalho!', source, 255, 255, 255, true)
  227. setElementData(source, "Trab", false)
  228. Skin = getElementData(source,"Skin")
  229. setElementModel ( source, Skin )
  230. setElementData(source,"Skin",0)
  231. setElementVisibleTo ( MarkFimLixo, source, false )
  232. setElementVisibleTo ( blipFimLixo, source, false )
  233. setElementVisibleTo ( MarkFimLixo2, source, false )
  234. setElementVisibleTo ( blipFimLixo2, source, false )
  235. setElementVisibleTo ( MarkFimLixo3, source, false )
  236. setElementVisibleTo ( blipFimLixo3, source, false )
  237. setElementVisibleTo ( MarkFimLixo4, source, false )
  238. setElementVisibleTo ( blipFimLixo4, source, false )
  239. setElementVisibleTo ( MarkFimLixo5, source, false )
  240. setElementVisibleTo ( blipFimLixo5, source, false )
  241. setElementVisibleTo ( MarkFimLixo6, source, false )
  242. setElementVisibleTo ( blipFimLixo6, source, false )
  243. destroyElement(veiculo[source])
  244. end
  245. end
  246. addEventHandler ("onVehicleExit", root, SaiuVehLixo)
  247.  
  248. function rreemjobs (source)
  249.     local vehicle = getPedOccupiedVehicle(source)
  250.  
  251. outputChatBox ('#ffff00[correio] #FFFFFF Você desistiu do trabalho.',source,255,255,255,true)
  252. setElementData(source, "Trab", false)
  253. local Skin = getElementData(source,"Skin")
  254. setElementModel ( source, Skin )
  255. setElementData(source,"Skin",0)
  256. setElementVisibleTo ( MarkFimLixo, source, false )
  257. setElementVisibleTo ( blipFimLixo, source, false )
  258. setElementVisibleTo ( MarkFimLixo2, source, false )
  259. setElementVisibleTo ( blipFimLixo2, source, false )
  260. setElementVisibleTo ( MarkFimLixo3, source, false )
  261. setElementVisibleTo ( blipFimLixo3, source, false )
  262. setElementVisibleTo ( MarkFimLixo4, source, false )
  263. setElementVisibleTo ( blipFimLixo4, source, false )
  264. setElementVisibleTo ( MarkFimLixo5, source, false )
  265. setElementVisibleTo ( blipFimLixo5, source, false )
  266. setElementVisibleTo ( MarkFimLixo6, source, false )
  267. setElementVisibleTo ( blipFimLixo6, source, false )
  268. destroyElement(vehicle)
  269. end
  270. addCommandHandler("sairemprego",rreemjobs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement