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: 4176 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(elmd)
            if not md or getElementType(el) ~= "player" then return end
            if el ~= localPlayer then return end


            destroyElement(dojsciem)
            destroyElement(dojscieb)
           setElementFrozen(eltrue)
           setPedAnimation localPlayer"BASEBALL""BAT_4"1,true ) 
           outputChatBox("Kopiesz kamie?. ")
            setTimer(function()
                setElementFrozen(elfalse)
                setPedAnimation(localPlayerfalse)
                outputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia.")
                setElementData(el"gracz_praca"false)
                triggerServerEvent("givePlayerMoney"localPlayer350)
            end30001)
        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: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

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


destroyElement(dojsciemdestroyElement(dojsciebsetElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Id? do wybranego miejsca i wykop kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalse,falseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end) 
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: 4176 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: 26
Na forum: 4771 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(elmd) 
if not md or getElementType(el) ~= "player" then return end 
if el ~= localPlayer then return end 



destroyElement(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Id? do wybranego miejsca i wykop kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end)


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: 4176 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: 26
Na forum: 4771 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: 4176 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50


local marker=createMarker(-786.566223144532598.917480468842.2"cylinder"2100500)
createBlipAttachedTo(marker52)

local miejsca = {
{-779.531066894532612.275878906342.2},
{-797.480285644532597.267089843842.2},
{-808.393371582032578.635253906342.2},
{-805.502922968752604.701904296942.2},
{-810.700012207032619.579589843842.2},
{-802.696105957032633.024902343842.2},
{-777.801574707032593.829589843842.2},
{-794.987121582032621.288574218842.2},
}

addEventHandler("onClientMarkerHit"marker, function(elmd)
    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(localPlayermarkerthen 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"1100500)
        local dojscieb createBlipAttachedTo(dojsciem12)
        

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



destroyElement(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end)


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: 26
Na forum: 4771 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: 4176 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: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

addEventHandler("onClientMarkerHit"getRootElement() dojsciem, function(elmd


Postaw piwo autorowi tego posta
 

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


Qbiszon

Map editor






Wiek: 25
Na forum: 4176 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: 26
Na forum: 4771 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(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end

addEventHandler("onClientMarkerHit"getRootElement() dojsciemrampampam


Postaw piwo autorowi tego posta
 

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


TheTroll

Pan Majster






Wiek: 38
Na forum: 4764 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1114

Respekt: 120
Respekt: 120

Ten kod b?dzie dzia?a? ;)

local marker=createMarker(-786.566223144532598.917480468842.2"cylinder"2100500)
createBlipAttachedTo(marker52)

local miejsca = {
{-779.531066894532612.275878906342.2},
{-797.480285644532597.267089843842.2},
{-808.393371582032578.635253906342.2},
{-805.502922968752604.701904296942.2},
{-810.700012207032619.579589843842.2},
{-802.696105957032633.024902343842.2},
{-777.801574707032593.829589843842.2},
{-794.987121582032621.288574218842.2},
}

addEventHandler("onClientMarkerHit"marker, function(elmd)
    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(localPlayermarkerthen 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"1100500)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb createBlipAttachedTo(dojsciem12)
    else
        outputChatBox("ju? pracujesz")
    end  
endaddEventHandler("onClientMarkerHit"getRootElement(), function(elmd) 
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(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end)


Postaw piwo autorowi tego posta
 

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


Qbiszon

Map editor






Wiek: 25
Na forum: 4176 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(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end

addEventHandler("onClientMarkerHit"getRootElement() dojsciemrampampam



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

Ten kod b?dzie dzia?a? ;)

local marker=createMarker(-786.566223144532598.917480468842.2"cylinder"2100500)
createBlipAttachedTo(marker52)

local miejsca = {
{-779.531066894532612.275878906342.2},
{-797.480285644532597.267089843842.2},
{-808.393371582032578.635253906342.2},
{-805.502922968752604.701904296942.2},
{-810.700012207032619.579589843842.2},
{-802.696105957032633.024902343842.2},
{-777.801574707032593.829589843842.2},
{-794.987121582032621.288574218842.2},
}

addEventHandler("onClientMarkerHit"marker, function(elmd)
    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(localPlayermarkerthen 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"1100500)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb createBlipAttachedTo(dojsciem12)
    else
        outputChatBox("ju? pracujesz")
    end  
endaddEventHandler("onClientMarkerHit"getRootElement(), function(elmd) 
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(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end)

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: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
To ju? musi lata?
local marker=createMarker(-786.566223144532598.917480468842.2"cylinder"2100500)
createBlipAttachedTo(marker52)

local miejsca = {
{-779.531066894532612.275878906342.2},
{-797.480285644532597.267089843842.2},
{-808.393371582032578.635253906342.2},
{-805.502922968752604.701904296942.2},
{-810.700012207032619.579589843842.2},
{-802.696105957032633.024902343842.2},
{-777.801574707032593.829589843842.2},
{-794.987121582032621.288574218842.2},
}

addEventHandler("onClientMarkerHit"marker, function(elmd)
    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(localPlayermarkerthen 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"1100500)
                setElementData(dojsciem,"marker_dojsciem",true)
                dojscieb createBlipAttachedTo(dojsciem12endaddEventHandler("onClientMarkerHit"getRootElement(), function(elmd) 
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(dojsciemdestroyElement(dojscieb)
 
setElementFrozen(localPlayertruesetPedAnimation localPlayer"BASEBALL""BAT_4"1,true outputChatBox("Kopiesz kamie?. "setTimer(function() 
setElementFrozen(localPlayerfalsesetPedAnimation(localPlayerfalseoutputChatBox("Wykopa?e? kamie?, wro? do miejsca zlecenia."setElementData(localPlayer"gracz_praca"falsetriggerServerEvent("givePlayerMoney"localPlayer350end30001end)


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