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: 2097 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.9700315.46506"cylinder"2255,255,255,20)
local sx,sy=guiGetScreenSize()
local w= (sx/1280),(sy/720)
local scalaczcionki = (w+h)*0.5
local sxsy guiGetScreenSize()
local screenWscreenH 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(722363476354":nrpg_interface/img/white123.png"000tocolor(255255255255), false)
    dxDrawImage(738421225152":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(733411235172":nrpg_interface/img/white123.png"000tocolor(333255), false)
    dxDrawImage(722363476354":nrpg_interface/img/white123.png"000tocolor(181717255), false)
    dxDrawImage(11653781817":bb/close.png"000tocolor(255255255255), false)
    dxDrawImage(743421223160":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(755431198142":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(80960930281":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(8236186762":bb/job.png"000tocolor(4118933255), false)
    dxDrawImage(7433772928":bb/job.png"000tocolor(255255255255), false)
    dxDrawText("Praca Konwojenta - RastRPG"7833801012415tocolor(255255255255), 1.40"default""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!"9684281169593tocolor(255255255255), 1.30"default""left""top"falsefalsefalsefalsefalse)
    dxDrawImage(9785356152":bb/tir.png"000tocolor(255255255255), false)
    dxDrawImage(10615355552":bb/paczka.png"000tocolor(255255255255), false)
    dxDrawText("Rozpocznij Prace!"9096341097700tocolor(255255255255), 1.70"default""left""top"falsefalsefalsefalsefalse)
end

function zaladunek()
    dxDrawImage(722363476354":nrpg_interface/img/white123.png"000tocolor(255255255255), false)
    dxDrawImage(738421225152":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(733411235172":nrpg_interface/img/white123.png"000tocolor(333255), false)
    dxDrawImage(722363476354":nrpg_interface/img/white123.png"000tocolor(181717255), false)
    dxDrawImage(11653781817":bb/close.png"000tocolor(255255255255), false)
    dxDrawImage(743421223160":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(755431198142":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(80960930281":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(8236186762":bb/job.png"000tocolor(4118933255), false)
    dxDrawImage(7433772928":bb/job.png"000tocolor(255255255255), false)
    dxDrawText("Praca Konwojenta - RastRPG"7833801012415tocolor(255255255255), 1.40"default""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!"9684281169593tocolor(255255255255), 1.30"default""left""top"falsefalsefalsefalsefalse)
    dxDrawImage(9785356152":bb/tir.png"000tocolor(255255255255), false)
    dxDrawImage(10615355552":bb/paczka.png"000tocolor(255255255255), false)
    dxDrawText("Rozpocznij Prace!"9096341097700tocolor(255255255255), 1.70"default""left""top"falsefalsefalsefalsefalse)
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"rootgui)
    showCursor(truefalse)


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(btnstate)
        if btn == "left" and state == "down" then
        if isMouseIn(screenW 0.4172screenH 0.5565screenW 0.1630screenH 0.0870) and gui1 then
         poka 1
         showCursor(false)
         gui1 false
         praca true
         triggerServerEvent("kstart"localPlayerlocalPlayer)
         zaladunek true
        end
    end
end)

function pokaz()
    if poka then
         local zaladunek=createMarker(-2540.57764, -28.4818815.43715"cylinder"2255,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: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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

function pokaz()
if poka == true then
local zaladunek=createMarker(-2540.57764, -28.4818815.43715"cylinder"2255,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: 2097 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.9700315.46506"cylinder"2255,255,255,20)
local sx,sy=guiGetScreenSize()
local w= (sx/1280),(sy/720)
local scalaczcionki = (w+h)*0.5
local sxsy guiGetScreenSize()
local screenWscreenH 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(722363476354":nrpg_interface/img/white123.png"000tocolor(255255255255), false)
    dxDrawImage(738421225152":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(733411235172":nrpg_interface/img/white123.png"000tocolor(333255), false)
    dxDrawImage(722363476354":nrpg_interface/img/white123.png"000tocolor(181717255), false)
    dxDrawImage(11653781817":bb/close.png"000tocolor(255255255255), false)
    dxDrawImage(743421223160":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(755431198142":bb/theme.png"000tocolor(255255255255), false)
    dxDrawImage(80960930281":nrpg_interface/img/white123.png"000tocolor(111111255), false)
    dxDrawImage(8236186762":bb/job.png"000tocolor(4118933255), false)
    dxDrawImage(7433772928":bb/job.png"000tocolor(255255255255), false)
    dxDrawText("Praca Konwojenta - RastRPG"7833801012415tocolor(255255255255), 1.40"default""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Praca polega na dostarczaniu\n banknot?w w poszczeg?lne\n bankomaty w San Andreas!"9684281169593tocolor(255255255255), 1.30"default""left""top"falsefalsefalsefalsefalse)
    dxDrawImage(9785356152":bb/tir.png"000tocolor(255255255255), false)
    dxDrawImage(10615355552":bb/paczka.png"000tocolor(255255255255), false)
    dxDrawText("Rozpocznij Prace!"9096341097700tocolor(255255255255), 1.70"default""left""top"falsefalsefalsefalsefalse)
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"rootgui)
    showCursor(truefalse)


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(btnstate)
        if btn == "left" and state == "down" then
        if isMouseIn(screenW 0.4172screenH 0.5565screenW 0.1630screenH 0.0870) and gui1 then
         poka true
         showCursor(false)
         gui1 false
         triggerServerEvent("kstart"localPlayerlocalPlayer)
        end
    end
end)

function pokaz()
    if poka == true then
    local zaladunek=createMarker(-2540.95898, -30.4969216.4607"cylinder"2255,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: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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: 2097 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