Multi Posted November 12, 2013 Posted November 12, 2013 Hello i was try to make a GUI witch 2 buttons that Close an Life rof example if you click Close Gui close easy, but if i was do a Life button i want to make that create marker in different place and you must go there for the LIfe but i have problem because evrything working but if you go to marker you will not haver a 100% live. Code: function kl() if (source == sf) then local niet = createMarker ( -1124.6586914063, -1009.0390625, 129.21875, 'cylinder', 3, 0, 0, 190 ) guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", sf, kl ) function mark() local gracz = getLocalPlayer() setElementHealth (gracz, 90) end addEventHandler("onClientMarkerHit", niet, mark )
Castillo Posted November 12, 2013 Posted November 12, 2013 Put the addEventHandler for "onClientMarkerHit" after you create the marker.
Multi Posted November 12, 2013 Author Posted November 12, 2013 function kl() if (source == sf) then local niet = createMarker ( -1124.6586914063, -1009.0390625, 129.21875, 'cylinder', 3, 0, 0, 190 ) addEventHandler("onClientMarkerHit", niet, kl ) guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", sf, kl ) like that ?
Multi Posted November 12, 2013 Author Posted November 12, 2013 dhl = createMarker ( -1105.4412841797, -1006.8745117188, 129.21875, 'cylinder', 3, 0, 0, 190 ) akna = guiCreateWindow(486, 99, 522, 663, "DYSTANSE DHL", false) guiWindowSetSizable(akna, false) guiSetProperty(akna, "CaptionColour", "FFFF0000") guiSetVisible (akna, false ) sf = guiCreateButton(99, 168, 301, 87, "San Fierro", false, akna) ls = guiCreateButton(99, 265, 301, 87, "Los Santos", false, akna) lv = guiCreateButton(99, 362, 301, 87, "Las Venturas", false, akna) dd = guiCreateButton(99, 459, 301, 87, "Dlugi Dystans", false, akna) kd = guiCreateButton(99, 556, 301, 87, "Krotki Dystans", false, akna) x = guiCreateButton(445, 577, 67, 66, "X", false, akna) label = guiCreateLabel(5, 23, 507, 140, " Witam.\n To jest Panel Firmy Kurierskiej DHL.\n Jezeli Wybierzez ktorys z guzikow podanych na dole bedziesz musial jechac po towar\n albo zawiez tam towar.\n Miasta = 3k i 2 score\n Duzy Dystans = 6k i 4 score\n Maly Dystans = 1k i 1 score", false, akna) guiLabelSetColor(label, 88, 46, 246) function dhl2 (player) if ( player == localPlayer ) then guiSetVisible (akna, true ) showCursor (true) end end addEventHandler("onClientMarkerHit", dhl, dhl2 ) function dh() if (source == x) then guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", root, dh ) function kl() if (source == sf) then local niet = createMarker ( -1124.6586914063, -1009.0390625, 129.21875, 'cylinder', 3, 0, 0, 190 ) addEventHandler("onClientMarkerHit", niet, kl ) guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", sf, kl ) function mark() local gracz = getLocalPlayer() setElementHealth (gracz, 90) end addEventHandler("onClientMarkerHit", niet, mark ) Its my full code and its not work that Event not help
Castillo Posted November 12, 2013 Posted November 12, 2013 addEventHandler("onClientMarkerHit", niet, kl ) Why you put "kl" there? the function you want to execute when you hit the marker is "mark".
Multi Posted November 12, 2013 Author Posted November 12, 2013 it still not work in debugscript writing that is problem with this Event, function mark() local gracz = getLocalPlayer() setElementHealth (gracz, 90) end addEventHandler("onClientMarkerHit", niet, mark )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now