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

Wysłany: 2017-12-13, 16:01


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Witam, mam problem mianowicie po wej?ciu w marker 'stan' nic sie nie dzieje.

local praca createMarker(2183,-2253,13.5,"cylinder",2,255,255,255,255,getRootElement())

local stanowiska = {
{2175.5634765625, -2267.45898437512.3-3,"cylinder",6,66134244,255},
{2167.947265625, -2274.801757812512.3-3,"cylinder",6,66134244255}
}

local mieszkania = {
{2232.404296875, -1785.97851562512.3,"corona",2,66244194,255,1},
{2275.154296875, -1785.6367187512.3,"corona",2,66244194,255,2},
{2307.8271484375, -1785.74023437512.3,"corona",2,66244194,255,3},
{2345.576171875, -1785.61132812512.3,"corona",2,66244194,255,4},
{2379.6171875, -1785.864257812512.3,"corona",2,66244194,255,5},
{2394.9619140625, -1796.004882812512.3,"corona",2,66244194,255,6},
{2359.861328125, -1795.789062512.3,"corona",2,66244194,255,7},
{2322.791015625, -1796.219726562512.3,"corona",2,66244194,255,8},
{2290.1328125, -1795.95117187512.3,"corona",2,66244194,255,9},
{2247.0712890625, -1795.870117187512.3,"corona",2,66244194,255,10},
}

addEventHandler("onPlayerMarkerHit",praca,function()
setElementData(localPlayer,"pracaKur",true)
end)



