Scyrix

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Scyrix

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Infinity-War Expected function at argument 3 LINE 91 Markers are not showing after clicking the button .. Have to restart the resoursce for markers to show after clicking that button
  2. function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end local screenW, screenH = guiGetScreenSize() guipracka = false function guiPraca () dxDrawLine((screenW * 0.3792) - 1, (screenH * 0.2833) - 1, (screenW * 0.3792) - 1, screenH * 0.7167, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.6208, (screenH * 0.2833) - 1, (screenW * 0.3792) - 1, (screenH * 0.2833) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.3792) - 1, screenH * 0.7167, screenW * 0.6208, screenH * 0.7167, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.6208, screenH * 0.7167, screenW * 0.6208, (screenH * 0.2833) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.3792, screenH * 0.2833, screenW * 0.2417, screenH * 0.4333, tocolor(0, 24, 254, 15), false) dxDrawText("Praca Rybaka", screenW * 0.4193, screenH * 0.3120, screenW * 0.5776, screenH * 0.3639, tocolor(255, 255, 255, 255), 2.00, "default", "center", "top", false, false, false, false, false) dxDrawRectangle(screenW * 0.4193, screenH * 0.5167, screenW * 0.1646, screenH * 0.0500, tocolor(126, 126, 127, 224), false) dxDrawRectangle(screenW * 0.4193, screenH * 0.5759, screenW * 0.1646, screenH * 0.0500, tocolor(126, 126, 127, 224), false) dxDrawText("Rozpocznij prace", screenW * 0.4375, screenH * 0.5231, screenW * 0.5646, screenH * 0.5574, tocolor(255, 255, 255, 255), 1.00, "default", "center", "top", false, false, false, false, false) dxDrawText("Anuluj", screenW * 0.4380, screenH * 0.5824, screenW * 0.5651, screenH * 0.6167, tocolor(255, 255, 255, 255), 1.00, "default", "center", "top", false, false, false, false, false) end local markerStartRybak = createMarker(1629.55, 582.18, 1.76-1,"cylinder",1.5,255,0,0,255) addEventHandler("onClientMarkerHit",markerStartRybak,function() if guipracka == false then if isElementWithinMarker(localPlayer, markerStartRybak) then pokazOkno() guipracka = true setElementData(localPlayer,"gui:showed",true) showCursor(true) end end end) function pokazOkno() addEventHandler("onClientRender",root,guiPraca) end function zamknijOkno() removeEventHandler("onClientRender",root,guiPraca) end addEventHandler("onClientClick",getRootElement(),function(button, state) if button == "left" and state == "down" and guipracka == true then if getElementData(localPlayer,"gui:showed") then if cursorPosition(screenW * 0.4193, screenH * 0.5759, screenW * 0.1646, screenH * 0.0500) then removeEventHandler("onClientRender",root,guiPraca) guipracka = false setElementData(localPlayer,"gui:showed",false) showCursor(false) end end end end) addEventHandler("onClientClick",getRootElement(),function(button, state) if button == "left" and state == "down" and guipracka == true then if getElementData(localPlayer,"gui:showed",true) then if cursorPosition(screenW * 0.4193, screenH * 0.5167, screenW * 0.1646, screenH * 0.0500) then removeEventHandler("onClientRender",root,guiPraca) showCursor(false) setElementData(localPlayer,"player:working",true) setElementData(localPlayer,"gui:showed",false) end end end end) local markery = { {1633.33, 589.55, 1.76-1}, {1622.88, 583.13, 1.76-1}, } for _,v in ipairs(markery) do if getElementData(localPlayer,"player:working") == true then markerpraca = createMarker(v[1],v[2],v[3],"cylinder",2.0,255,255,255) end end addEventHandler("onClientMarkerHit",markerpraca,function(hitElement) if getElementData(localPlayer,"player:working") == true then setElementData(localPlayer,"player:working", false) setElementData(localPlayer,"player:fishing",true) setElementFrozen(hitElement,true) triggerServerEvent("Lowienie",localPlayer,localPlayer) end setTimer(function() rnd = math.random(10,20) triggerServerEvent("givePlayerMoney",localPlayer,rnd) outputChatBox("Otrzymujesz"..rnd.. "PLN za zlowiona rybke",0,255,0) setElementFrozen(hitElement,false) triggerServerEvent("StopLowienie",localPlayer,localPlayer) setElementData(localPlayer,"player:fishing",false) end ,5000,1) end) WARNING : Bad argument addEventHandler : Expected element at argument 2 got nil (WARNING LINE : 93 ) at the bottom So my idea was to create a fishing job. I wanted the to make dxGui on which client clicks it shows randomly 2 markers that are in the table "markery" and after hitting that marker the player starts fishing ( Animation , and the timer starts ) but it does'nt really work the way i wanted to work as it shows the warning and the markers are showing after i click on the "rozpocznij prace " and then restart the script. Please help I'm starting with Lua and i went straight into it too fast.
  3. Hello so i just watched a tutorial and tried to re-write exactly the same code as on the video it seemed to work throughout the tutorial but then at the end the error's started to pop up , BAD ARGUMENT @ 'setElementData' [Expected element at argument 1 got boolean] I have no idea what to do i tried to solve it for a long time now without effects.
  4. Work's Thank you so much ❤️
  5. yeah it works but it does not remove the gui after i leave the marker
  6. Hello, So i just started my journey with Lua and wanted to create an simple "info pickup". Basically you hit the pickup ((invisible marker)) and you see the info gui and i wanted to make few of these pickups around the map so i used a table to store the coordinates there but i found out that only 1 marker show the gui and other doesn't. I would like all the markers to show the same gui.