Nie, chodzi mi o to ?e po wej?ciu w marker w??cza si? animacja i z automatu si? wy??cza, a chc? aby ona trwa?a 5 sekund i wtedy pu?ci?a, a ty zastosowa?e? zamra?anie Samochodu. Mog? poprostu veh zamieni? na LocalPlayer?
[ Dodano: 2019-04-09, 02:03 ]
w Sumie zauwazy?em ?e tw?j kod nie r??ni si? niczym od mojego, m?j b??d. Nie rozumiem co zmieni?e?.
?eby gracz nie m?g? przerwa? animacji (domy?lam si?, ?e anulujesz animacje backspacem albo enterem) musisz w funkcji od wy?ej wymienionych klawiszy zablokowa? mo?liwo?? anulowania animacji podczas tej pracy.
Poka? sw?j kod animacji, je?li chcesz zablokowa? mo?liwo?? przerwania animacji.
Troch? mas?o ma?lane, ale wola?em tak napisa?, ?eby? ?atwo zrozumia?.
?eby animacja si? nie wy??cza?a automatycznie, podmie? sobie ten kod:
bindKey("mouse1", "down", function()
if not getElementData(localPlayer, "gui:listonosz") or getElementData(localPlayer, "gui:listonosz") ~= true then return end
if isMouseIn(404*px, 447*py, 227*px, 38*py) then
zrobione = 0
triggerServerEvent("create:listonosz", localPlayer)
showCursor(false)
setElementData(localPlayer, "gui:listonosz", nil)
setElementData(localPlayer, "praca", "listonosz")
for i,v in ipairs(punktyListonosza) do
local markerList = createMarker(v[1], v[2], v[3]-1, "cylinder", 1, 29, 10 ,100)
local blipList = createBlipAttachedTo(markerList, 41)
addEventHandler("onClientMarkerHit", markerList, function(hit)
--setPedAnimation(localPlayer,"COP_AMBIENT", "Copbrowse_nod", -1, true, false )
if hit ~= localPlayer then return end
if isPedInVehicle(localPlayer) then outputChatBox("Nie mo?esz siedzie? w poje?dzie!", 255, 0, 0) return end
zrobione = zrobione+1
destroyElement(source)
destroyElement(blipList)
triggerServerEvent("anim", localPlayer, true)
outputChatBox("Odniesiono list do skrzynki, wykonano: "..tostring(zrobione).."/3")
setElementFrozen(veh, true)
setTimer ( function()
triggerServerEvent("anim", localPlayer, false)
end, 5000, 1 )
Przeczytaj m?j post jeszcze raz, obja?ni?em jak rozwi?za? mo?liwo?? zatrzymania animacj:
?eby gracz nie m?g? przerwa? animacji (domy?lam si?, ?e anulujesz animacje backspacem albo enterem) musisz w funkcji od wy?ej wymienionych klawiszy zablokowa? mo?liwo?? anulowania animacji podczas tej pracy.
Poka? sw?j kod animacji, je?li chcesz zablokowa? mo?liwo?? przerwania animacji.
Spr?buj podmieni? kod i daj zna?:
bindKey("mouse1", "down", function()
if not getElementData(localPlayer, "gui:listonosz") or getElementData(localPlayer, "gui:listonosz") ~= true then return end
if isMouseIn(404*px, 447*py, 227*px, 38*py) then
zrobione = 0
triggerServerEvent("create:listonosz", localPlayer)
showCursor(false)
setElementData(localPlayer, "gui:listonosz", nil)
setElementData(localPlayer, "praca", "listonosz")
for i,v in ipairs(punktyListonosza) do
local markerList = createMarker(v[1], v[2], v[3]-1, "cylinder", 1, 29, 10 ,100)
local blipList = createBlipAttachedTo(markerList, 41)
addEventHandler("onClientMarkerHit", markerList, function(hit)
--setPedAnimation(localPlayer,"COP_AMBIENT", "Copbrowse_nod", -1, true, false )
if hit ~= localPlayer then return end
if isPedInVehicle(localPlayer) then outputChatBox("Nie mo?esz siedzie? w poje?dzie!", 255, 0, 0) return end
zrobione = zrobione+1
destroyElement(source)
destroyElement(blipList)
triggerServerEvent("anim", localPlayer, true)
outputChatBox("Odniesiono list do skrzynki, wykonano: "..tostring(zrobione).."/3")
setElementFrozen(veh, true)
setTimer ( function(gracz)
triggerServerEvent("anim", gracz, false)
end, 5000, 1, hit )
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