0 Üye ve 1 Ziyaretçi konuyu incelemekte.
addEvent("openinf_voditel", true)screenWidth, screenHeight = guiGetScreenSize()function windm () if not getElementData ( localPlayer, "trash_working") then infowind = guiCreateWindow(screenWidth - 700, screenHeight - 500, 200, 229, "Silah Teslimat Görevi", false) infotext = guiCreateMemo(15,20,165,150,"Silah Tesmilat Görevini Bitir Ve ₺20000 Al !",false,infowind) guiMemoSetReadOnly( infotext, true ) guiSetFont(text2, "default-bold-small") showCursor(true) guiSetVisible ( infowind , true) guiWindowSetSizable(infowind, false) Button_Glose = guiCreateButton(10, 174, 90, 45, "İptal", false, infowind) Button_Start = guiCreateButton(100, 174, 90, 45, "Kabul", false, infowind) addEventHandler("onClientGUIClick", Button_Start, kit ) addEventHandler("onClientGUIClick", Button_Glose, noshow ) else for i, v in ipairs ( createdPickups ) do if isElement ( v ) then local pick2 = getElementData ( v, "pick2") if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( v, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement ( v ) end end triggerServerEvent ( "finitoWork_voditel", localPlayer ) setElementData ( localPlayer, "trash_working", false ) endendaddEventHandler("openinf_voditel", root, windm )function noshow () if ( source == Button_Glose ) then destroyElement ( infowind ) showCursor ( false ) endendfunction kit () if ( source == Button_Start ) then startWorking() destroyElement ( infowind ) showCursor ( false ) end endaddEvent ( "pay", true )function giving ()endaddEventHandler("pay", resourceRoot, giving )addEvent ( "get", true )function peremen (plr) plr = getLocalPlayer ()endaddEventHandler("get", resourceRoot, peremen )pickupSpawns = { { 135,1949,19 }, }max_pickups_set = 13 -- como você precisa pegar para o fim dos captadorescreatedPickups = {}max_pickups = max_pickups_setif max_pickups_set > #pickupSpawns then max_pickups = #pickupSpawnsendfunction startWorking () if not getElementData ( localPlayer, "trash_working" ) then createdPickups = {} triggerServerEvent ( "picku_voditel", localPlayer ) setElementData ( localPlayer, "trash_working", true ) setElementData ( localPlayer, "trash_working_hit", 0 ) outputChatBox ( "Görevi Başarıyla Aldın ", 255, 255, 255, false ) for i, v in ipairs ( pickupSpawns ) do local pick = createMarker ( v[1],v[2],v[3], "checkpoint", 4.0, 255, 255, 255 ) local pick2 = createPickup ( v[1],v[2],v[3], 3, 1314, 10000 ) setElementData ( pick, "taken", false ) setElementData ( pick, "pick2", pick2 ) setElementData ( pick, "bus_pickup", true ) setElementData ( pick, "id", i ) if i == 1 then local icon = createBlipAttachedTo ( pick, 41, 2 ) setElementData ( pick, "icon", icon ) end table.insert (createdPickups, pick) end endend function clientPickupHit(thePlayer, matchingDimension) if thePlayer == localPlayer and getElementData ( source, "bus_pickup" ) and not getElementData ( source, "taken" ) then setElementData ( source, "taken", true ) outputChatBox ( "Tebrikler Görevi Bitirdin Ve ₺20000 Aldın ", 255, 100, 100, true ) triggerServerEvent ( "giveMoneyFromClient_voditel", localPlayer, 20000 ) -- 50 награда local hitted = getElementData ( localPlayer, "trash_working_hit" ) or 0 hitted = hitted+1 local pick2 = getElementData ( source, "pick2" ) if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( source, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement(source) setElementData ( localPlayer, "trash_working_hit", hitted) if hitted >= max_pickups then for i, v in ipairs ( createdPickups ) do if isElement ( v ) then local pick2 = getElementData ( v, "pick2") if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( v, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement ( v ) end end setElementData ( localPlayer, "trash_working", false ) triggerServerEvent ( "finitoWork_voditel", localPlayer ) return true end if createdPickups[hitted+1] then local icon = createBlipAttachedTo ( createdPickups[hitted+1], 41, 2 ) setElementData ( createdPickups[hitted+1], "icon", icon ) end endendaddEventHandler ( "onClientMarkerHit", getRootElement(), clientPickupHit )
jobm = createMarker ( -1975,106,28 - 1.1, "cylinder", 1.5, 255, 0, 0, 170 )myBlip = createBlipAttachedTo ( jobm, 22 )give_skin = 255 -- скин, который выдается водилеfunction enter (element) if getElementType ( element ) == "player" then triggerClientEvent ( element, "openinf_voditel", element) endendaddEventHandler( "onMarkerHit", jobm, enter )addEvent ( "picku_voditel", true )function create () local jobvehicle = createVehicle ( 609, -1990, 102, 27 ) warpPedIntoVehicle ( source, jobvehicle ) setElementData ( source, "working_veh", jobvehicle ) setElementModel ( source, give_skin)endaddEventHandler ( "picku_voditel", root, create )addEvent ( "finitoWork_voditel", true )function finitoWorkS () local veh = getElementData ( source, "working_veh" ) if isElement ( veh ) then destroyElement ( veh ) setElementData ( source, "working_veh", false ) endendaddEventHandler ( "finitoWork_voditel", root, finitoWorkS )addEvent ( "giveMoneyFromClient_voditel", true )function giveMoneyFromClientS (amount) givePlayerMoney ( source, amount )endaddEventHandler ( "giveMoneyFromClient_voditel", root, giveMoneyFromClientS )
addEvent("openinf_voditel", true)screenWidth, screenHeight = guiGetScreenSize()function windm () if not getElementData ( localPlayer, "trash_working") then infowind = guiCreateWindow(screenWidth - 700, screenHeight - 500, 200, 229, "Posta Teslimat Görevi", false) infotext = guiCreateMemo(15,20,165,150,"Posta Tesmilat Görevini Bitir Ve ₺20000 Al !",false,infowind) guiMemoSetReadOnly( infotext, true ) guiSetFont(text2, "default-bold-small") showCursor(true) guiSetVisible ( infowind , true) guiWindowSetSizable(infowind, false) Button_Glose = guiCreateButton(10, 174, 90, 45, "İptal", false, infowind) Button_Start = guiCreateButton(100, 174, 90, 45, "Kabul", false, infowind) addEventHandler("onClientGUIClick", Button_Start, kit ) addEventHandler("onClientGUIClick", Button_Glose, noshow ) else for i, v in ipairs ( createdPickups ) do if isElement ( v ) then local pick2 = getElementData ( v, "pick2") if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( v, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement ( v ) end end triggerServerEvent ( "finitoWork_voditel", localPlayer ) setElementData ( localPlayer, "trash_working", false ) endendaddEventHandler("openinf_voditel", root, windm )function noshow () if ( source == Button_Glose ) then destroyElement ( infowind ) showCursor ( false ) endendfunction kit () if ( source == Button_Start ) then startWorking() destroyElement ( infowind ) showCursor ( false ) end endaddEvent ( "pay", true )function giving ()endaddEventHandler("pay", resourceRoot, giving )addEvent ( "get", true )function peremen (plr) plr = getLocalPlayer ()endaddEventHandler("get", resourceRoot, peremen )pickupSpawns = { { -2053,-2527,30 }, }max_pickups_set = 12 -- como você precisa pegar para o fim dos captadorescreatedPickups = {}max_pickups = max_pickups_setif max_pickups_set > #pickupSpawns then max_pickups = #pickupSpawnsendfunction startWorking () if not getElementData ( localPlayer, "trash_working" ) then createdPickups = {} triggerServerEvent ( "picku_voditel", localPlayer ) setElementData ( localPlayer, "trash_working", true ) setElementData ( localPlayer, "trash_working_hit", 0 ) outputChatBox ( "Görevi Başarıyla Aldın ", 255, 255, 255, false ) for i, v in ipairs ( pickupSpawns ) do local pick = createMarker ( v[1],v[2],v[3], "checkpoint", 4.0, 255, 255, 255 ) local pick2 = createPickup ( v[1],v[2],v[3], 3, 1314, 10000 ) setElementData ( pick, "taken", false ) setElementData ( pick, "pick2", pick2 ) setElementData ( pick, "bus_pickup", true ) setElementData ( pick, "id", i ) if i == 1 then local icon = createBlipAttachedTo ( pick, 41, 2 ) setElementData ( pick, "icon", icon ) end table.insert (createdPickups, pick) end endend function clientPickupHit(thePlayer, matchingDimension) if thePlayer == localPlayer and getElementData ( source, "bus_pickup" ) and not getElementData ( source, "taken" ) then setElementData ( source, "taken", true ) outputChatBox ( "Tebrikler Görevi Bitirdin Ve ₺20000 Aldın ", 255, 100, 100, true ) triggerServerEvent ( "giveMoneyFromClient_voditel", localPlayer, 20000 ) -- 50 награда local hitted = getElementData ( localPlayer, "trash_working_hit" ) or 0 hitted = hitted+1 local pick2 = getElementData ( source, "pick2" ) if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( source, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement(source) setElementData ( localPlayer, "trash_working_hit", hitted) if hitted >= max_pickups then for i, v in ipairs ( createdPickups ) do if isElement ( v ) then local pick2 = getElementData ( v, "pick2") if isElement ( pick2 ) then destroyElement ( pick2 ) end local icon = getElementData ( v, "icon" ) if isElement ( icon ) then destroyElement ( icon ) end destroyElement ( v ) end end setElementData ( localPlayer, "trash_working", false ) triggerServerEvent ( "finitoWork_voditel", localPlayer ) return true end if createdPickups[hitted+1] then local icon = createBlipAttachedTo ( createdPickups[hitted+1], 41, 2 ) setElementData ( createdPickups[hitted+1], "icon", icon ) end endendaddEventHandler ( "onClientMarkerHit", getRootElement(), clientPickupHit )
jobm = createMarker ( -1978,106,28 - 1.1, "cylinder", 1.5, 255, 0, 0, 170 )myBlip = createBlipAttachedTo ( jobm, 60 )give_skin = 255 -- скин, который выдается водилеfunction enter (element) if getElementType ( element ) == "player" then triggerClientEvent ( element, "openinf_voditel", element) endendaddEventHandler( "onMarkerHit", jobm, enter )addEvent ( "picku_voditel", true )function create () local jobvehicle = createVehicle ( 459, -1990, 102, 27 ) warpPedIntoVehicle ( source, jobvehicle ) setElementData ( source, "working_veh", jobvehicle ) setElementModel ( source, give_skin)endaddEventHandler ( "picku_voditel", root, create )addEvent ( "finitoWork_voditel", true )function finitoWorkS () local veh = getElementData ( source, "working_veh" ) if isElement ( veh ) then destroyElement ( veh ) setElementData ( source, "working_veh", false ) endendaddEventHandler ( "finitoWork_voditel", root, finitoWorkS )addEvent ( "giveMoneyFromClient_voditel", true )function giveMoneyFromClientS (amount) givePlayerMoney ( source, amount )endaddEventHandler ( "giveMoneyFromClient_voditel", root, giveMoneyFromClientS )
function vehicleExit (leaver) if source == rekka and leaver == source then addEventHandler ("onVehicleEnter", getRootElement(), destrTimer) else return false endend
removeEventHandler ("onVehicleExit", getRootElement(), vehicleExit)
İki görevden birinin eventlerini değiştirmen yeterli olacaktır.Aracı terk edince araç kaybolur. (2. satırı scripte göre uyarlamalısın)Kod: luafunction vehicleExit (leaver) if source == rekka and leaver == source then addEventHandler ("onVehicleEnter", getRootElement(), destrTimer) else return false endendKod: luaremoveEventHandler ("onVehicleExit", getRootElement(), vehicleExit)
addEventHandler ("onVehicleEnter", getRootElement(), destrTimer)