17 Ekim 2018, 07:30:22

Gönderen Konu: [YARDIM] Görevdeki Araba  (Okunma sayısı 520 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Speaw

  • Yeni Üye
  • *
  • Default Avatar
  • İleti: 70
[YARDIM] Görevdeki Araba
« : 11 Haziran 2017, 17:55:46 »
Görevi alınca arabadan inmeyi nasıl engellerim inmicek arabadan ve araba hasar almıcak.
« Son Düzenleme: 11 Haziran 2017, 19:27:09 Gönderen: Narkoz »
 

MTASA-TURK | Türkiye'nin En Güncel MTA Platformu

[YARDIM] Görevdeki Araba
« : 11 Haziran 2017, 17:55:46 »

Mahlukat

  • Deneyimli Üye
  • *
  • İleti: 344
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #1 : 11 Haziran 2017, 19:54:18 »
Sanırım böyle araçtan inmesini engelleme
Kod: Lua
  1. Arac = createVehicle ( ID, x, y, z, 0, 0, r )
  2. addEventHandler ( "onVehicleStartExit", Arac, function ()
  3. cancelEvent ()
  4. end )
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
 

Speaw

  • Yeni Üye
  • *
  • Default Avatar
  • İleti: 70
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #2 : 12 Haziran 2017, 14:48:10 »
Kod: Lua
  1. addEvent("openinf_voditel", true)
  2. screenWidth, screenHeight = guiGetScreenSize()
  3. function windm ()
  4.         if not getElementData ( localPlayer, "trash_working") then
  5.                   infowind = guiCreateWindow(screenWidth - 700, screenHeight - 500, 200, 229, "Posta Teslimat Görevi", false)
  6.                   infotext = guiCreateMemo(15,20,165,150,"Posta Tesmilat Görevini Bitir Ve ₺20000 Al !",false,infowind)
  7.                   guiMemoSetReadOnly( infotext, true )
  8.                   guiSetFont(text2, "default-bold-small")
  9.                   showCursor(true)
  10.                   guiSetVisible ( infowind , true)
  11.                   guiWindowSetSizable(infowind, false)
  12.                   Button_Glose = guiCreateButton(10, 174, 90, 45, "İptal", false, infowind)
  13.                   Button_Start = guiCreateButton(100, 174, 90, 45, "Kabul", false, infowind)
  14.                   addEventHandler("onClientGUIClick", Button_Start, kit )
  15.                         addEventHandler("onClientGUIClick", Button_Glose, noshow )
  16.         else
  17.                 for i, v in ipairs ( createdPickups ) do
  18.                         if isElement ( v ) then
  19.                                 local pick2 = getElementData ( v, "pick2")
  20.                                 if isElement ( pick2 ) then
  21.                                         destroyElement ( pick2 )
  22.                                 end
  23.                                 local icon = getElementData ( v, "icon" )
  24.                                 if isElement ( icon ) then
  25.                                         destroyElement ( icon )
  26.                                 end
  27.                                 destroyElement ( v )
  28.                         end
  29.                 end
  30.                 triggerServerEvent ( "finitoWork_voditel", localPlayer )
  31.                 setElementData ( localPlayer, "trash_working", false )
  32.         end
  33. end
  34. addEventHandler("openinf_voditel", root, windm )
  35. function noshow ()
  36.  if ( source == Button_Glose ) then
  37.    destroyElement ( infowind )
  38.    showCursor ( false )
  39.  end
  40. end
  41. addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)
  42. function kit ()
  43.  if ( source == Button_Start ) then
  44.         startWorking()
  45.     destroyElement ( infowind )
  46.     showCursor ( false )
  47.   end
  48. end
  49.  
  50. addEvent ( "pay", true )
  51. function giving ()
  52.  
  53. end
  54. addEventHandler("pay", resourceRoot, giving )
  55. addEvent ( "get", true )
  56. function peremen (plr)
  57.  plr = getLocalPlayer ()
  58. end
  59. addEventHandler("get", resourceRoot, peremen )
  60.  
  61. pickupSpawns = {
  62.         { -2053,-2527,30 },
  63.                
  64. }
  65.  
  66. max_pickups_set = 12 -- como você precisa pegar para o fim dos captadores
  67.  
  68. createdPickups = {}
  69.  
  70. max_pickups = max_pickups_set
  71. if max_pickups_set > #pickupSpawns then
  72.         max_pickups = #pickupSpawns
  73. end
  74.  
  75. function startWorking ()
  76.         if not getElementData ( localPlayer, "trash_working" ) then
  77.                 createdPickups = {}
  78.                 triggerServerEvent ( "picku_voditel", localPlayer )
  79.                 setElementData ( localPlayer, "trash_working", true )
  80.                 setElementData ( localPlayer, "trash_working_hit", 0 )
  81.                         outputChatBox ( "Görevi Başarıyla Aldın ", 255, 255, 255, false )          
  82.                                
  83.                 for i, v in ipairs ( pickupSpawns ) do
  84.                         local pick = createMarker ( v[1],v[2],v[3], "checkpoint", 4.0, 255, 255, 255 )
  85.                         local pick2 = createPickup ( v[1],v[2],v[3], 3, 1314, 10000 )
  86.                         setElementData ( pick, "taken", false )
  87.                         setElementData ( pick, "pick2", pick2 )
  88.                         setElementData ( pick, "bus_pickup", true )
  89.                         setElementData ( pick, "id", s )
  90.                         if i == 1 then
  91.                                 local icon = createBlipAttachedTo ( pick, 41, 2 )
  92.                                 setElementData ( pick, "icon", icon )
  93.                         end
  94.                         table.insert (createdPickups, pick)
  95.                 end
  96.         end
  97. end    
  98.  
  99. function clientPickupHit(thePlayer, matchingDimension)
  100.         if thePlayer == localPlayer and getElementData ( source, "bus_pickup" ) and not getElementData ( source, "taken" ) then
  101.                 setElementData ( source, "taken", true )
  102.                 outputChatBox ( "Tebrikler Görevi Bitirdin Ve ₺20000 Aldın ", 255, 100, 100, true )
  103.                 triggerServerEvent ( "giveMoneyFromClient_voditel", localPlayer, 20000 )
  104.                 local hitted = getElementData ( localPlayer, "trash_working_hit" ) or 0
  105.                 hitted = hitted+1
  106.                 triggerServerEvent ( "experience", localPlayer, 20 )
  107.                 local pick2 = getElementData ( source, "pick2" )
  108.                 if isElement ( pick2 ) then
  109.                         destroyElement ( pick2 )
  110.                 end
  111.                 local icon = getElementData ( source, "icon" )
  112.                 if isElement ( icon ) then
  113.                         destroyElement ( icon )
  114.                 end
  115.                 local icon = getElementData ( source, "icon" )
  116.                 if isElement ( icon ) then
  117.                         destroyElement ( icon )
  118.                 end
  119.                 destroyElement(source)
  120.                 setElementData ( localPlayer, "trash_working_hit", hitted)
  121.                 if hitted >= max_pickups then
  122.                         for i, v in ipairs ( createdPickups ) do
  123.                                 if isElement ( v ) then
  124.                                         local pick2 = getElementData ( v, "pick2")
  125.                                         if isElement ( pick2 ) then
  126.                                                 destroyElement ( pick2 )
  127.                                         end
  128.                                         local icon = getElementData ( v, "icon" )
  129.                                         if isElement ( icon ) then
  130.                                                 destroyElement ( icon )
  131.                                         end
  132.                                         destroyElement ( v )
  133.                                 end
  134.                         end
  135.                         setElementData ( localPlayer, "trash_working", false )
  136.                         triggerServerEvent ( "finitoWork_voditel", localPlayer )
  137.                         return true
  138.                 end
  139.                 if createdPickups[hitted+1] then
  140.                         local icon = createBlipAttachedTo ( createdPickups[hitted+1], 41, 2 )
  141.                         setElementData ( createdPickups[hitted+1], "icon", icon )
  142.                 end
  143.         end
  144. end
  145. addEventHandler ( "onClientMarkerHit", getRootElement(), clientPickupHit )
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  

