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

Wysłany: 2018-02-28, 16:19


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

Witam mam pewien problem, poniewa? kiedy wjad? autem w ten marker lub nawet kiedy opu?ci?em pojazd, to nic si? nie wykonuje.

function marker22(thePlayer)
    pojazd getPedOccupiedVehicle(thePlayer)
    setElementFrozen(pojazdtrue)
    setTimer ( function()
    setElementFrozen(pojazdfalse)
    marker4 createMarker(-2662.444821383.672977.18802+1"cylinder"3272727130)
    blip createBlip(-2662.444821383.672977.188020)
    destroyElement marker1 )
    destroyElement marker2 )
    end1000*10)
    addEventHandler("onClientMarkerHit"marker4marker23)
end

function marker23(thePlayer)
    if thePlayer ~= localPlayer then return end
    pojazd1 getPedOccupiedVehicle(thePlayer)
    destroyElement(pojazd1)
    destroyElement(blip)
    destroyElement(marker4)
    setElementPosition (thePlayer,  -1013.84943, -692.7939532.00781)
end


Za pomoc jak zawsze, respekt i zimne piwerko :D

[ Dodano: 2018-02-28, 16:20 ]
Znaczy to jest tak, ?e funkcja marker22 si? wykonuje, a funkcja marker23 ju? nie :(

Ostatnio zmieniony przez Dexnes_ 2018-02-28, 22:35, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-28, 17:15


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8


function marker22(thePlayer) 
    pojazd getPedOccupiedVehicle(thePlayer) 
    if pojazd then
        setElementFrozen(pojazdtrue) 
        setTimer ( function() 
            setElementFrozen(pojazdfalse) 
            marker4 createMarker(-2662.444821383.672977.18802+1"cylinder"3272727130) 
            blip createBlip(-2662.444821383.672977.188020) 
            destroyElement marker1 ) 
            destroyElement marker2 ) 
        end1000*10) 
        addEventHandler("onClientMarkerHit"marker4marker23)
    end
end 

function marker23(thePlayer) 
    if thePlayer ~= localPlayer then return end  --b?dusutoje?eli nadal nie b?dzie dzia?a?
    pojazd1 getPedOccupiedVehicle(thePlayer) 
    if pojazd1 then
        destroyElement(pojazd1) 
        destroyElement(blip) 
        destroyElement(marker4) 
        setElementPosition (thePlayer, -1013.84943, -692.7939532.00781) 
    end
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
manieks78
Wysłany: 2018-02-28, 17:22


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

