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

Wysłany: 2016-08-08, 17:50


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
nie widz? markera w kt?rym wy?wietla si? GUI , wiem i znam pozycje markera , bo sam je ustala?em . My?l? ,?e gdzie? jest drobny b??d i nie potrafi?go znale??.


addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
    guiSetVisible(napad, false)
    guiWindowSetSizable(napad, false)
    guiSetAlpha(napad, 0.58)
    guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
    buttak = guiCreateButton(568, 321, 77, 30, "Ak 47", false, napad)
    buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
    buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
    buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    
end)

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

addEventHandler("onClientMarkerHit", marker, 
    function(hitElement, md)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napad, true)
    showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end
function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 355.66522, 199.38464, 23.20708)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayer, marker) then
            dff = engineLoadDFF ( "ak47.dff", 355 )
            engineReplaceModel ( dff, 355 )
            txd = engineLoadTXD ( "ak47.txd" )
            engineImportTXD ( txd, 355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napad, false)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick", root, podmien)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 17:51


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8


local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder",1,255,255,255)


Brakowa?o argument?w

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 18:00


GabWas







Wiek: 24
Na forum: 4022 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5

"marcin778" napisał/a:


local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder",1,255,255,255)


Brakowa?o argument?w

Polecam zobaczy? wymagane argumenty w funkcji createMarker oraz dowiedzie? si? co znaczy s?owo "opcjonalne".

Więcej informacji znajdziesz w Wikipedii MTA:

createMarker


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 20:36


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
marcin778, nadal nie dzia?a , w sensie , nie ma markera

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 20:48


Filipovsky

uczeń LUA <3






Wiek: 46
Na forum: 4106 dni
Posty: 24
Nick w MP: Filipovsky

Piwa: 2

Respekt: 60

spr?buj doda? spacje miedzy "=", lub liczbami, a ale najprawdopodobniej chodzi o ten = cho? nie jestem pewien czy to pomo?e, a jak nie to spr?buj przesun?? marker na sam pocz?tek kodu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 22:31


xHardus







Wiek: 28
Na forum: 4927 dni
Posty: 90
Nick w MP: Harduś

Piwa: 786

Respekt: 15,3

markera nie widac poniewa? to strona clienta i wartosc tego jest = nil
polecam zrobic tak
tworzenie markera > sprawdzanie > triggerowanie na strone clienta > otwieranie gui

https://wiki.multitheftauto.com/wiki/OnMarkerHit
https://wiki.multitheftauto.com/wiki/TriggerClientEvent

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
psychol.
Wysłany: 2016-08-08, 23:29


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
rafox12345,
czyli tak ? Sprawd? czy dobrze ci? zrozumia?em .

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
    guiSetVisible(napad, false)
    guiWindowSetSizable(napad, false)
    guiSetAlpha(napad, 0.58)
    guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
    buttak = guiCreateButton(568, 321, 77, 30, "Ak 47", false, napad)
    buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
    buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
    buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    
end)

function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 355.66522, 199.38464, 23.20708)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayer, marker) then
            dff = engineLoadDFF ( "ak47.dff", 355 )
            engineReplaceModel ( dff, 355 )
            txd = engineLoadTXD ( "ak47.txd" )
            engineImportTXD ( txd, 355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napad, false)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick", root, podmien)


Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-09, 04:28


.RiV







Wiek: 26
Na forum: 3729 dni
Posty: 554
Nick w MP: Split

Piwa: 2598

Respekt: 597,8
Respekt: 597,8

MartinPanZycia, Spr?buj tak:


addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
    guiSetVisible(napad, false)
    guiWindowSetSizable(napad, false)
    guiSetAlpha(napad, 0.58)
    guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
    buttak = guiCreateButton(568, 321, 77, 30, "Ak 47", false, napad)
    buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
    buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
    buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    
end)

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder", 1, 255, 0, 0)

addEventHandler("onClientMarkerHit", marker, 
    function(hitElement, md)
    if hitElement ~= localPlayer then return end
    if not md then return end
    guiSetVisible(napad, true)
    showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end
function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 355.66522, 199.38464, 23.20708)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayer, marker) then
            dff = engineLoadDFF ( "ak47.dff", 355 )
            engineReplaceModel ( dff, 355 )
            txd = engineLoadTXD ( "ak47.txd" )
            engineImportTXD ( txd, 355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napad, false)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick", root, podmien)


Nie jestem pewien ?e to zadzia?a, nie testowane.

Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-09, 10:23


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
.WhiteBlue, nadal nie widz? markera .

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-09, 10:48


AteX







Wiek: 27
Na forum: 4156 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

W funkcji podmien brakowa?o jednego end'a. Debugscript jest bardzo pomocne.
addEventHandler("onClientResourceStart", root, function()
    napad = guiCreateWindow(438, 185, 467, 306, "Potwied? Napad na Bank", false)
    guiSetVisible(napad, false)
    guiWindowSetSizable(napad, false)
    guiSetAlpha(napad, 0.58)
    guiSetProperty(napad, "CaptionColour", "FFFEFEFE")
    buttak = guiCreateButton(568, 321, 77, 30, "Ak 47", false, napad)
    buttonEmpty = guiCreateButton(194, 129, 15, 15, "", false, napad)
    buttonAccept = guiCreateButton(20, 233, 119, 52, "Akceptuj?", false, napad)
    buttonRefuse = guiCreateButton(317, 234, 140, 61, "Odrzu?", false, napad)    
end)

local marker = createMarker(1821.38318, -1683.33215, 13.38281 , "cylinder")

addEventHandler("onClientMarkerHit", marker, 
    function(hitElement, md)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napad, true)
    showCursor(true, false)
end)

addEventHandler("onClientGUIClick", root, function(btn, state)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napad, false)
      showCursor(false)
   end
 end
end)

function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker") then
        return false
    end
    local markerColShape = getElementColShape(marker)
    local elements = getElementsWithinColShape(markerColShape)
    return elements
end
function accept()
if source == buttonAccept then
local element = getElementsWithinMarker(marker)
for i,v in ipairs(element) do
local poz = setElementPosition(v, 355.66522, 199.38464, 23.20708)
local gp = getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napad, false)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayer, marker) then
            dff = engineLoadDFF ( "ak47.dff", 355 )
            engineReplaceModel ( dff, 355 )
            txd = engineLoadTXD ( "ak47.txd" )
            engineImportTXD ( txd, 355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napad, false)
            showCursor(false)
        end
        end
    end
end
addEventHandler("onClientGUIClick", root, podmien)


Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-09, 13:33


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3869 dni
Posty: 477
Nick w MP: Rodzaje

Piwa: 877

Respekt: 70,5

Ostrzeżeń: 40%
AteX, I to jest cz?owiek kt?ry mi pom?g? , dzi?kuj? bardzo :piwo: :piwo:

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: widzę :: markera
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie widzę markera 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