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

Wysłany: 2022-03-30, 17:32


lego15







Wiek: 26
Na forum: 2238 dni
Posty: 21
Nick w MP: popoq

Piwa: 10

Respekt: 50

Witam mam problem, nie dzia?a mi funkcja pokaz wie kto? co jest przyczyn? ?
gdy klikne przycisk event serwerowy dzia?a normalnie ( tworzy pojazd ) a marker (zaladunek) si? nie pojazuje. Z g?ry dzi?ki.


local marker=createMarker(-2544.27661, -34.97003, 15.46506, "cylinder", 2, 255,255,255,20)
local sx,sy=guiGetScreenSize()
local w, h = (sx/1280),(sy/720)
local scalaczcionki = (w+h)*0.5
local sx, sy = guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()
local Player = getLocalPlayer()
local pojazd = getPedOccupiedVehicle(Player)



function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end



function gui()
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(738, 421, 225, 152, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(733, 411, 235, 172, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(3, 3, 3, 255), false)
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(18, 17, 17, 255), false)
    dxDrawImage(1165, 378, 18, 17, ":bb/close.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(743, 421, 223, 160, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(755, 431, 198, 142, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(809, 609, 302, 81, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(823, 618, 67, 62, ":bb/job.png", 0, 0, 0, tocolor(41, 189, 33, 255), false)
    dxDrawImage(743, 377, 29, 28, ":bb/job.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Praca Konwojenta - RastRPG", 783, 380, 1012, 415, tocolor(255, 255, 255, 255), 1.40, "default", "left", "top", false, false, false, false, false)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!", 968, 428, 1169, 593, tocolor(255, 255, 255, 255), 1.30, "default", "left", "top", false, false, false, false, false)
    dxDrawImage(978, 535, 61, 52, ":bb/tir.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(1061, 535, 55, 52, ":bb/paczka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Rozpocznij Prace!", 909, 634, 1097, 700, tocolor(255, 255, 255, 255), 1.70, "default", "left", "top", false, false, false, false, false)
end

function zaladunek()
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(738, 421, 225, 152, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(733, 411, 235, 172, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(3, 3, 3, 255), false)
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(18, 17, 17, 255), false)
    dxDrawImage(1165, 378, 18, 17, ":bb/close.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(743, 421, 223, 160, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(755, 431, 198, 142, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(809, 609, 302, 81, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(823, 618, 67, 62, ":bb/job.png", 0, 0, 0, tocolor(41, 189, 33, 255), false)
    dxDrawImage(743, 377, 29, 28, ":bb/job.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Praca Konwojenta - RastRPG", 783, 380, 1012, 415, tocolor(255, 255, 255, 255), 1.40, "default", "left", "top", false, false, false, false, false)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!", 968, 428, 1169, 593, tocolor(255, 255, 255, 255), 1.30, "default", "left", "top", false, false, false, false, false)
    dxDrawImage(978, 535, 61, 52, ":bb/tir.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(1061, 535, 55, 52, ":bb/paczka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Rozpocznij Prace!", 909, 634, 1097, 700, tocolor(255, 255, 255, 255), 1.70, "default", "left", "top", false, false, false, false, false)
end

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


addEventHandler("onClientMarkerHit", marker, function(el)
    gui1 = true
    addEventHandler("onClientRender", root, gui)
    showCursor(true, false)


addEventHandler("onClientMarkerLeave", resourceRoot, function(el)
    gui1 = false
    if el ~= localPlayer then return end
    removeEventHandler("onClientRender", getRootElement(), gui)
    showCursor(false)
    end)
end)
   
addEventHandler("onClientClick", root, function(btn, state)
        if btn == "left" and state == "down" then
        if isMouseIn(screenW * 0.4172, screenH * 0.5565, screenW * 0.1630, screenH * 0.0870) and gui1 then
         poka = 1
         showCursor(false)
         gui1 = false
         praca = true
         triggerServerEvent("kstart", localPlayer, localPlayer)
         zaladunek = true
        end
    end
end)

function pokaz()
    if poka then
         local zaladunek=createMarker(-2540.57764, -28.48188, 15.43715, "cylinder", 2, 255,255,255,20)
    end
end


Ostatnio zmieniony przez _jvneczek 2022-03-30, 18:10, w całości zmieniany 3 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-30, 17:39


TheSebaPL

Mod-team






Wiek: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

function pokaz()
if poka == true then
local zaladunek=createMarker(-2540.57764, -28.48188, 15.43715, "cylinder", 2, 255,255,255,20)
end
end


I do onClientClick dodaj:
poka = true


Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-30, 17:52


lego15







Wiek: 26
Na forum: 2238 dni
Posty: 21
Nick w MP: popoq

Piwa: 10

Respekt: 50

nadal nic...
dam ci ca?y kod mo?e zobaczysz co jest nie tak.

local marker=createMarker(-2544.27661, -34.97003, 15.46506, "cylinder", 2, 255,255,255,20)
local sx,sy=guiGetScreenSize()
local w, h = (sx/1280),(sy/720)
local scalaczcionki = (w+h)*0.5
local sx, sy = guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()
local Player = getLocalPlayer()
local pojazd = getPedOccupiedVehicle(Player)



function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end



function gui()
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(738, 421, 225, 152, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(733, 411, 235, 172, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(3, 3, 3, 255), false)
    dxDrawImage(722, 363, 476, 354, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(18, 17, 17, 255), false)
    dxDrawImage(1165, 378, 18, 17, ":bb/close.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(743, 421, 223, 160, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(755, 431, 198, 142, ":bb/theme.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(809, 609, 302, 81, ":nrpg_interface/img/white123.png", 0, 0, 0, tocolor(11, 11, 11, 255), false)
    dxDrawImage(823, 618, 67, 62, ":bb/job.png", 0, 0, 0, tocolor(41, 189, 33, 255), false)
    dxDrawImage(743, 377, 29, 28, ":bb/job.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Praca Konwojenta - RastRPG", 783, 380, 1012, 415, tocolor(255, 255, 255, 255), 1.40, "default", "left", "top", false, false, false, false, false)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!", 968, 428, 1169, 593, tocolor(255, 255, 255, 255), 1.30, "default", "left", "top", false, false, false, false, false)
    dxDrawImage(978, 535, 61, 52, ":bb/tir.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(1061, 535, 55, 52, ":bb/paczka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawText("Rozpocznij Prace!", 909, 634, 1097, 700, tocolor(255, 255, 255, 255), 1.70, "default", "left", "top", false, false, false, false, false)
end


function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


addEventHandler("onClientMarkerHit", marker, function(el)
    gui1 = true
    addEventHandler("onClientRender", root, gui)
    showCursor(true, false)


addEventHandler("onClientMarkerLeave", resourceRoot, function(el)
    gui1 = false
    if el ~= localPlayer then return end
    removeEventHandler("onClientRender", getRootElement(), gui)
    showCursor(false)
    end)
end)
   
addEventHandler("onClientClick", root, function(btn, state)
        if btn == "left" and state == "down" then
        if isMouseIn(screenW * 0.4172, screenH * 0.5565, screenW * 0.1630, screenH * 0.0870) and gui1 then
         poka = true
         showCursor(false)
         gui1 = false
         triggerServerEvent("kstart", localPlayer, localPlayer)
        end
    end
end)

function pokaz()
    if poka == true then
    local zaladunek=createMarker(-2540.95898, -30.49692, 16.4607, "cylinder", 2, 255,255,255,20)
    end
end


Dodano: 2022-03-30, 17:52
sorry ?e bez znacznika ale nie mam poj?cia jak si? go daje

Ostatnio zmieniony przez Nexisten 2022-03-31, 12:10, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-30, 18:05


TheSebaPL

Mod-team






Wiek: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

A b??dy w debugscript 3?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-03-30, 18:08


lego15







Wiek: 26
Na forum: 2238 dni
Posty: 21
Nick w MP: popoq

Piwa: 10

Respekt: 50

nie ma nic na ten temat

Postaw piwo autorowi tego posta
 

 
Tagi: kłopoty :: markerek
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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