for i,v in pairs(stanowiska) do
    local stan=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
    
    addEventHandler("onPlayerMarkerHit",stan, function()
    if not isElementWithinMarker(localPlayerpracathen return end
    if  getElementData(localPlayer"pracaKur",truethen
        local losuj math.random(2#mieszkania)
        local hajsik math.random(112,300)

        local cel createMarker(mieszkania[losuj][1], mieszkania[losuj][2], mieszkania[losuj][3]-1.0"checkpoint"1.025500)
        local blip createBlipAttachedTo(cel41)

        addEventHandler("onClientMarkerHit"cel, function(localPlayermd)
            if not md or getElementType(localPlayer) ~= "player" then return end
            if localPlayer ~= localPlayer then return end

            destroyElement(blip)
                setElementFrozen(localPlayerfalse)
                destroyElement(cel)
                setElementData(localPlayer"pracaKur"false)
                --triggerServerEvent("givePlayerMoney"localPlayerhajsik)
                outputChatBox("Za dowiezienie paczki otrzymujesz"..hajsik.."PLN!",5420351,true,plr)
        end)
    else
        outputChatBox("* Posiadasz aktywna prace.")
        end
        end)
        end

   

--[[addCommandHandler("czysc",czyszczenie)
function czyszczenie(
if getElementData(localPlayer,"pracaKur",truethen
outputChatBox("k****",getRootElement,255,255,255,false)
else
setElementData(localPlayer,"pracaKur",false)

end))--]]



--[[for i,v in pairs(mieszkania) do
    local mieszkanie=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
end--]]






Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 16:14


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

 if not isElementWithinMarker(localPlayerpracathen return end

Tutaj masz odpowied?, ten kod oznacza: je?li gracz nie jest w markerze "praca" zwraca nil

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 16:18


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"BarteQ03" napisał/a:

 if not isElementWithinMarker(localPlayerpracathen return end

Tutaj masz odpowied?, ten kod oznacza: je?li gracz nie jest w markerze "praca" zwraca nil

Racja, jestem debilem XD

[ Dodano: 2017-12-13, 16:22 ]
//Aczkolwiek nadal 0 reakcji

[ Dodano: 2017-12-13, 16:22 ]

local praca createMarker(2183,-2253,13.5,"cylinder",2,255,255,255,255,getRootElement())

local stanowiska = {
{2175.5634765625, -2267.45898437512.3-3,"cylinder",6,66134244,255},
{2167.947265625, -2274.801757812512.3-3,"cylinder",6,66134244255}
}

local mieszkania = {
{2232.404296875, -1785.97851562512.3,"corona",2,66244194,255,1},
{2275.154296875, -1785.6367187512.3,"corona",2,66244194,255,2},
{2307.8271484375, -1785.74023437512.3,"corona",2,66244194,255,3},
{2345.576171875, -1785.61132812512.3,"corona",2,66244194,255,4},
{2379.6171875, -1785.864257812512.3,"corona",2,66244194,255,5},
{2394.9619140625, -1796.004882812512.3,"corona",2,66244194,255,6},
{2359.861328125, -1795.789062512.3,"corona",2,66244194,255,7},
{2322.791015625, -1796.219726562512.3,"corona",2,66244194,255,8},
{2290.1328125, -1795.95117187512.3,"corona",2,66244194,255,9},
{2247.0712890625, -1795.870117187512.3,"corona",2,66244194,255,10},
}

addEventHandler("onPlayerMarkerHit",praca,function()
setElementData(localPlayer,"pracaKur",true)
end)



for i,v in pairs(stanowiska) do

    local stan=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
    
    addEventHandler("onPlayerMarkerHit",stan, function()
    if  getElementData(localPlayer"pracaKur",truethen
        local losuj math.random(2#mieszkania)
        local hajsik math.random(112,300)

        local cel createMarker(mieszkania[losuj][1], mieszkania[losuj][2], mieszkania[losuj][3]-1.0"checkpoint"1.025500)
        local blip createBlipAttachedTo(cel41)

        addEventHandler("onClientMarkerHit"cel, function(localPlayermd)
            if not md or getElementType(localPlayer) ~= "player" then return end
            if localPlayer ~= localPlayer then return end

            destroyElement(blip)
                setElementFrozen(localPlayerfalse)
                destroyElement(cel)
                setElementData(localPlayer"pracaKur"false)
                --triggerServerEvent("givePlayerMoney"localPlayerhajsik)
                outputChatBox("Za odlozenie skrzynki otrzymujesz "..hajsik.."PLN!",5420351,true,plr)
        end)
    else
        outputChatBox("* Posiadasz aktywna prace.")
        end
        end)
        end

   

--[[addCommandHandler("czysc",czyszczenie)
function czyszczenie(
if getElementData(localPlayer,"pracaKur",truethen
outputChatBox("k****",getRootElement,255,255,255,false)
else
setElementData(localPlayer,"pracaKur",false)

end))--]]



--[[for i,v in pairs(mieszkania) do
    local mieszkanie=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
end--]]





DB3 czysciutkie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 16:40


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

if  getElementData(localPlayer"pracaKur",truethen
co to jest? :p

Powinno by? tak:
if getElementData(localPlayer"pracaKur") == true then 


Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 17:04


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Nadal :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 17:48


.RiV







Wiek: 25
Na forum: 3588 dni
Posty: 554
Nick w MP: Split

Piwa: 2596

Respekt: 597,8
Respekt: 597,8

Po co ?

if getElementData(localPlayer"pracaKur") == true then 


Najlepiej jak by by?o

if getElementData(localPlayer"pracaKur"then


Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 20:21


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Nadal nic :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 20:45


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

addEventHandler("onClientMarkerHit"cel, function(elmd)
            if not md or getElementType(localPlayer) ~= "player" then return end
            if el ~= localPlayer then return end



pisane z,tel mog? by? b??dy

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-13, 20:54


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Nadal nic, chodzi o to ?e po wej?ciu w marker tworzy si? inny, a to si? nie dzieje.

[ Dodano: 2017-12-14, 17:14 ]
obecny kod

local praca createMarker(2183,-2253,13.5,"cylinder",2,255,255,255,255,getRootElement())

local stanowiska = {
{2175.5634765625, -2267.45898437512.3-3,"cylinder",6,66134244,255},
{2167.947265625, -2274.801757812512.3-3,"cylinder",6,66134244255}
}

local mieszkania = {
{2232.404296875, -1785.97851562512.3,"corona",2,66244194,255,1},
{2275.154296875, -1785.6367187512.3,"corona",2,66244194,255,2},
{2307.8271484375, -1785.74023437512.3,"corona",2,66244194,255,3},
{2345.576171875, -1785.61132812512.3,"corona",2,66244194,255,4},
{2379.6171875, -1785.864257812512.3,"corona",2,66244194,255,5},
{2394.9619140625, -1796.004882812512.3,"corona",2,66244194,255,6},
{2359.861328125, -1795.789062512.3,"corona",2,66244194,255,7},
{2322.791015625, -1796.219726562512.3,"corona",2,66244194,255,8},
{2290.1328125, -1795.95117187512.3,"corona",2,66244194,255,9},
{2247.0712890625, -1795.870117187512.3,"corona",2,66244194,255,10},
}

addEventHandler("onPlayerMarkerHit",praca,function()
setElementData(localPlayer,"pracaKur",true)
end)



for i,v in pairs(stanowiska) do

    local stan=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
    
    addEventHandler("onPlayerMarkerHit",stan, function()
   if getElementData(localPlayer"pracaKur"then 
        local losuj math.random(2#mieszkania)
        local hajsik math.random(112,300)

        local cel createMarker(mieszkania[losuj][1], mieszkania[losuj][2], mieszkania[losuj][3]-1.0"checkpoint"1.025500)
        local blip createBlipAttachedTo(cel41)

        addEventHandler("onClientMarkerHit"cel, function(elmd)
            if not md or getElementType(localPlayer) ~= "player" then return end
            if el ~= localPlayer then return end

            destroyElement(blip)
                setElementFrozen(localPlayerfalse)
                destroyElement(cel)
                setElementData(localPlayer"pracaKur"false)
                --triggerServerEvent("givePlayerMoney"localPlayerhajsik)
                outputChatBox("Za odlozenie skrzynki otrzymujesz "..hajsik.."PLN!",5420351,true,plr)
        end)
    else
        outputChatBox("* Posiadasz aktywna prace.")
        end
        end)
        end

   

--[[addCommandHandler("czysc",czyszczenie)
function czyszczenie(
if getElementData(localPlayer,"pracaKur",truethen
outputChatBox("k****",getRootElement,255,255,255,false)
else
setElementData(localPlayer,"pracaKur",false)

end))--]]



--[[for i,v in pairs(mieszkania) do
    local mieszkanie=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())    
end--]]






Postaw piwo autorowi tego posta
 

 
Tagi: marker :: nie :: reaguje
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