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

Wysłany: 2015-07-31, 13:42


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Witam. Ucz? si? .lua i mam problem ze skryptem pracy poniewa? nie wy??cza mi si? animacja.
Fragment kodu:

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


            destroyElement(dojsciem)
            destroyElement(dojscieb)
           setElementFrozen(el, true)
           setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
           outputChatBox("Kopiesz kamie?. ")
            setTimer(function()
                setElementFrozen(el, false)
                setPedAnimation(localPlayer, false)
                outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.")
                setElementData(el, "gracz_praca", false)
                triggerServerEvent("givePlayerMoney", localPlayer, 350)
            end, 3000, 1)
        end)
    else
        outputChatBox("Posiadasz ju? aktywn? prac?.")
end
end)


Ostatnio zmieniony przez Qbiszon 2015-07-31, 14:46, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 14:12


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

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


destroyElement(dojsciem) 
destroyElement(dojscieb) 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Id? do wybranego miejsca i wykop kamie?. ") 
setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false,false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end) 
else 
outputChatBox("Posiadasz ju? aktywn? prac?.") 
end 
end) 


Spr?buj tak

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 14:34


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Nadal nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 14:44


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Chwilka chwilka, bo to co? pogma?kane...

Nie masz tutaj warunku czy gracz ma prac?, a masz instrukcj? co ma skrypt wykona? je?eli nie ma...


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



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Id? do wybranego miejsca i wykop kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end)


Spr?buj tego, je?eli nie b?dzie dzia?a? to sprawd? db3 (/debugscript 3) i podaj b??dy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 14:57


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Teraz ca?kiem praca nie dzia?a.


Mo?e poda? ca?y skrypt?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 14:58


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

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

Teraz ca?kiem praca nie dzia?a.
Obrazek

Mo?e poda? ca?y skrypt?


Tak, podaj, bo to taki troszke ciuczek, mam wra?enie ?e jeszcze ta funkcja kt?r? poda?e? na pocz?tku lekko uci?ta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:03


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50


local marker=createMarker(-786.56622314453, 2598.9174804688, 42.2, "cylinder", 2, 100, 50, 0)
createBlipAttachedTo(marker, 52)

local miejsca = {
{-779.53106689453, 2612.2758789063, 42.2},
{-797.48028564453, 2597.2670898438, 42.2},
{-808.39337158203, 2578.6352539063, 42.2},
{-805.50292296875, 2604.7019042969, 42.2},
{-810.70001220703, 2619.5795898438, 42.2},
{-802.69610595703, 2633.0249023438, 42.2},
{-777.80157470703, 2593.8295898438, 42.2},
{-794.98712158203, 2621.2885742188, 42.2},
}

addEventHandler("onClientMarkerHit", marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    outputChatBox("Aby rozpocz?? prac? wci?nij E")
end)

