Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-12-21, 19:05


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Witam chcia?bym zrobi? prace dostawcy ale nie mog? zrobi? aby Spawni?a si? ci??ar?wka z naczep? razem i ?eby nie by?o mo?na jej odczepi?, macie pomys?y?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 19:18


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


Więcej informacji znajdziesz w Wikipedii MTA:

attachElements


Więcej informacji znajdziesz w Wikipedii MTA:

attachTrailerToVehicle


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 19:45


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

A poka?esz w kodzie?

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 20:05


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Na wiki s? przyk?ady, nie licz na gotowca.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 20:34


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Dobra masz piwo :D :piwo:

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 21:12


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Mam problem bo nie pokazuje si? naczepa wgl i jest db3

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("#919191[#0053FFCocaCola#919191]Praca w trakcie przygotowania."el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    
    local x,y,getElementPosition(el)
    local bus createVehicle(498, -130.81, -345.072.040.10.0177.0)
    setTimer(
    function()
        trailer createVehicle 45000)    -- create a trailer
        attachTrailerToVehicle newvehicletrailer )   -- attach them
    end501)



bus.lua:35Bad argument 'attachTrailerToVehicle '[Expected vehicle at argument 1,got nil]


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 21:19


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
attachTrailerToVehicle bustrailer )


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 22:21


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Teraz naczepa respi si? w Ci?zar?wce a nie podpina si? pod ni?

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-22, 14:28


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

mixLoLmix2,

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("#919191[#0053FFCocaCola#919191]Praca w trakcie przygotowania."el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    
    local x,y,getElementPosition(el)
    local bus createVehicle(498, -130.81, -345.072.040.10.0177.0)
    setTimer(
    function()
        trailer createVehicle 450, -130.81, -345.072.040.10.0177.0 )    -- create a trailer
        attachTrailerToVehicle bustrailer )   -- attach them
    end501)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-22, 16:23


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Dzia?a super a teraz ostatnie, da?o by rade ze jak wyjde z auta to Naczepa te? znika?

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-22, 16:28


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


Więcej informacji znajdziesz w Wikipedii MTA:

destroyElement


Więcej informacji znajdziesz w Wikipedii MTA:

detachTrailerFromVehicle



addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("#919191[#0053FFCocaCola#919191]Praca w trakcie przygotowania."el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    
    local x,y,getElementPosition(el)
    local bus createVehicle(498, -130.81, -345.072.040.10.0177.0)
    setTimer(
    function()
        trailer createVehicle 450, -130.81, -345.072.040.10.0177.0 )    -- create a trailer
        attachTrailerToVehicle bustrailer )   -- attach them
        setElementData(bus"naczepa",true)
    end501)

addEventHandler("onVehicleExit",getRootElement(),function()
   if getElementData(source"naczepa"then
              detachTrailerFromVehicle(bus,trailer)
       destroyElement(trailer)
 end
end)



Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 10:52


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Dzai?a Piwko :) A teraz mam problem bo nie pokazuje blipu, Nie wiem gdzie go da? zeby pokaza? sie blip do celu oto kod:
S


local b=createElement("text")
setElementData(b,"name","Coca Cola [RED COUNTY]")
setElementPosition(b,-123.02,-314.29,2.76)

local blip createBlip (-123.02,-314.29,2.7646 ) -- miejsce pracy dorywczej "kierowca autobusu"

local m1 createMarker(-123.02,-314.29,2.76"cylinder"1.53514235)
vehs = {}


function removePreviousVehicles(plr)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        local sby getElementData(v"zrespilGracz")
        if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
            destroyElement(v)
        end
    end
end

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("#919191[#0053FFCocaCola#919191]Praca w trakcie przygotowania."el)
        return
    end
    
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    
    local x,y,getElementPosition(el)
    local bus createVehicle(515, -130.81, -345.072.040.10.0177.0)
    setTimer(
    function()
        trailer createVehicle 450, -130.81, -345.072.040.10.0177.0 )    -- create a trailer
        attachTrailerToVehicle bustrailer )   -- attach them
        setElementData(bus"naczepa",true)
    end501)

addEventHandler("onVehicleExit",getRootElement(),function()
   if getElementData(source"naczepa"then
              detachTrailerFromVehicle(bus,trailer)
       destroyElement(trailer)
 end
end)
 
    setElementData(bus,"vehicle:desc","Coca Cola [RED COUNTY]")
    setElementData(bus"zrespilGracz"el)
    setElementData(bus"vehicle:fuel"55)
    setElementData(bus"vehicle:mileage"731)
    setVehiclePlateText(bus"CocaCola" )
    setVehicleColor(bus00255 )
    
    setVehicleHandling(bus,"maxVelocity"300.00) -- 40 10 50km/h
    
    warpPedIntoVehicle(elbus)
    removePreviousVehicles(el)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)
    setVehicleHandling(bus,"maxVelocity"300.00) -- 40 10 50km/h

    vehs[el] = bus
end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
    local pojazd getPedOccupiedVehicle(localPlayer)
    if pojazd then
        destroyElement(trailer)
        destroyElement(pojazd)
    end
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
     end
end)



C

local districtsBus = {
    {682.99,-440.98,17.29},
    {-117.18,-321.12,1.42},

}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget #districtsBus

function finishJob()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    if jobTarget and isElement(jobTargetthen
        destroyElement(jobTarget)
        jobTarget nil
        jobTarget 0
        
    end
    
triggerServerEvent("destroyVeh"localPlayer)

end


function busDriver(elmd)
    if el ~= localPlayer or not md then return end
    if jobTarget maxTarget and getPedOccupiedVehicle(elthen return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(elthen return end
    
    if jobTarget == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("#919191[#0053FFCocaCola#919191]Zako?czy?e?[a?] prac?.",255,255,255,true) 
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney"localPlayer12500)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarkerthen
        outputChatBox("#919191[#0053FFCocaCola#919191]Dotarczy?es[as] Towar, Wracaj do fabryki.",255,255,255,true) 
        destroyElement(jobMarker)
        blip createBlipAttachedTo(cel41)
        jobMarker nil
    end
    
    jobTarget jobTarget 1
    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"4255255255)
    blip createBlipAttachedTo(cel41)
    
    if districtsBus[jobTarget+1then
        ile districtsBus[jobTarget+1]
        setMarkerTarget(jobMarkerile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit"jobMarkerbusDriver)
end

addEvent("STARTJobBus"true)
addEventHandler("STARTJobBus"resourceRoot, function(veh)
    outputChatBox("#919191[#0053FFCocaCola#919191]Rozpocz??e?[a?] prac?. Zawie? towar do sklepu, Wynagrodzenie 1250PLN",255,255,255,true) 
    jobVehicle veh
    jobTarget 0
    showMarker()
end)

addEventHandler("onClientResourceStop"resourceRoot, function()
    if jobVehicle and getElementData(localPlayer"gracz_praca"then
        setElementData(localPlayer"gracz_praca"false)
    end
end)

addEventHandler("onClientVehicleExit"resourceRoot, function(plrseat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            destroyElement(blip)
            outputChatBox("#919191[#0053FFCocaCola#919191]Zako?czy?e?[a?] prac?",255,255,255,true) 
        end
    end
end)


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 11:46


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"4255255255)
    blip createBlipAttachedTo(cel41)


Postaw piwo autorowi tego posta
 

 
Tagi: spawn :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku