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: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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(438185467306"Potwied? Napad na Bank"false)
    guiSetVisible(napadfalse)
    guiWindowSetSizable(napadfalse)
    guiSetAlpha(napad0.58)
    guiSetProperty(napad"CaptionColour""FFFEFEFE")
    buttak guiCreateButton(5683217730"Ak 47"falsenapad)
    buttonEmpty guiCreateButton(1941291515""falsenapad)
    buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
    buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    
end)

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")

addEventHandler("onClientMarkerHit"marker, 
    function(hitElementmd)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napadtrue)
    showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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(v355.66522199.3846423.20708)
local gp getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napadfalse)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayermarkerthen
            dff engineLoadDFF "ak47.dff"355 )
            engineReplaceModel dff355 )
            txd engineLoadTXD "ak47.txd" )
            engineImportTXD txd355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napadfalse)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick"rootpodmien)


Postaw piwo autorowi tego posta
 

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


marcin778

Krytyk serwerów MTA






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

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


local marker createMarker(1821.38318, -1683.3321513.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: 3881 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.3321513.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: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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: 45
Na forum: 3965 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: 27
Na forum: 4787 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: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

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

local marker createMarker(1821.38318, -1683.3321513.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(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      showCursor(false)
   end
 end
end)

addEventHandler("onClientResourceStart"root, function()
    napad guiCreateWindow(438185467306"Potwied? Napad na Bank"false)
    guiSetVisible(napadfalse)
    guiWindowSetSizable(napadfalse)
    guiSetAlpha(napad0.58)
    guiSetProperty(napad"CaptionColour""FFFEFEFE")
    buttak guiCreateButton(5683217730"Ak 47"falsenapad)
    buttonEmpty guiCreateButton(1941291515""falsenapad)
    buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
    buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    
end)

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

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayermarkerthen
            dff engineLoadDFF "ak47.dff"355 )
            engineReplaceModel dff355 )
            txd engineLoadTXD "ak47.txd" )
            engineImportTXD txd355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napadfalse)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick"rootpodmien)


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: 25
Na forum: 3588 dni
Posty: 554
Nick w MP: Split

Piwa: 2596

Respekt: 597,8
Respekt: 597,8

MartinPanZycia, Spr?buj tak:


addEventHandler("onClientResourceStart"root, function()
    napad guiCreateWindow(438185467306"Potwied? Napad na Bank"false)
    guiSetVisible(napadfalse)
    guiWindowSetSizable(napadfalse)
    guiSetAlpha(napad0.58)
    guiSetProperty(napad"CaptionColour""FFFEFEFE")
    buttak guiCreateButton(5683217730"Ak 47"falsenapad)
    buttonEmpty guiCreateButton(1941291515""falsenapad)
    buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
    buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    
end)

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder"125500)

addEventHandler("onClientMarkerHit"marker, 
    function(hitElementmd)
    if hitElement ~= localPlayer then return end
    if not md then return end
    guiSetVisible(napadtrue)
    showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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(v355.66522199.3846423.20708)
local gp getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napadfalse)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayermarkerthen
            dff engineLoadDFF "ak47.dff"355 )
            engineReplaceModel dff355 )
            txd engineLoadTXD "ak47.txd" )
            engineImportTXD txd355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napadfalse)
            showCursor(false)
        end
    end
end
addEventHandler("onClientGUIClick"rootpodmien)


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: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

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(438185467306"Potwied? Napad na Bank"false)
    guiSetVisible(napadfalse)
    guiWindowSetSizable(napadfalse)
    guiSetAlpha(napad0.58)
    guiSetProperty(napad"CaptionColour""FFFEFEFE")
    buttak guiCreateButton(5683217730"Ak 47"falsenapad)
    buttonEmpty guiCreateButton(1941291515""falsenapad)
    buttonAccept guiCreateButton(2023311952"Akceptuj?"falsenapad)
    buttonRefuse guiCreateButton(31723414061"Odrzu?"falsenapad)    
end)

local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")

addEventHandler("onClientMarkerHit"marker, 
    function(hitElementmd)
    if hitElement ~= localPlayer then return end
    if not md then return end
    if source ~= marker then return end
    guiSetVisible(napadtrue)
    showCursor(truefalse)
end)

addEventHandler("onClientGUIClick"root, function(btnstate)
 if btn == "left" and state == "up" then
   if source == buttonRefuse then
      guiSetVisible(napadfalse)
      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(v355.66522199.3846423.20708)
local gp getElementPosition(v)
end
if gp == poz then
if guiGetVisible(napad) == true then
guiSetVisible(napadfalse)
showCursor(false)
end
end
end
end
addEventHandler("onClientGUIClick",root,accept)

function podmien()
    if source == buttak then
            if isElementWithinMarker(localPlayermarkerthen
            dff engineLoadDFF "ak47.dff"355 )
            engineReplaceModel dff355 )
            txd engineLoadTXD "ak47.txd" )
            engineImportTXD txd355 )
            if guiGetVisible(napad) == true then
            guiSetVisible(napadfalse)
            showCursor(false)
        end
        end
    end
end
addEventHandler("onClientGUIClick"rootpodmien)


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: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

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