bindKey("E", "down", function()
    if not isElementWithinMarker(localPlayer, marker) then return end
    if not getElementData(localPlayer, "gracz_praca") then
        local losuj = math.random(2, #miejsca)
        setElementData(localPlayer, "gracz_praca", true)
        outputChatBox("Id? do wybranego miejsca i wykop kamie?.")
        
          local dojsciem = createMarker(miejsca[losuj][1], miejsca[losuj][2], miejsca[losuj][3], "cylinder", 1, 100, 50, 0)
        local dojscieb = createBlipAttachedTo(dojsciem, 12)
        

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



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end)


Zmieni?em tre?ci w outputChatbox ale to nie powinno przeszkadza?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:08


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%






To powinno ju? lata? elegancko, za bardzo nie mam jak sprawdzi?, bo obecnie serwer sw?j mam zaj?ty, wi?c w razie czego znowu si? odezwij z db3 je?eli by takowe by?y

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:19


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Gdy wchodz?w marker "dojsciem" to nic sie nie dzieje.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:28


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

addEventHandler("onClientMarkerHit", getRootElement() dojsciem, function(el, md) 



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:41


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Dopisa?em przecinek bo brakowa?o. Kolejny blad


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 15:43


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Omg xD


Zr?b to tak xD

function rampampam(el,md)
if not md or getElementType(el) ~= "player" then return end 
if el ~= localPlayer then return end 



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end

addEventHandler("onClientMarkerHit", getRootElement() dojsciem, rampampam) 



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 16:04


TheTroll

Pan Majster






Wiek: 39
Na forum: 4905 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1117

Respekt: 120
Respekt: 120

Ten kod b?dzie dzia?a? ;)

local marker=createMarker(-786.56622314453, 2598.9174804688, 42.2, "cylinder", 2, 100, 50, 0)
createBlipAttachedTo(marker, 52)

local miejsca = {
{-779.53106689453, 2612.2758789063, 42.2},
{-797.48028564453, 2597.2670898438, 42.2},
{-808.39337158203, 2578.6352539063, 42.2},
{-805.50292296875, 2604.7019042969, 42.2},
{-810.70001220703, 2619.5795898438, 42.2},
{-802.69610595703, 2633.0249023438, 42.2},
{-777.80157470703, 2593.8295898438, 42.2},
{-794.98712158203, 2621.2885742188, 42.2},
}

addEventHandler("onClientMarkerHit", marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    outputChatBox("Aby rozpocz?? prac? wci?nij E")
end)

bindKey("E", "down", function()
    if not isElementWithinMarker(localPlayer, marker) then return end
    if not getElementData(localPlayer, "gracz_praca") then
                local losuj = math.random(2, #miejsca)
                setElementData(localPlayer, "gracz_praca", true)
                outputChatBox("Id? do wybranego miejsca i wykop kamie?.")
        
                dojsciem = createMarker(miejsca[losuj][1], miejsca[losuj][2], miejsca[losuj][3], "cylinder", 1, 100, 50, 0)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb = createBlipAttachedTo(dojsciem, 12)
    else
        outputChatBox("ju? pracujesz")
    end  
end) 

addEventHandler("onClientMarkerHit", getRootElement(), function(el, md) 
if not md or getElementType(el) ~= "player" then return end 
if not getElementData(source,"marker_dojsciem") == true then return end
if el ~= localPlayer then return end 



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 16:35


Qbiszon

Map editor






Wiek: 25
Na forum: 4317 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

"DestroY" napisał/a:

Omg xD


Zr?b to tak xD

function rampampam(el,md)
if not md or getElementType(el) ~= "player" then return end 
if el ~= localPlayer then return end 



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end

addEventHandler("onClientMarkerHit", getRootElement() dojsciem, rampampam) 




[ Dodano: 2015-07-31, 16:36 ]
"TheTroll" napisał/a:

Ten kod b?dzie dzia?a? ;)

local marker=createMarker(-786.56622314453, 2598.9174804688, 42.2, "cylinder", 2, 100, 50, 0)
createBlipAttachedTo(marker, 52)

local miejsca = {
{-779.53106689453, 2612.2758789063, 42.2},
{-797.48028564453, 2597.2670898438, 42.2},
{-808.39337158203, 2578.6352539063, 42.2},
{-805.50292296875, 2604.7019042969, 42.2},
{-810.70001220703, 2619.5795898438, 42.2},
{-802.69610595703, 2633.0249023438, 42.2},
{-777.80157470703, 2593.8295898438, 42.2},
{-794.98712158203, 2621.2885742188, 42.2},
}

addEventHandler("onClientMarkerHit", marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    outputChatBox("Aby rozpocz?? prac? wci?nij E")
end)

bindKey("E", "down", function()
    if not isElementWithinMarker(localPlayer, marker) then return end
    if not getElementData(localPlayer, "gracz_praca") then
                local losuj = math.random(2, #miejsca)
                setElementData(localPlayer, "gracz_praca", true)
                outputChatBox("Id? do wybranego miejsca i wykop kamie?.")
        
                dojsciem = createMarker(miejsca[losuj][1], miejsca[losuj][2], miejsca[losuj][3], "cylinder", 1, 100, 50, 0)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb = createBlipAttachedTo(dojsciem, 12)
    else
        outputChatBox("ju? pracujesz")
    end  
end) 

addEventHandler("onClientMarkerHit", getRootElement(), function(el, md) 
if not md or getElementType(el) ~= "player" then return end 
if not getElementData(source,"marker_dojsciem") == true then return end
if el ~= localPlayer then return end 



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end)

Nie dziala :( . Gdy wchodze w marker i klikam E to wyskakuje "juz pracujesz".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 16:44


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
To ju? musi lata?
local marker=createMarker(-786.56622314453, 2598.9174804688, 42.2, "cylinder", 2, 100, 50, 0)
createBlipAttachedTo(marker, 52)

local miejsca = {
{-779.53106689453, 2612.2758789063, 42.2},
{-797.48028564453, 2597.2670898438, 42.2},
{-808.39337158203, 2578.6352539063, 42.2},
{-805.50292296875, 2604.7019042969, 42.2},
{-810.70001220703, 2619.5795898438, 42.2},
{-802.69610595703, 2633.0249023438, 42.2},
{-777.80157470703, 2593.8295898438, 42.2},
{-794.98712158203, 2621.2885742188, 42.2},
}

addEventHandler("onClientMarkerHit", marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    outputChatBox("Aby rozpocz?? prac? wci?nij E")
end)

bindKey("E", "down", function()
    if not isElementWithinMarker(localPlayer, marker) then return end
    if getElementData(localPlayer, "gracz_praca") == "true" then return outputChatBox("ju? pracujesz") end
                local losuj = math.random(2, #miejsca)
                setElementData(localPlayer, "gracz_praca", true)
                outputChatBox("Id? do wybranego miejsca i wykop kamie?.")
        
                dojsciem = createMarker(miejsca[losuj][1], miejsca[losuj][2], miejsca[losuj][3], "cylinder", 1, 100, 50, 0)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb = createBlipAttachedTo(dojsciem, 12) 
end) 

addEventHandler("onClientMarkerHit", getRootElement(), function(el, md) 
if not md or getElementType(el) ~= "player" then return end 
if not getElementData(source,"marker_dojsciem") == true then return end
if el ~= localPlayer then return end 



destroyElement(dojsciem) 
destroyElement(dojscieb)
 
setElementFrozen(localPlayer, true) 
setPedAnimation ( localPlayer, "BASEBALL", "BAT_4", 1,true ) 
outputChatBox("Kopiesz kamie?. ") 

setTimer(function() 
setElementFrozen(localPlayer, false) 
setPedAnimation(localPlayer, false) 
outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.") 
setElementData(localPlayer, "gracz_praca", false) 
triggerServerEvent("givePlayerMoney", localPlayer, 350) 
end, 3000, 1) 
end)


Postaw piwo autorowi tego posta
 

 
Tagi: animacja :: się :: nie :: wyłącza
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Animacja się nie wyłącza 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