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??.
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.
markera nie widac poniewa? to strona clienta i wartosc tego jest = nil
polecam zrobic tak
tworzenie markera > sprawdzanie > triggerowanie na strone clienta > otwieranie gui
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.
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)
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)
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