Görev sc si bu ben kodu yerleştiremedim birde arabanın hasar almasını patlamasını nasıl engellerim o koduda yerleştirirmisiniz
 

Mahlukat

  • Deneyimli Üye
  • *
  • İleti: 344
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #3 : 12 Haziran 2017, 15:03:28 »
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
Görev sc si bu ben kodu yerleştiremedim birde arabanın hasar almasını patlamasını nasıl engellerim o koduda yerleştirirmisiniz
server.lua atarmısın lütfen :c
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
 

Speaw

  • Yeni Üye
  • *
  • Default Avatar
  • İleti: 70
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #4 : 12 Haziran 2017, 15:26:51 »
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
server.lua atarmısın lütfen :c
Kod: Lua
  1. jobm = createMarker ( -1978,106,28 - 1.1, "cylinder", 1.5, 255, 0, 0, 170 )
  2. myBlip = createBlipAttachedTo ( jobm, 56 )
  3.  
  4. give_skin = 255 -- скин, который выдается водиле
  5. function enter (element)
  6.         if getElementType ( element ) == "player" then
  7.                         triggerClientEvent ( element, "openinf_voditel", element)
  8.         end
  9. end
  10. addEventHandler( "onMarkerHit", jobm, enter )
  11. addEvent ( "picku_voditel", true )
  12.  
  13. function create ()
  14.    local jobvehicle = createVehicle ( 459, -1990, 102, 27 )
  15.         warpPedIntoVehicle ( source, jobvehicle )
  16.         setElementData ( source, "working_veh", jobvehicle )
  17.         setElementModel ( source, give_skin)
  18.                 setElementData(source,"Mta",true)
  19. end
  20. addEventHandler ( "picku_voditel", root, create )
  21.  
  22. addEvent ( "finitoWork_voditel", true )
  23.  
  24. function finitoWorkS ()
  25.         local veh = getElementData ( source, "working_veh" )
  26.         if isElement ( veh ) then
  27.                 destroyElement ( veh )
  28.                 setElementData ( source, "working_veh", false )
  29.                                 removeElementData(source,"Mta",true )
  30.         end
  31. end
  32. addEventHandler ( "finitoWork_voditel", root, finitoWorkS )
  33.  
  34. addEvent ( "giveMoneyFromClient_voditel", true )
  35.  
  36. function giveMoneyFromClientS (amount)
  37.     givePlayerMoney ( source, amount )
  38. end
  39. addEventHandler ( "giveMoneyFromClient_voditel", root, giveMoneyFromClientS )
 

Mahlukat

  • Deneyimli Üye
  • *
  • İleti: 344
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #5 : 12 Haziran 2017, 16:25:44 »
client.lua
Kod: Lua
  1. addEvent("openinf_voditel", true)
  2. screenWidth, screenHeight = guiGetScreenSize()
  3. function windm ()
  4.         if not getElementData ( localPlayer, "trash_working") then
  5.                   infowind = guiCreateWindow(screenWidth - 700, screenHeight - 500, 200, 229, "Posta Teslimat Görevi", false)
  6.                   infotext = guiCreateMemo(15,20,165,150,"Posta Tesmilat Görevini Bitir Ve ?20000 Al !",false,infowind)
  7.                   guiMemoSetReadOnly( infotext, true )
  8.                   guiSetFont(text2, "default-bold-small")
  9.                   showCursor(true)
  10.                   guiSetVisible ( infowind , true)
  11.                   guiWindowSetSizable(infowind, false)
  12.                   Button_Glose = guiCreateButton(10, 174, 90, 45, "İptal", false, infowind)
  13.                   Button_Start = guiCreateButton(100, 174, 90, 45, "Kabul", false, infowind)
  14.                   addEventHandler("onClientGUIClick", Button_Start, kit )
  15.                         addEventHandler("onClientGUIClick", Button_Glose, noshow )
  16.         else
  17.                 for i, v in ipairs ( createdPickups ) do
  18.                         if isElement ( v ) then
  19.                                 local pick2 = getElementData ( v, "pick2")
  20.                                 if isElement ( pick2 ) then
  21.                                         destroyElement ( pick2 )
  22.                                 end
  23.                                 local icon = getElementData ( v, "icon" )
  24.                                 if isElement ( icon ) then
  25.                                         destroyElement ( icon )
  26.                                 end
  27.                                 destroyElement ( v )
  28.                         end
  29.                 end
  30.                 triggerServerEvent ( "finitoWork_voditel", localPlayer )
  31.                 setElementData ( localPlayer, "trash_working", false )
  32.         end
  33. end
  34. addEventHandler("openinf_voditel", root, windm )
  35. function noshow ()
  36.  if ( source == Button_Glose ) then
  37.    destroyElement ( infowind )
  38.    showCursor ( false )
  39.  end
  40. end
  41. --addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)
  42. function kit ()
  43.  if ( source == Button_Start ) then
  44.         startWorking()
  45.     destroyElement ( infowind )
  46.     showCursor ( false )
  47.   end
  48. end
  49.  
  50. addEvent ( "pay", true )
  51. function giving ()
  52.  
  53. end
  54. addEventHandler("pay", resourceRoot, giving )
  55. addEvent ( "get", true )
  56. function peremen (plr)
  57.  plr = getLocalPlayer ()
  58. end
  59. addEventHandler("get", resourceRoot, peremen )
  60.  
  61. pickupSpawns = {
  62.         { -2053,-2527,30 },
  63.                
  64. }
  65.  
  66. max_pickups_set = 12 -- como você precisa pegar para o fim dos captadores
  67.  
  68. createdPickups = {}
  69.  
  70. max_pickups = max_pickups_set
  71. if max_pickups_set > #pickupSpawns then
  72.         max_pickups = #pickupSpawns
  73. end
  74.  
  75. function startWorking ()
  76.         if not getElementData ( localPlayer, "trash_working" ) then
  77.                 createdPickups = {}
  78.                 triggerServerEvent ( "picku_voditel", localPlayer )
  79.                 setElementData ( localPlayer, "trash_working", true )
  80.                 setElementData ( localPlayer, "trash_working_hit", 0 )
  81.                         outputChatBox ( "Görevi Başarıyla Aldın ", 255, 255, 255, false )          
  82.                                
  83.                 for i, v in ipairs ( pickupSpawns ) do
  84.                         local pick = createMarker ( v[1],v[2],v[3], "checkpoint", 4.0, 255, 255, 255 )
  85.                         local pick2 = createPickup ( v[1],v[2],v[3], 3, 1314, 10000 )
  86.                         setElementData ( pick, "taken", false )
  87.                         setElementData ( pick, "pick2", pick2 )
  88.                         setElementData ( pick, "bus_pickup", true )
  89.                         setElementData ( pick, "id", s )
  90.                         if i == 1 then
  91.                                 local icon = createBlipAttachedTo ( pick, 41, 2 )
  92.                                 setElementData ( pick, "icon", icon )
  93.                         end
  94.                         table.insert (createdPickups, pick)
  95.                 end
  96.         end
  97. end    
  98.  
  99. function clientPickupHit(thePlayer, matchingDimension)
  100.         if thePlayer == localPlayer and getElementData ( source, "bus_pickup" ) and not getElementData ( source, "taken" ) then
  101.                 setElementData ( source, "taken", true )
  102.                 outputChatBox ( "Tebrikler Görevi Bitirdin Ve ?20000 Aldın ", 255, 100, 100, true )
  103.                 triggerServerEvent ( "giveMoneyFromClient_voditel", localPlayer, 20000 )
  104.                 local hitted = getElementData ( localPlayer, "trash_working_hit" ) or 0
  105.                 hitted = hitted+1
  106.                 triggerServerEvent ( "experience", localPlayer, 20 )
  107.                 local pick2 = getElementData ( source, "pick2" )
  108.                 if isElement ( pick2 ) then
  109.                         destroyElement ( pick2 )
  110.                 end
  111.                 local icon = getElementData ( source, "icon" )
  112.                 if isElement ( icon ) then
  113.                         destroyElement ( icon )
  114.                 end
  115.                 local icon = getElementData ( source, "icon" )
  116.                 if isElement ( icon ) then
  117.                         destroyElement ( icon )
  118.                 end
  119.                 destroyElement(source)
  120.                 setElementData ( localPlayer, "trash_working_hit", hitted)
  121.                 if hitted >= max_pickups then
  122.                         for i, v in ipairs ( createdPickups ) do
  123.                                 if isElement ( v ) then
  124.                                         local pick2 = getElementData ( v, "pick2")
  125.                                         if isElement ( pick2 ) then
  126.                                                 destroyElement ( pick2 )
  127.                                         end
  128.                                         local icon = getElementData ( v, "icon" )
  129.                                         if isElement ( icon ) then
  130.                                                 destroyElement ( icon )
  131.                                         end
  132.                                         destroyElement ( v )
  133.                                 end
  134.                         end
  135.                         setElementData ( localPlayer, "trash_working", false )
  136.                         triggerServerEvent ( "finitoWork_voditel", localPlayer )
  137.                         return true
  138.                 end
  139.                 if createdPickups[hitted+1] then
  140.                         local icon = createBlipAttachedTo ( createdPickups[hitted+1], 41, 2 )
  141.                         setElementData ( createdPickups[hitted+1], "icon", icon )
  142.                 end
  143.         end
  144. end
  145. addEventHandler ( "onClientMarkerHit", getRootElement(), clientPickupHit )
  146.  
  147.  
  148. addEvent ( "HayaletArac", true )
  149. addEventHandler ( "HayaletArac", root, function (x )
  150.     for i,v in ipairs(getElementsByType("vehicle")) do
  151.         setElementCollidableWith(v, getPedOccupiedVehicle(getLocalPlayer()), false)
  152.     end
  153. end )