marker22 dzia?a ale marker23 nie :(
Mo?e poka?e ca?y c_side
Kod:

local marker = createMarker ( -993.02332, -696.31921, 32.00781-0.89, "cylinder", 1, 27, 27, 27, 130 )
function renderDX()
dxDrawRectangle(396, 244, 472, 283, tocolor(28, 28, 27, 255), false)
dxDrawLine(419 - 1, 244 - 1, 419 - 1, 527, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(844, 244 - 1, 419 - 1, 244 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(419 - 1, 527, 844, 527, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(844, 527, 844, 244 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawRectangle(419, 244, 425, 283, tocolor(54, 54, 52, 255), false)
dxDrawRectangle(379, 244, 0, 40, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(442, 471, 145, 36, tocolor(27, 27, 27, 255), false)
dxDrawRectangle(677, 471, 145, 36, tocolor(27, 27, 27, 255), false)
dxDrawText("Rozpocznij", 444, 475, 587, 503, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Zamknij", 679, 475, 822, 503, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Praca Dorywcza Betoniarka \n\nZarobki: 300 - 400 \n\nOpis:\n\n Po kliknieciu w przycisk ,,Rozpocznij'' zostaniesz przeniesiony \n za kierownice ogromnej maszyny i twoim zadaniem \n bedzie dojechanie do wyznaczonego miejsca \n na mapie", 417, 251, 844, 408, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end

function hit(hitPlayer)
if hitPlayer ~= localPlayer then return end
showGUI(true)
end
addEventHandler ( "onClientMarkerHit", marker, hit )

addEventHandler ("onClientClick", root, function(btn,state)
if btn == "left" and state == "up" then
if isMouseInPosition(677, 471, 145, 36) then
showGUI(false)
end
end
end)

addEventHandler ("onClientClick", root, function(btn,state)
if btn == "left" and state == "up" then
if isMouseInPosition(442, 471, 145, 36) then
showGUI(false)
triggerServerEvent("zacznij", localPlayer)
outputChatBox("Wjedz w marker, aby zaladowac beton", 255, 255, 255, false)
addEventHandler ( "onClientMarkerHit", marker1, zaladuj )
marker1 = createMarker ( -1013.84943, -692.79395, 32.00781-0.89, "cylinder", 3, 27, 27, 27, 130 )
marker2 = createMarker ( -1013.84943, -692.79395, 32.00781+1, "cylinder", 3, 27, 27, 27, 130 )
addEventHandler("onClientMarkerHit", marker2, marker22)
end
end
end)

function showGUI(value)
if value then
showCursor(true)
addEventHandler("onClientRender", root, renderDX)
else
showCursor(false)
removeEventHandler("onClientRender", root, renderDX)
end
end
function isMouseInPosition(x,y,width,height)
if not isCursorShowing() then return false end

local sx,sy = guiGetScreenSize()
local cx,cy = getCursorPosition()
local cx,cy = (cx * sx), (cy * sy)
if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
return true
else
return false
end
end

function marker22(thePlayer)
pojazd = getPedOccupiedVehicle(thePlayer)
if pojazd then
setElementFrozen(pojazd, true)
setTimer ( function()
setElementFrozen(pojazd, false)
marker4 = createMarker(-2662.44482, 1383.67297, 7.18802+1, "cylinder", 3, 27, 27, 27, 130)
blip = createBlip(-2662.44482, 1383.67297, 7.18802, 0)
destroyElement ( marker1 )
destroyElement ( marker2 )
end, 1000*10, 1 )
addEventHandler("onClientMarkerHit", marker4, marker23)
end
end

function marker23(thePlayer)
pojazd1 = getPedOccupiedVehicle(thePlayer)
if pojazd1 then
destroyElement(pojazd1)
destroyElement(blip)
destroyElement(marker4)
setElementPosition (thePlayer, -1013.84943, -692.79395, 32.00781)
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-28, 17:30


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"manieks78" napisał/a:

marker22 dzia?a ale marker23 nie :(
Mo?e poka?e ca?y c_side
Kod:

local marker = createMarker ( -993.02332, -696.31921, 32.00781-0.89, "cylinder", 1, 27, 27, 27, 130 )
function renderDX()
dxDrawRectangle(396, 244, 472, 283, tocolor(28, 28, 27, 255), false)
dxDrawLine(419 - 1, 244 - 1, 419 - 1, 527, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(844, 244 - 1, 419 - 1, 244 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(419 - 1, 527, 844, 527, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(844, 527, 844, 244 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawRectangle(419, 244, 425, 283, tocolor(54, 54, 52, 255), false)
dxDrawRectangle(379, 244, 0, 40, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(442, 471, 145, 36, tocolor(27, 27, 27, 255), false)
dxDrawRectangle(677, 471, 145, 36, tocolor(27, 27, 27, 255), false)
dxDrawText("Rozpocznij", 444, 475, 587, 503, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Zamknij", 679, 475, 822, 503, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Praca Dorywcza Betoniarka \n\nZarobki: 300 - 400 \n\nOpis:\n\n Po kliknieciu w przycisk ,,Rozpocznij'' zostaniesz przeniesiony \n za kierownice ogromnej maszyny i twoim zadaniem \n bedzie dojechanie do wyznaczonego miejsca \n na mapie", 417, 251, 844, 408, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end

function hit(hitPlayer)
if hitPlayer ~= localPlayer then return end
showGUI(true)
end
addEventHandler ( "onClientMarkerHit", marker, hit )

addEventHandler ("onClientClick", root, function(btn,state)
if btn == "left" and state == "up" then
if isMouseInPosition(677, 471, 145, 36) then
showGUI(false)
end
end
end)

addEventHandler ("onClientClick", root, function(btn,state)
if btn == "left" and state == "up" then
if isMouseInPosition(442, 471, 145, 36) then
showGUI(false)
triggerServerEvent("zacznij", localPlayer)
outputChatBox("Wjedz w marker, aby zaladowac beton", 255, 255, 255, false)
addEventHandler ( "onClientMarkerHit", marker1, zaladuj )
marker1 = createMarker ( -1013.84943, -692.79395, 32.00781-0.89, "cylinder", 3, 27, 27, 27, 130 )
marker2 = createMarker ( -1013.84943, -692.79395, 32.00781+1, "cylinder", 3, 27, 27, 27, 130 )
addEventHandler("onClientMarkerHit", marker2, marker22)
end
end
end)

function showGUI(value)
if value then
showCursor(true)
addEventHandler("onClientRender", root, renderDX)
else
showCursor(false)
removeEventHandler("onClientRender", root, renderDX)
end
end
function isMouseInPosition(x,y,width,height)
if not isCursorShowing() then return false end

local sx,sy = guiGetScreenSize()
local cx,cy = getCursorPosition()
local cx,cy = (cx * sx), (cy * sy)
if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
return true
else
return false
end
end

function marker22(thePlayer)
pojazd = getPedOccupiedVehicle(thePlayer)
if pojazd then
setElementFrozen(pojazd, true)
setTimer ( function()
setElementFrozen(pojazd, false)
marker4 = createMarker(-2662.44482, 1383.67297, 7.18802+1, "cylinder", 3, 27, 27, 27, 130)
blip = createBlip(-2662.44482, 1383.67297, 7.18802, 0)
destroyElement ( marker1 )
destroyElement ( marker2 )
end, 1000*10, 1 )
addEventHandler("onClientMarkerHit", marker4, marker23)
end
end

function marker23(thePlayer)
pojazd1 = getPedOccupiedVehicle(thePlayer)
if pojazd1 then
destroyElement(pojazd1)
destroyElement(blip)
destroyElement(marker4)
setElementPosition (thePlayer, -1013.84943, -692.79395, 32.00781)
end
end


A, po stronie servera? Bo gdy wejd? w ten marker to potrzebuj? triggerowania z servera

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-28, 17:45


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

Zaraz dam stron? servera, bo tam tylko jest createVehicle + warpPlayerIntoVehicle
addEvent("zacznij"true)
addEventHandler("zacznij"root, function()
    local pojazd createVehicle524,-1005.95380, -695.2354732.00781 )
    warpPedIntoVehicle (sourcepojazd)
end
)


[ Dodano: 2018-02-28, 17:47 ]
Pomo?e kto?? :(

Postaw piwo autorowi tego posta
 

 
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Niewykonujący się kod 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