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

Wysłany: 2015-11-29, 11:44


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam robie prace dorywcza i mam problem, jezeli wjade w marker to nic sie niedzieje

        rozpocznijspedytor =  createMarker (1121.35,-1246.58,15.09,"cylinder",3.0,0,255,255,255)
        addEvent("rozpocznijprace",true)

        function zresp player )
        local auto createVehicle (499,1106.56,-1249.39,15.91,0.0,360.0,3.6)
        setElementData(auto"pojazd_wsiadaj",true)
        setElementData auto"pojazd_paliwo"50 )
        setElementData auto"pojazd_opis""Praca dorywcza - Spedytor " )
        setVehiclePlateText(auto"Spedytor")
        warpPedIntoVehicle player auto0  )
        outputChatBox  ("Praca dorywcza - Spedytor ",player,0,200,0)
        end
        addEventHandler("rozpocznijprace",root,zresp)

        addEventHandler("onMarkerHit",rozpocznijspedytor,function(player)
        if isElementWithinMarker(player,rozpocznijspedytorthen
        triggerClientEvent(player,"pokazoknopracy",root)
        end
        end)

        local punkty = {
        {321.15,-1775.28,4.12},
        {862.37,-1793.81,13.17},
        {1358.18,-1753.69,12.67},
        {1848.02,-1757.15,12.74},
        {2495.34,-1753.75,12.79},
        {2757.16,-1943.38,12.86},
        {2855.11,-1341.69,10.37},
        }

        function markery (player)
            local pkt punkty[math.random(1#punkty)] 
              cel createMarker(pkt[1], pkt[2], pkt[3], "checkpoint",4.012322556150,player) 
              blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end
        addEventHandler("rozpocznijprace",root,markery)
        
        addEventHandler("onMarkerHit",cel,getRootElement(),function(player)
        setTimer(function()
        setElementFrozen(player)
        destroyElement (blip)
        destroyElement (cel)
        givePlayerMoney(player,money)
        cel createMarker(pkt[1], pkt[2], pkt[3], "cylinder",4.012322556150,player) 
        blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end,5000,1)    
        end)
        
        
        
    

        function usun_pojazd (playerseat)
        if seat == 0 then
        auto getPedOccupiedVehicle (player)
        auto1 getElementData (auto"pojazd_wsiadaj")
        if auto1 then
        outputChatBox  ("Skonczyles prace ",player,0,200,0)
        destroyElement (auto)
        destroyElement (blip)
        destroyElement (cel)
        else return end
        end
        end
        addEventHandler ("onVehicleStartExit"getRootElement(), usun_pojazd)
        setTimer(usun_pojazd4000,1,"")

        local money math.random(35,70)



db: http://www.wrzucajtu.pl/w...29_11-44-25.png

nawet jezeli dam
addEventHandler("onMarkerHit",cel,getRootElement(),function(player)
bez getRootElement() to nic sie nie dzieje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 12:21


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, albo cel, albo root...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 12:37


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Pisalem.. usunelem root i nic ;

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 12:42


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
 addEventHandler("onMarkerHit",getRootElement(),function(player)
        if source ~= cel then return end
        setTimer(function()
        setElementFrozen(player)
        destroyElement (blip)
        destroyElement (cel)
        givePlayerMoney(player,money)
        cel createMarker(pkt[1], pkt[2], pkt[3], "cylinder",4.012322556150,player) 
        blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end,5000,1)    
        end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 12:58


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

mam takie cos


        addEventHandler("onMarkerHit",getRootElement(),function(player)
        if source ~= cel then return end
        setTimer(function()
        setElementFrozen(player)
        destroyElement (blip)
        destroyElement (cel)
        givePlayerMoney(player,money)
        local pkt punkty[math.random(1#punkty)] 
        cel createMarker(pkt[1], pkt[2], pkt[3], "cylinder",4.012322556150,player) 
        blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end,5000,1)    
        end)


db: http://www.wrzucajtu.pl/w...29_12-57-54.png

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 13:02


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen,

Więcej informacji znajdziesz w Wikipedii MTA:

setElementFrozen

- to ma wi?cej argument?w ni? 1

givePlayerMoney - brak kwoty, zmienna money nie istnieje lub nie przechowuje warto?ci

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 13:05


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

np jak dam setElementFrozen(player,true) i juz marker sie usunie to mam ciagle freeza :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 13:07


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, to ustaw kolejny setTimer i tam daj odfreezowanie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-29, 13:08


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Mam takie cos, nie unfreezuje mnie ani nie respi nowych marker?w !!
addEventHandler("onMarkerHit",getRootElement(),function(player)
        if source ~= cel then return end
        local money math.random(35,70)
        setTimer(function()
        setElementFrozen(player,true)
        destroyElement (blip)
        destroyElement (cel)
        givePlayerMoney(player,money)
        local pkt punkty[math.random(1#punkty)] 
        cel createMarker(pkt[1], pkt[2], pkt[3], "cylinder",4.012322556150,player) 
        blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end,5000,1)    
        setElementFrozen(player,false)
        end)
DB BRAK

[ Dodano: 2015-11-29, 13:40 ]

        addEventHandler("onMarkerHit",getRootElement(),function(player)
        if source ~= cel then return end
        local money math.random(35,70)
        setTimer(function()
        setElementFrozen(player,true)
        destroyElement (blip)
        destroyElement (cel)
        givePlayerMoney(player,money)
        local pkt punkty[math.random(1#punkty)] 
        cel createMarker(pkt[1], pkt[2], pkt[3], "cylinder",4.012322556150,player) 
        blip createBlipAttachedTo(cel51,2,255,0,0,255,0,99999.0,player)
        end,5000,1)   
        setTimer(function()
        setElementFrozen(player,false)
        end,2000,0)
        end)


Freez juz dziala ale nie respi nowych marker?w

[ Dodano: 2015-11-29, 14:19 ]
To jak macie pomysly

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: spedytor
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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