server.lua
Kod: Lua
  1. jobm = createMarker ( -1978,106,28 - 1.1, "cylinder", 1.5, 255, 0, 0, 170 )
  2. myBlip = createBlipAttachedTo ( jobm, 56 )
  3.  
  4. give_skin = 255 -- скин, который выдается водиле
  5. function enter (element)
  6.         if getElementType ( element ) == "player" then
  7.                         triggerClientEvent ( element, "openinf_voditel", element)
  8.         end
  9. end
  10. addEventHandler( "onMarkerHit", jobm, enter )
  11. addEvent ( "picku_voditel", true )
  12.  
  13.  
  14. function cancel ()
  15. cancelEvent ()
  16. end
  17.  
  18. function create ()
  19.    local jobvehicle = createVehicle ( 459, -1990, 102, 27 )
  20.         warpPedIntoVehicle ( source, jobvehicle )
  21.                 addEventHandler ( "onVehicleStartExit", jobvehicle, cancel )
  22.                 triggerClientEvent ( root, "HayaletArac", root, jobvehicle )
  23.         setElementData ( source, "working_veh", jobvehicle )
  24.         setElementModel ( source, give_skin)
  25.         setElementData(source,"Mta",true)
  26. end
  27. addEventHandler ( "picku_voditel", root, create )
  28.  
  29.  
  30. addEvent ( "finitoWork_voditel", true )
  31. function finitoWorkS ()
  32.         local veh = getElementData ( source, "working_veh" )
  33.         if isElement ( veh ) then
  34.                 destroyElement ( veh )
  35.                 setElementData ( source, "working_veh", false )
  36.                 removeElementData(source,"Mta",true )
  37.         end
  38. end
  39. addEventHandler ( "finitoWork_voditel", root, finitoWorkS )
  40.  
  41. addEvent ( "giveMoneyFromClient_voditel", true )
  42.  
  43. function giveMoneyFromClientS (amount)
  44.     givePlayerMoney ( source, amount )
  45. end
  46. addEventHandler ( "giveMoneyFromClient_voditel", root, giveMoneyFromClientS )
