Wysłany: 2018-12-02, 16:06
manieks78
Lua ;)
Wiek: 25 Na forum: 3387 dni Posty: 97
Nick w MP: Hexan
Piwa : 5
Dlaczego zmienna markera, kt?r? zaznaczy?em nie dzia?a w eventHandlerze i jak temu zaradzi?, czy s? jakie? rozwi?zania?
Kod: GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(387, 190, 581, 408, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.button[1] = guiCreateButton(36, 45, 510, 50, "", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(36, 105, 510, 50, "", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(36, 165, 510, 50, "", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(36, 225, 510, 50, "", false, GUIEditor.window[1])
GUIEditor.button[5] = guiCreateButton(200, 356, 182, 42, "", false, GUIEditor.window[1])
guiSetText(GUIEditor.window[1], "Sprz?t Pa?stwowej Stra?y Po?arnej")
guiSetText(GUIEditor.button[1], "AODO")
guiSetText(GUIEditor.button[2], "Nomex")
guiSetText(GUIEditor.button[3], "Pi?a ?a?cuchowa")
guiSetText(GUIEditor.button[4], "Linia ga?nicza")
guiSetText(GUIEditor.button[5], "Zamknij")
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
)
local czy_jest = false;
function wypo()
if not isPedInVehicle(localPlayer) then
outputChatBox("Nie jeste? w pojezdzie!")
else
if czy_jest == true then
destroyElement(marker)
czy_jest = false
else
czy_jest = true
local vehicle = getPedOccupiedVehicle(localPlayer)
local x, y, z = getElementPosition(vehicle)
marker = createMarker(x, y, z, "cylinder", 1.2, 120, 120, 120, 255) -- Tutaj +++++++++++++++++++++
attachElements(marker, vehicle, 1.7, 0, -1.2)
triggerServerEvent("hit", localPlayer, marker)
end
end
end
addCommandHandler("sprzet", wypo)
function hit()
outputChatBox("Dzia?a")
end
addEventHandler("onClientMarkerHit", marker, hit) -- Tutaj ++++++++++++++++++++++++++++++++++++++++++++++
Podpis
Jeśli ci pomogłem wynagrodź mnie
Wysłany: 2018-12-02, 16:20
PolskiSebek12
Programista
Wiek: 28 Na forum: 4347 dni Posty: 343
Nick w MP: CrosRoad95
Piwa : 3883
`addEventHandler("onClientMarkerHit", marker, hit)` przenie? t? linie za
`marker = createMarker(x, y, z, "cylinder", 1.2, 120, 120, 120, 255) `
Więcej szczegółów
Wystawiono 1 piw(a):manieks78
Wysłany: 2018-12-02, 16:24
manieks78
Lua ;)
Wiek: 25 Na forum: 3387 dni Posty: 97
Nick w MP: Hexan
Piwa : 5
Dzi?ki wielkie, nie mia?em poj?cia, ?e takie cuda mo?na robi? w LUA. Do zamkni?cia.
Podpis
Jeśli ci pomogłem wynagrodź mnie
Tagi: nie :: działa :: zmienna
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: