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

Wysłany: 2015-11-03, 15:28


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam robie prace dowozenia mebli i nie respia mi sie auta narazie mam taki kod:
--[[
Praca dorywcza "Dostawca Mebli"
Autor BlackTen
Wersja 1.1
ZAKAZ ZMIANY AUTORA
]]--

vehicles {
createVehicle (414,1768.06, -2021.74,14.24,359.9,359.8,270.0),
createVehicle (414,1789.34, -2021.74,13.57,0.2,360.0,270.0),
createVehicle (414,1768.43, -2029.57,13.79,354.3,359.9,270.0),
createVehicle (414,1768.32, -2034.13,13.80,354.3,0.0,270.0),
createVehicle (414,1768.22, -2051.00,13.85,354.8,359.8,270.0),
createVehicle (414,1768.23, -2047.11,13.84,354.6,359.9,270.0)
}

houses{
{1977.46= -1727.2716.28 },    
{2173.10= -1674.3015.37 },
{2337.65= -1367.8324.32 },
{2196.70= -1286.4824.49 },
{1909.61= -1118.6026.01 },
{1727.19= -1272.8313.09 },
{1288.99= -1581.2813.09 },
{1567.31= -1884.9513.12 },   
{1312.37= -1377.9813.22 }
}

addEventHandler("onVehicleEnter"resourceRoot,
    function ( playerseat ) 
        if seat == and  getElementModel (source) == 414 then
                setElementData (player"mebles"10)
                outputChatBox("Otrzyma?es 10 mebli, nie wysiadaj z pojazdu aby uko?czy? prac? !",player)
                    end
            end
)        













    


pomoze ktos ?
Daje piwko i respekt

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 16:08


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Zamiast do ka?dego dawa? createVehicles, daj same kordy i dodaj pobieranie aut i tworzenie z tej tabeli.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 16:19


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

A nie da sie tego naprawic ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 16:19


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
tabelka = {
{414,1768.06, -2021.74,14.24,359.9,359.8,270.0},
{414,1789.34, -2021.74,13.57,0.2,360.0,270.0},
{414,1768.43, -2029.57,13.79,354.3,359.9,270.0},
{414,1768.32, -2034.13,13.80,354.3,0.0,270.0},
{414,1768.22, -2051.00,13.85,354.8,359.8,270.0},
{414,1768.23, -2047.11,13.84,354.6,359.9,270.0},
}

for kv in ipairs (tabelka) do
              samochodzik createVehicle (v[1], v[2], v[3], v[4], v[5], v[6], v[7])
end


Polecam t? metod?. Napisane gdyby? nie wiedzia? jak si? p?tle stosuje :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 16:42


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

to do kodu mam dac ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 16:48


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Masz to podmienic zamiast tej twojej "tabeli" z pojazdami na to co ci da?em ;)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 17:28


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Podmienilem i nic masz tu kod :
--[[
Praca dorywcza "Dostawca Mebli"
Autor BlackTen
Wersja 1.1
ZAKAZ ZMIANY AUTORA
]]--

local currentIndex 0

vehicles = {
{414,1768.06, -2021.74,14.24,359.9,359.8,270.0},
{414,1789.34, -2021.74,13.57,0.2,360.0,270.0},
{414,1768.43, -2029.57,13.79,354.3,359.9,270.0},
{414,1768.32, -2034.13,13.80,354.3,0.0,270.0},
{414,1768.22, -2051.00,13.85,354.8,359.8,270.0},
{414,1768.23, -2047.11,13.84,354.6,359.9,270.0},
}

for kv in ipairs (tvehicles) do
              samochodzik createVehicle (v[1], v[2], v[3], v[4], v[5], v[6], v[7])
end



houses = {
{1977.46= -1727.2716.28 },    
{2173.10= -1674.3015.37 },
{2337.65= -1367.8324.32 },
{2196.70= -1286.4824.49 },
{1909.61= -1118.6026.01 },
{1727.19= -1272.8313.09 },
{1288.99= -1581.2813.09 },
{1567.31= -1884.9513.12 },   
{1312.37= -1377.9813.22 }
}

function createHouse(player)
    local rand math.random(1,10)
    while(rand == currentIndex) do
            rand math.random(1,10)
    end
    currentIndex rand
    createMarker(houses[rand].x,houses[rand].y,houses[rand].z,"checkpoint",2,255,0,0,255,player)
    createBlip houses[rand].x,houses[rand].y,houses[rand].z,41,2,02550255,099999.0,player)
end



addEventHandler("onVehicleEnter"resourceRoot,
    function ( playerseat ) 
        if seat == and  getElementModel (source) == 414 then
                setElementData (player"mebles"10)
                outputChatBox("Otrzyma?es 10 mebli, nie wysiadaj z pojazdu aby uko?czy? prac? !",player)
                createHouse(player)
                    end
            end
)        


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 17:56


Gerano

Mleko,Kakao,LUA






Wiek: 38
Na forum: 4266 dni
Posty: 187
Nick w MP: Gerano

Piwa: 1460

Respekt: 146,3
Respekt: 146,3

Ostrzeżeń: 100%
BlackTen, jakie masz b??dy w db 3?

Podpis
BUDOWA SERWERA: XXX

Prace: XXX%
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:10


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

?adne

[ Dodano: 2015-11-03, 18:18 ]
Jak cos korzystam z tego poradnika od Pioruna : https://www.youtube.com/watch?v=HO5B2b7z7Cw

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:21


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"Gerano" napisał/a:

BlackTen, jakie masz b??dy w db 3?


Tak strzelam ?e nie ?aduje mu si? skrypt przez tamt? tabel? kt?ra jest po mojej. Pierwszy raz widz? tak? tabel? i serwer mo?e jej nie odczytywa?. Spr?buj tak:

houses = {
{ 1977.46, -1727.2716.28 },    
{ 2173.10, -1674.3015.37 },
{ 2337.65, -1367.83,  24.32 },
{ 2196.70, -1286.48,  24.49 },
{1909.61, -1118.6026.01 },
{1727.19, -1272.8313.09 },
{1288.99, -1581.2813.09 },
{1567.31, -1884.9513.12 },   
{1312.37, -1377.9813.22 }
}
function tworz_domy (player)
for kv in ipairs (houses) do
           createMarker (v[1],v[2],v[3], "cylinder",225500255player)
           createBlip (v[1], v[2], v[3], 4120255025509999.9player)
end
end


Nie dalem eventHandlera bo nie wiem czy chcesz to triggerowa? czy po jakim? czym? si? dzia?o xD

[ Dodano: 2015-11-03, 18:23 ]
A poza tym jest to ?atwiejsze :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:25


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Juz nie ogarniam robie od Pioruna i piorunowi dziala...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:28


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"BlackTen" napisał/a:

Juz nie ogarniam robie od Pioruna i piorunowi dziala...


Ja nie ogarniam jego stylu pisania skrypt?w. Ten spos?b jest o wiele ?atwiejszy, bardziej zrozumia?y tylko wymaga znajomo?ci tworzenia p?tli. M?g?by? je wykorzysta? do wielu skrypt?w. Spr?buj z tym:

http://www.gtao.pl/wstep-...tle-vt89684.htm

[ Dodano: 2015-11-03, 18:30 ]
W sumie ten post tw?j nie wprowadza nic do tematu :)

[ Dodano: 2015-11-03, 18:31 ]
I jeszcze z tym:

http://www.gtao.pl/poradnik-tablice-vt98119.htm

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:33


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

--[[
Praca dorywcza "Dostawca Mebli"
Autor BlackTen
Wersja 1.1
ZAKAZ ZMIANY AUTORA
]]--

local currentIndex 0




vehicles = {
{414,1768.06, -2021.74,14.24,359.9,359.8,270.0},
{414,1789.34, -2021.74,13.57,0.2,360.0,270.0},
{414,1768.43, -2029.57,13.79,354.3,359.9,270.0},
{414,1768.32, -2034.13,13.80,354.3,0.0,270.0},
{414,1768.22, -2051.00,13.85,354.8,359.8,270.0},
{414,1768.23, -2047.11,13.84,354.6,359.9,270.0},
}

for kv in ipairs (vehicles) do
              samochodzik createVehicle (v[1], v[2], v[3], v[4], v[5], v[6], v[7])
end

houses = {
{ 1977.46, -1727.2716.28 },    
{ 2173.10, -1674.3015.37 },
{ 2337.65, -1367.83,  24.32 },
{ 2196.70, -1286.48,  24.49 },
{1909.61, -1118.6026.01 },
{1727.19, -1272.8313.09 },
{1288.99, -1581.2813.09 },
{1567.31, -1884.9513.12 },   
{1312.37, -1377.9813.22 }
}

function tworz_domy (player)
for kv in ipairs (houses) do
           local mark createMarker (v[1],v[2],v[3], "checkpoint",225500255player)
           local blip createBlip (v[1], v[2], v[3], 4120255025509999.9player)
end
end
    
    
    addEventHandler("onMarkerHit",mark,
    
        function ( element)
            if getElementType(element) == "player" then
                local mebels getElementData(element"mebels")
                if mebles then
                    if mebels 0 then
                        mebels mebels 1
                        setElementData(element,"mebels",mebels)
                        createHouse(element)
                        else
                        outputChatBox("Zako?czy?es prace!",player)
                        destroyElement(GetPedOccupiedVehicle(element))
                    end
                end
            end
        end
    
    
    )
    
end



addEventHandler("onVehicleEnter"resourceRoot,
    function ( playerseat ) 
        if seat == and  getElementModel (source) == 414 then
                setElementData (player"mebles"10)
                outputChatBox("Otrzyma?es 10 mebli, nie wysiadaj z pojazdu aby uko?czy? prac? !",player)
                createHouse(player)
                    end
            end
)

Nic.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:35


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Nic czyli czego nie ma? Ja ci nie czytam w my?lach...

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-03, 18:37


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie respia sie dalej te auta

Postaw piwo autorowi tego posta
 

 
Tagi: spawn :: aut
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Spawn Aut 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