Araç bir yere çarptığı zaman hasar alıyor fakat başka birisi hasar veremiyor araca  :P
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
 

MTASA-TURK | Türkiye'nin En Güncel MTA Platformu

Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #5 : 12 Haziran 2017, 16:25:44 »

Speaw

  • Yeni Üye
  • *
  • Default Avatar
  • İleti: 70
Ynt: [YARDIM] Görevdeki Araba
« Yanıtla #6 : 12 Haziran 2017, 20:00:02 »
Linkleri Görebilmek İçin Kayıt Olun veya Giriş Yapın
client.lua
Kod: Lua
  1. addEvent("openinf_voditel", true)
  2. screenWidth, screenHeight = guiGetScreenSize()
  3. function windm ()
  4.         if not getElementData ( localPlayer, "trash_working") then
  5.                   infowind = guiCreateWindow(screenWidth - 700, screenHeight - 500, 200, 229, "Posta Teslimat Görevi", false)
  6.                   infotext = guiCreateMemo(15,20,165,150,"Posta Tesmilat Görevini Bitir Ve ?20000 Al !",false,infowind)
  7.                   guiMemoSetReadOnly( infotext, true )
  8.                   guiSetFont(text2, "default-bold-small")
  9.                   showCursor(true)
  10.                   guiSetVisible ( infowind , true)
  11.                   guiWindowSetSizable(infowind, false)
  12.                   Button_Glose = guiCreateButton(10, 174, 90, 45, "İptal", false, infowind)
  13.                   Button_Start = guiCreateButton(100, 174, 90, 45, "Kabul", false, infowind)
  14.                   addEventHandler("onClientGUIClick", Button_Start, kit )
  15.                         addEventHandler("onClientGUIClick", Button_Glose, noshow )
  16.         else
  17.                 for i, v in ipairs ( createdPickups ) do
  18.                         if isElement ( v ) then
  19.                                 local pick2 = getElementData ( v, "pick2")
  20.                                 if isElement ( pick2 ) then
  21.                                         destroyElement ( pick2 )
  22.                                 end
  23.                                 local icon = getElementData ( v, "icon" )
  24.                                 if isElement ( icon ) then
  25.                                         destroyElement ( icon )
  26.                                 end
  27.                                 destroyElement ( v )
  28.                         end
  29.                 end
  30.                 triggerServerEvent ( "finitoWork_voditel", localPlayer )
  31.                 setElementData ( localPlayer, "trash_working", false )
  32.         end
  33. end
  34. addEventHandler("openinf_voditel", root, windm )
  35. function noshow ()
  36.  if ( source == Button_Glose ) then
  37.    destroyElement ( infowind )
  38.    showCursor ( false )
  39.  end
  40. end
  41. --addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)
  42. function kit ()
  43.  if ( source == Button_Start ) then
  44.         startWorking()
  45.     destroyElement ( infowind )
  46.     showCursor ( false )
  47.   end
  48. end
  49.  
  50. addEvent ( "pay", true )
  51. function giving ()
  52.  
  53. end
  54. addEventHandler("pay", resourceRoot, giving )
  55. addEvent ( "get", true )
  56. function peremen (plr)
  57.  plr = getLocalPlayer ()
  58. end
  59. addEventHandler("get", resourceRoot, peremen )
  60.  
  61. pickupSpawns = {
  62.         { -2053,-2527,30 },
  63.                
  64. }
  65.  
  66. max_pickups_set = 12 -- como você precisa pegar para o fim dos captadores
  67.  
  68. createdPickups = {}
  69.  
  70. max_pickups = max_pickups_set
  71. if max_pickups_set > #pickupSpawns then
  72.         max_pickups = #pickupSpawns
  73. end
  74.  
  75. function startWorking ()
  76.         if not getElementData ( localPlayer, "trash_working" ) then
  77.                 createdPickups = {}
  78.                 triggerServerEvent ( "picku_voditel", localPlayer )
  79.                 setElementData ( localPlayer, "trash_working", true )
  80.                 setElementData ( localPlayer, "trash_working_hit", 0 )
  81.                         outputChatBox ( "Görevi Başarıyla Aldın ", 255, 255, 255, false )          
  82.                                
  83.                 for i, v in ipairs ( pickupSpawns ) do
  84.                         local pick = createMarker ( v[1],v[2],v[3], "checkpoint", 4.0, 255, 255, 255 )
  85.                         local pick2 = createPickup ( v[1],v[2],v[3], 3, 1314, 10000 )
  86.                         setElementData ( pick, "taken", false )
  87.                         setElementData ( pick, "pick2", pick2 )
  88.                         setElementData ( pick, "bus_pickup", true )
  89.                         setElementData ( pick, "id", s )
  90.                         if i == 1 then
  91.                                 local icon = createBlipAttachedTo ( pick, 41, 2 )
  92.                                 setElementData ( pick, "icon", icon )
  93.                         end
  94.                         table.insert (createdPickups, pick)
  95.                 end
  96.         end
  97. end    
  98.  
  99. function clientPickupHit(thePlayer, matchingDimension)
  100.         if thePlayer == localPlayer and getElementData ( source, "bus_pickup" ) and not getElementData ( source, "taken" ) then
  101.                 setElementData ( source, "taken", true )
  102.                 outputChatBox ( "Tebrikler Görevi Bitirdin Ve ?20000 Aldın ", 255, 100, 100, true )
  103.                 triggerServerEvent ( "giveMoneyFromClient_voditel", localPlayer, 20000 )
  104.                 local hitted = getElementData ( localPlayer, "trash_working_hit" ) or 0
  105.                 hitted = hitted+1
  106.                 triggerServerEvent ( "experience", localPlayer, 20 )
  107.                 local pick2 = getElementData ( source, "pick2" )
  108.                 if isElement ( pick2 ) then
  109.                         destroyElement ( pick2 )
  110.                 end
  111.                 local icon = getElementData ( source, "icon" )
  112.                 if isElement ( icon ) then
  113.                         destroyElement ( icon )
  114.                 end
  115.                 local icon = getElementData ( source, "icon" )
  116.                 if isElement ( icon ) then
  117.                         destroyElement ( icon )
  118.                 end
  119.                 destroyElement(source)
  120.                 setElementData ( localPlayer, "trash_working_hit", hitted)
  121.                 if hitted >= max_pickups then
  122.                         for i, v in ipairs ( createdPickups ) do
  123.                                 if isElement ( v ) then
  124.                                         local pick2 = getElementData ( v, "pick2")
  125.                                         if isElement ( pick2 ) then
  126.                                                 destroyElement ( pick2 )
  127.                                         end
  128.                                         local icon = getElementData ( v, "icon" )
  129.                                         if isElement ( icon ) then
  130.                                                 destroyElement ( icon )
  131.                                         end
  132.                                         destroyElement ( v )
  133.                                 end
  134.                         end
  135.                         setElementData ( localPlayer, "trash_working", false )
  136.                         triggerServerEvent ( "finitoWork_voditel", localPlayer )
  137.                         return true
  138.                 end
  139.                 if createdPickups[hitted+1] then
  140.                         local icon = createBlipAttachedTo ( createdPickups[hitted+1], 41, 2 )
  141.                         setElementData ( createdPickups[hitted+1], "icon", icon )
  142.                 end
  143.         end
  144. end
  145. addEventHandler ( "onClientMarkerHit", getRootElement(), clientPickupHit )
  146.  
  147.  
  148. addEvent ( "HayaletArac", true )
  149. addEventHandler ( "HayaletArac", root, function (x )
  150.     for i,v in ipairs(getElementsByType("vehicle")) do
  151.         setElementCollidableWith(v, getPedOccupiedVehicle(getLocalPlayer()), false)
  152.     end
  153. end )
