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

Wysłany: 2015-11-04, 17:18


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witajcie robie prace dorywcza i chcialem zrobic randomowe punkty i blipoy tam gdzie punkty tutaj macie kod :
marker =  createMarker (-208.78,1221.14,19.0,"cylinder",1.0,0,200,0,255)
ped createPed (16,-208.82,1220.29,19.89)



function zresp player )
auto createVehicle (552,-194.61,1224.06,19.43,359.1,0.0,180.2)
setElementData auto"pojazd_paliwo"50 )
warpPedIntoVehicle player auto0  )
end
addEventHandler ("onMarkerHit",marker,zresplocal punkty = {
{-171.244873046881096.130126953119.606197357178},
{30.9131679534911119.807373046919.623331069946},
{-91.3217620849611200.03320312519.619775772095},
{-112.263008117681169.136474609419.603679656982},
{-187.258407592771025.612426757819.60319519043},
{-218.661804199221003.634155273419.698823928833},
{-294.933959960941064.339965820319.611391067505},
{-343.917724609381122.276733398419.606252670288},
{-340.332580566411167.642456054719.738605499268},
}


Prosze o pomoc za pomoc piffo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-04, 21:55


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

local pkt = punkty[math.random(1, #punkty)]
marker = createMarker(pkt[1], pkt[2], pkt[3], "cylinder", 1.3, 255, 0, 0, 150)
blip = createBlipAttachedTo(marker, 12)

cos takiego

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-05, 20:32


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-06, 19:21


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Okej mam teraz takie cos i jak zrobic aby markery pojawialy sie dopiero kiedy rozpoczne prace ?

marker =  createMarker (-208.78,1221.14,19.0,"cylinder",1.0,0,200,0,255)
ped createPed (16,-208.82,1220.29,19.89)

function zresp player )
local auto createVehicle (552,-194.61,1224.06,19.43,359.1,0.0,180.2)
setElementData auto"pojazd_paliwo"50 )
setElementData auto"pojazd_opis""Praca dorywcza - ?atanie dziur " )
warpPedIntoVehicle player auto0  )
outputChatBox  (" ",player,0,200,0)
outputChatBox  ("Praca dorywcza - ?atanie dziur ",player,0,200,0)
outputChatBox  (" ",player,0,200,0)
end
addEventHandler ("onMarkerHit",marker,zresplocal punkty = {
{-171.244873046881096.130126953119.606197357178},
{30.9131679534911119.807373046919.623331069946},
{-91.3217620849611200.03320312519.619775772095},
{-112.263008117681169.136474609419.603679656982},
{-187.258407592771025.612426757819.60319519043},
{-218.661804199221003.634155273419.698823928833},
{-294.933959960941064.339965820319.611391067505},
{-343.917724609381122.276733398419.606252670288},
{-340.332580566411167.642456054719.738605499268},
}
local pkt punkty[math.random(1#punkty)] 
marker createMarker(pkt[1], pkt[2], pkt[3], "checkpoint"2.025500150blip createBlipAttachedTo(marker12) 

function destroyauto player )
if ( getElementModel player ) == 552 then
destroyElement (auto)
end
end
addEventHandler "onVehicleExit"destroyauto )

local money math.random(5,15)


[ Dodano: 2015-11-06, 19:27 ]
Ok mam

[ Dodano: 2015-11-06, 19:35 ]
Prosil bym przyklad ktory ze jak wjade w marker on sie usuwa i tworzy sie nastepny

[ Dodano: 2015-11-06, 20:24 ]
Dobra bo nie ogarniam dlaczego tworzy sie dla all graczy gdy ktos zacznie prace tworzy kazdemu marker i blip gdzie ma jechac kod :


marker =  createMarker (-208.78,1221.14,19.0,"cylinder",1.0,0,200,0,255)
ped createPed (16,-208.82,1220.29,19.89)

function zresp player )
local auto createVehicle (552,-194.61,1224.06,19.43,359.1,0.0,180.2)
setElementData auto"pojazd_paliwo"50 )
setElementData auto"pojazd_opis""Praca dorywcza - ?atanie dziur " )
warpPedIntoVehicle player auto0  )
outputChatBox  (" ",player,0,200,0)
outputChatBox  ("Praca dorywcza - ?atanie dziur ",player,0,200,0)
outputChatBox  (" ",player,0,200,0)
end
addEventHandler ("onMarkerHit",marker,zresplocal punkty = {
{-171.244873046881096.130126953119.606197357178},
{30.9131679534911119.807373046919.623331069946},
{-91.3217620849611200.03320312519.619775772095},
{-112.263008117681169.136474609419.603679656982},
{-187.258407592771025.612426757819.60319519043},
{-218.661804199221003.634155273419.698823928833},
{-294.933959960941064.339965820319.611391067505},
{-343.917724609381122.276733398419.606252670288},
{-340.332580566411167.642456054719.738605499268},
}

        function markery (player)
        local pkt punkty[math.random(1#punkty)] 
         marker createMarker(pkt[1], pkt[2], pkt[3], "checkpoint",2.025500150) 
         blip createBlipAttachedTo(marker12) 
        end
        addEventHandler("onMarkerHit",markermarkery)

                function destroyauto player )
                if ( getElementModel player ) == 552 then
                destroyElement (auto)
                end
                end
                addEventHandler "onVehicleExit"destroyauto )


local money math.random(5,15)


Postaw piwo autorowi tego posta
 

 
Tagi: random :: math
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