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

Wysłany: 2019-05-23, 17:17


KUNDEL69







Wiek: 33
Na forum: 2576 dni
Posty: 6



Respekt: 50

Witam!
Mam blad ze jak wje?d?am do markera z MK (takimi jakby boostami do auta) to wyskakuje to si? wszystkim. Chcia?bym ?eby si? to wy?wietla?o tylko temu co wjecha? w marker. Za pomoc daje piwo!

mk_c.lua
Kod:

GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(339, 179, 499, 460, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.83)

GUIEditor.button[1] = guiCreateButton(25, 37, 115, 58, "MK-1 Przy?pieszenie", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[2] = guiCreateButton(140, 37, 113, 58, "MK-1 Pr?dko??", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[3] = guiCreateButton(261, 38, 220, 57, "Demont", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[4] = guiCreateButton(25, 103, 115, 51, "MK-2 Przy?pieszenie", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[5] = guiCreateButton(138, 103, 115, 51, "MK-2 Pr?dko??", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[6] = guiCreateButton(260, 103, 221, 51, "Demont", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[7] = guiCreateButton(25, 161, 115, 50, "MK-3 Przy?pieszenie", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[8] = guiCreateButton(141, 160, 112, 51, "MK-3 Pr?dko??", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[9] = guiCreateButton(261, 162, 220, 49, "Demont", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[10] = guiCreateButton(62, 369, 383, 81, "Zamknij okno", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFAAAAAA")
end
)


addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)

marker = createMarker(90.33453, -307.32922, 0.55, 'cylinder', 5.0, 255, 170, 0, 150)

function hit()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEventHandler("onClientMarkerHit", marker, hit)



function mk1()
if source ~= GUIEditor.button[1] then return end
triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie
end

addEventHandler ( "onClientGUIClick", root, mk1)


function mk2()
if source ~= GUIEditor.button[2] then return end
triggerServerEvent("ZmienHandling2", localPlayer)--MK1 predko?c
end

addEventHandler ( "onClientGUIClick", root, mk2)

function mk3()
if source ~= GUIEditor.button[4] then return end
triggerServerEvent("ZmienHandling4", localPlayer)--MK2 przy?pieszenie
end

addEventHandler ( "onClientGUIClick", root, mk3)


function mk4()
if source ~= GUIEditor.button[5] then return end
triggerServerEvent("ZmienHandling5", localPlayer)--MK2 pr?dko??
end

addEventHandler ( "onClientGUIClick", root, mk4)


function mk5()
if source ~= GUIEditor.button[7] then return end
triggerServerEvent("ZmienHandling12", localPlayer)--MK3 przy?pieszenie
end

addEventHandler ( "onClientGUIClick", root, mk5)


function mk6()
if source ~= GUIEditor.button[8] then return end
triggerServerEvent("ZmienHandling11", localPlayer)--MK3 pr?dko??
end
addEventHandler ( "onClientGUIClick", root, mk6)



function zamknij()
if source ~= GUIEditor.button[10] then return end
guiSetVisible(GUIEditor.window[1], localPlayer)--MK3 pr?dko??
end
addEventHandler ( "onClientGUIClick", root, zamknij)


function zamykamy()
if source ~= GUIEditor.button[10] then return end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end

addEventHandler ( "onClientGUIClick", root, zamykamy)


mk_s.lua
Kod:

addEvent("ZmienHandling2", true)
addEventHandler("ZmienHandling2", root, function()
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 12000)
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

setVehicleHandling(pojazd, "maxVelocity", 200.0 )--MK1 Pr?dko??
setVehicleHandling(pojazd, "maxVelocity", velocity)
end
)


addEvent("ZmienHandling", true)
addEventHandler("ZmienHandling", root, function()
pojazd = getPedOccupiedVehicle(source)--MK 1 Przy?pieszenie
if not pojazd then return end
takePlayerMoney ( source, 12000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

local acceleration = 15.0
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end
)


addEvent("ZmienHandling5", true)
addEventHandler("ZmienHandling5", root, function()--MK2 Pr?dko??
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 160000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

setVehicleHandling(pojazd, "maxVelocity", 250.0 )
setVehicleHandling(pojazd, "maxVelocity", velocity)
end
)

addEvent("ZmienHandling4", true)
addEventHandler("ZmienHandling4", root, function()--MK2 Przy?pieszenie
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 160000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

local acceleration = 19.0
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end
)


addEvent("ZmienHandling5", true)
addEventHandler("ZmienHandling5", root, function()--MK2 Pr?dko??
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 220000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)
local acceleration = 30.0
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end
)

addEvent("ZmienHandling11", true)
addEventHandler("ZmienHandling11", root, function()
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 220000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)
setVehicleHandling(pojazd, "maxVelocity", 5000.0 )-- MK3 Pr?dko??
setVehicleHandling(pojazd, "maxVelocity", velocity)
end
)


addEvent("ZmienHandling12", true)
addEventHandler("ZmienHandling12", root, function()--MK3 Przy?pieszenie
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 220000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)
local acceleration = 30.0
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end
)



meta.xml
Kod:

<meta>
<info author="VenZ+Wicek7"/>
<script src="mk_s.lua" type="server" />
<script src="mk_c.lua" type="client" />
</meta>


SKRYPT NIE JEST M?J!!!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-23, 18:02


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Musisz sprawdzi?, czy pierwszy argument funkcji pod??czonej do eventu "onClientMarkerHit" jest lokalnym graczem.

Musi to wygl?da? tak (zmienna gracza zale?y od tego, jakiej u?y?e? w pierwszym argumencie):
if (hitPlayer == getLocalPlayer()) then
     guiSetVisible(xtrue)
     showCursor(true)
end

Je?li warunek zwr?ci warto?? pozytywn?, rysujesz okno GUI.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-23, 19:40


KUNDEL69







Wiek: 33
Na forum: 2576 dni
Posty: 6



Respekt: 50

Niestety jestem nowy w skryptach i nie wiem co masz na my?li i nie wiem jak to zrobi? :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-24, 07:38


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Tego pro?ciej si? nie da, hitElement znajdziesz tutaj, poczytaj CA?? stron?:

Więcej informacji znajdziesz w Wikipedii MTA:

onClientMarkerHit


Postaw piwo autorowi tego posta
 

 
Tagi: mkzgui
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