server.lua
Kod: Lua
  1. jobm = createMarker ( -1978,106,28 - 1.1, "cylinder", 1.5, 255, 0, 0, 170 )
  2. myBlip = createBlipAttachedTo ( jobm, 56 )
  3.  
  4. give_skin = 255 -- скин, который выдается водиле
  5. function enter (element)
  6.         if getElementType ( element ) == "player" then
  7.                         triggerClientEvent ( element, "openinf_voditel", element)
  8.         end
  9. end
  10. addEventHandler( "onMarkerHit", jobm, enter )
  11. addEvent ( "picku_voditel", true )
  12.  
  13.  
  14. function cancel ()
  15. cancelEvent ()
  16. end
  17.  
  18. function create ()
  19.    local jobvehicle = createVehicle ( 459, -1990, 102, 27 )
  20.         warpPedIntoVehicle ( source, jobvehicle )
  21.                 addEventHandler ( "onVehicleStartExit", jobvehicle, cancel )
  22.                 triggerClientEvent ( root, "HayaletArac", root, jobvehicle )
  23.         setElementData ( source, "working_veh", jobvehicle )
  24.         setElementModel ( source, give_skin)
  25.         setElementData(source,"Mta",true)
  26. end
  27. addEventHandler ( "picku_voditel", root, create )
  28.  
  29.  
  30. addEvent ( "finitoWork_voditel", true )
  31. function finitoWorkS ()
  32.         local veh = getElementData ( source, "working_veh" )
  33.         if isElement ( veh ) then
  34.                 destroyElement ( veh )
  35.                 setElementData ( source, "working_veh", false )
  36.                 removeElementData(source,"Mta",true )
  37.         end
  38. end
  39. addEventHandler ( "finitoWork_voditel", root, finitoWorkS )
  40.  
  41. addEvent ( "giveMoneyFromClient_voditel", true )
  42.  
  43. function giveMoneyFromClientS (amount)
  44.     givePlayerMoney ( source, amount )
  45. end
  46. addEventHandler ( "giveMoneyFromClient_voditel", root, giveMoneyFromClientS )
Araç bir yere çarptığı zaman hasar alıyor fakat başka birisi hasar veremiyor araca  :P
Çok teşekkürler