Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local casettePlaces = {}
- local thatATM = {}
- local kepernyom = {guiGetScreenSize()} --<[ Képernyő lekérése ]>--
- local panelSize = {380,280} --<[ Méretek ]>--
- local alpha = 255 --<[ Alpha ]>--
- local Anim = 0 --<[ Anim ]>--
- local alphaText = 255 --<[ Szöveg Alpha ]>--
- local alphaPercent = 0.5 --<[ eztel tudod beállítani az alphát most 50% ]>--
- local KepAlpha = 255
- local panelPos = {kepernyom[1]/2-panelSize[1]/2,kepernyom[2]/2-panelSize[2]/2} --<[ Poziciónálás ]>--
- local Elsolepes = true
- local Size3 = 25
- local flexSound = {}
- local effect1 = {}
- local effect2 = {}
- local brokenATM = {}
- local drawBrokenATM = false
- local thisTimer
- local atmBlip = {}
- local moneyPutIn = false
- local atmPanelState = false
- local atmPanelState2 = false
- local robMinutes = 0.125 -- Az ATM feltörésének ideje PERCBEN
- local robCountdown = false
- local countdownTimer
- local onBox = false
- local theCriminal
- local checkCriminalPos = false
- local ssx
- local ssy
- local moneyPickOut = false
- local casette1 = false
- local casette2 = false
- local casette3 = false
- local casette4 = false
- local panelSizeMe = {}
- local panelSize2Me = {}
- local panelPosX
- local panelPosX2
- local panelPosY
- local panelPosY2
- local button2Opacity = 150
- local updatebutton1Opacity = 150
- local updateButtonTextOpacity = 150
- local button2TextOpacity = 150
- local button1Opacity = 150
- local button1TextOpacity = 150
- local cancelButtonOpacity = 150
- local cancelButtonTextOpacity = 150
- local button2Opacity2 = 150
- local button2TextOpacity2 = 150
- local font0 = dxCreateFont("files/sfprodisplaypro.ttf", 9)
- local font1_5 = dxCreateFont("files/sfprodisplaypro.ttf", 11)
- local font2 = dxCreateFont("files/sfprodisplaypro.ttf", 12)
- local font3 = dxCreateFont("files/sfprodisplaypro.ttf", 16)
- local sX
- local sY
- local sYx
- local sXx
- local kazettaikon = dxCreateTexture("files/kazetta.png", "dxt5", true, "clamp")
- local outoforderikon = dxCreateTexture("files/outoforder.png", "dxt5", true, "clamp")
- local font = dxCreateFont(":mta_score/files/myriadproregular.ttf",9) --<[ Font ]>--
- local font1 = dxCreateFont(":mta_score/files/myriadproregular.ttf",10) --<[ Font ]>--
- local Igenyles = {
- {"Kivétel", 124, 197, 118},
- {"Berakás",135, 211, 124},
- {"Bezárás",210, 77, 87},
- }
- local AtmSzoveg = {
- {"Kivétel", 124, 197, 118},
- {"Bezárás",210, 77, 87},
- }
- local tranzakcio = 0
- local Szamol = 0
- local bankPedPos = {
- {1468.6010742188, -989.53100585938, 26.8125, 0, 0, 90, "Jessica", 12},
- {1460.1086425781, -995.99560546875, 26.818208694458, 0, 0, 0, "Smith", 17},
- {2310.9289550781, -11.01323223114, 26.74218750, 0, 0, 0, "Joshua", 17},
- }
- local atmMoney
- local Moneydata
- local money
- local bankPed = {}
- local loginguis = {}
- local Tick = getTickCount()
- local progress = "Linear"
- local panelState = false
- local Atm
- local atmData
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function ()
- for index, value in ipairs (bankPedPos) do
- if isElement(bankPed[index]) then
- destroyElement(bankPed[index])
- else
- bankPed[index] = createPed(value[8], value[1], value[2], value[3])
- setElementRotation(bankPed[index], 0, 0, 180)
- bankPed[index]:setData("ped:Bank", true)
- bankPed[index]:setData("ped:Bank", true)
- setElementFrozen(bankPed[index], true)
- bankPed[index]:setData("ped:name",value[7])
- bankPed[index]:setData("name:tags", "NPC - Bank")
- --setPedAnimation(bankPed[index], "INT_OFFICE", "OFF_Sit_Idle_Loop", -1, true, false, false )
- end
- end
- end)
- --------------------------------------------------- ATM RABLÁS ---------------------------------------------------
- setTimer(function()
- if getElementData(localPlayer,"festekesArcIdo") then
- if (tonumber(getElementData(localPlayer,"festekesArcIdo")) > 0) then
- local countDownTimes = getElementData(localPlayer,"festekesArcIdo")
- countDownTimes = countDownTimes-1
- setElementData(localPlayer,"festekesArcIdo",countDownTimes)
- triggerServerEvent("execTimes2",root,localPlayer,countDownTimes)
- if countDownTimes > 0 then
- setElementData(localPlayer,"festekes:arc",true)
- elseif countDownTimes <= 0 then
- setElementData(localPlayer,"festekes:arc",false)
- end
- elseif (tonumber(getElementData(localPlayer,"festekesArcIdo")) <= 0) then
- setElementData(localPlayer,"festekes:arc",false)
- end
- end
- end,1000*60,0)
- local lootMoney = {30000, 50000} -- kapott összeg kazettánként = {minimum, maximum}
- local risk = 5 -- Az esély %-ban, hogy üres lesz a nyitott kazetta
- addCommandHandler("festekesarc",function()
- outputChatBox("Ido: "..tostring(getElementData(localPlayer,"festekesArcIdo")))
- outputChatBox("Ertek: "..tostring(getElementData(localPlayer,"festekes:arc")))
- end)
- addEventHandler("onClientResourceStart", resourceRoot, function ()
- if fileExists("files/flex.col") then
- col = engineLoadCOL("files/flex.col", 1655 )
- engineReplaceCOL(col, 1655)
- end
- if fileExists("files/flex.txd") then
- txd = engineLoadTXD("files/flex.txd", 1655 )
- engineImportTXD(txd, 1655)
- end
- if fileExists("files/flex.dff") then
- dff = engineLoadDFF("files/flex.dff", 1655 )
- engineReplaceModel(dff, 1655)
- end
- end)
- function casettePedDamage()
- if(getElementData(source, "casettePed")) then
- cancelEvent() -- A kazettas ped nem kapja a lovest
- end
- end
- addEventHandler("onClientPedDamage", getRootElement(), casettePedDamage)
- addEvent("panelCreateClient", true)
- addEventHandler("panelCreateClient",root,function(Number)
- Moneydata = Number
- MoneyInPlayer = localPlayer:getData("char:bankmoney")
- end)
- addEvent("atmClickHandler",true)
- function atmClickHandlerHandler(player,atmState, sx, sy, atm)
- if player == localPlayer then
- if not atmPanelState2 then
- if exports['mta_item']:hasItem(localPlayer, 167, 1) then
- if atm then
- local thisATM = atm
- thatATM[atm] = atm
- casettePlaces[thisATM] = {}
- casettePlaces[thisATM][1] = true
- casettePlaces[thisATM][2] = true
- casettePlaces[thisATM][3] = true
- casettePlaces[thisATM][4] = true
- --outputChatBox(tostring(atm))
- if not onBox then
- sX = sx
- sY = sy
- onBox = true
- end
- setElementData(atm,"myCriminal",player)
- firstClick = true
- atmPanelState = true
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs flexed!",255,255,255,true)
- end
- end
- end
- end
- addEventHandler("atmClickHandler",root,atmClickHandlerHandler)
- addCommandHandler("checkcasette",function()
- --local thisOneATM = getElementData(localPlayer,"myATM")
- --outputChatBox("thisOneATM: "..tostring(thisOneATM))
- --outputChatBox("casettePlaces[thisOneATM][1]: "..tostring(casettePlaces[thisOneATM][1]))
- --outputChatBox("casettePlaces[thisOneATM][2]: "..tostring(casettePlaces[thisOneATM][2]))
- --outputChatBox("casettePlaces[thisOneATM][3]: "..tostring(casettePlaces[thisOneATM][3]))
- --outputChatBox("casettePlaces[thisOneATM][4]: "..tostring(casettePlaces[thisOneATM][4]))
- --outputChatBox("casettePlaces[1][1]: "..tostring(casettePlaces[1][1]))
- --outputChatBox("casettePlaces[1]: "..tostring(casettePlaces[1]))
- --outputChatBox("thisATM: "..tostring(thisATM))
- outputChatBox("myATM: "..tostring(getElementData(localPlayer,"myATM")))
- end)
- addEvent("atmClickHandler2",true)
- function atmClickHandlerHandler2(player,atm,atmState, sx, sy)
- if player == localPlayer then
- if exports['mta_item']:hasItem(localPlayer, 168, 1) then
- local thisATM = atm
- thatATM[thisATM] = thisATM
- if not onBox then
- sXx = sx
- sYx = sy
- onBox = true
- end
- --outputChatBox(tostring(casettePlaces[thisATM]))
- firstClick = true
- atmPanelState2 = true
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- end
- end
- addEventHandler("atmClickHandler2",root,atmClickHandlerHandler2)
- function renderHandler()
- local sx, sy = guiGetScreenSize()
- ssx = sx
- ssy = sy
- if atmPanelState then
- if not robCountdown then
- if not atmPanelState2 then
- local pX, pY, pZ = getElementPosition(localPlayer)
- local thisATM = getElementData(localPlayer,"myATM")
- local eX, eY, eZ = getElementPosition(thatATM[thisATM])
- local dis = getDistanceBetweenPoints3D(pX, pY, pZ, eX, eY, eZ)
- if (dis <= 1.45) then
- dxDrawRectangle(sX+2, sY-2, 200-4, 1, tocolor(0,0,0,190),false,false) -- Panel head 1
- dxDrawRectangle(sX+1, sY-1, 200-2, 1, tocolor(0,0,0,190),false,false) -- Panel head 2
- dxDrawRectangle(sX, sY, 200, 200, tocolor(0,0,0,190),false,false) -- Panel
- dxDrawRectangle(sX+1, sY+200, 200-2, 1, tocolor(0,0,0,190),false,false) -- Panel bottom 1
- dxDrawRectangle(sX+2, sY+200+1, 200-4, 1, tocolor(0,0,0,190),false,false) -- Panel bottom 2
- dxDrawRectangle(sX+15, sY+30, 200-30, 1, tocolor(255,255,255,40),false,true) -- Panel headline
- dxDrawText("ATM RABLÁS",sX, sY, sX+200, sY+30, tocolor(8,201,39,255), 1, font2, "center", "center")
- --dxDrawText("BIZTOS VAGY BENNE?",sX+15, sY+65, sX+200, sY+30, tocolor(255,255,255,170), 1, font1_5, "center", "center")
- dxDrawImage(sX+40,sY+40,105,95,"files/money.png",0,0,0, tocolor(255,255,255,230), false)
- dxDrawRectangle(sX+10+2, sY+150-2, 80-4, 1, tocolor(8,201,39,button1Opacity),false,false) -- left button head 1
- dxDrawRectangle(sX+10+1, sY+150-1, 80-2, 1, tocolor(8,201,39,button1Opacity),false,false) -- left button head 2
- dxDrawRectangle(sX+10, sY+150, 80, 30, tocolor(0,0,0,150),false,false) -- left button
- dxDrawRectangle(sX+10+1, sY+150+30, 80-2, 1, tocolor(8,201,39,button1Opacity),false,false) -- left button bottom 1
- dxDrawRectangle(sX+10+2, sY+150+30+1, 80-4, 1, tocolor(8,201,39,button1Opacity),false,false) -- left button bottom 2
- dxDrawText("RABLÁS",sX+10, sY+150, sX+10+80, sY+150+30, tocolor(255,255,255,button1TextOpacity), 1, font2, "center", "center")
- dxDrawRectangle(sX+10+85+10+2, sY+150-2, 85-4, 1, tocolor(255,0,0,button2Opacity),false,false) -- right button head 1
- dxDrawRectangle(sX+10+85+10+1, sY+150-1, 85-2, 1, tocolor(255,0,0,button2Opacity),false,false) -- right button head 2
- dxDrawRectangle(sX+10+85+10, sY+150, 85, 30, tocolor(0,0,0,150),false,false) -- right button
- dxDrawRectangle(sX+10+85+10+1, sY+150+30, 85-2, 1, tocolor(255,0,0,button2Opacity),false,false) -- right button bottom 1
- dxDrawRectangle(sX+10+85+10+2, sY+150+1+30, 85-4, 1, tocolor(255,0,0,button2Opacity),false,false) -- right button bottom 2
- dxDrawText("MÉGSEM",sX+10+85+10, sY+150, sX+10+85+10+85, sY+150+30, tocolor(255,255,255,button2TextOpacity), 1, font2, "center", "center")
- else
- firstClick = false
- atmPanelState = false
- onBox = false
- end
- else
- atmPanelState2 = false
- end
- else
- --robCountdown = false
- end
- end
- if atmPanelState2 then
- if not robCountdown then
- if not moneyPutIn then
- local pX, pY, pZ = getElementPosition(localPlayer)
- local thisATM = getElementData(localPlayer,"myATM")
- local eX, eY, eZ = getElementPosition(thatATM[thisATM])
- local dis = getDistanceBetweenPoints3D(pX, pY, pZ, eX, eY, eZ)
- sX = sXx
- sY = sYx
- if (dis <= 1.45) then
- dxDrawRectangle(sX+2, sY-2, 200-4, 1, tocolor(0,0,0,190),false,false) -- Panel head 1
- dxDrawRectangle(sX+1, sY-1, 200-2, 1, tocolor(0,0,0,190),false,false) -- Panel head 2
- dxDrawRectangle(sX, sY, 200, 200, tocolor(0,0,0,190),false,false) -- Panel
- dxDrawRectangle(sX+1, sY+200, 200-2, 1, tocolor(0,0,0,190),false,false) -- Panel bottom 1
- dxDrawRectangle(sX+2, sY+200+1, 200-4, 1, tocolor(0,0,0,190),false,false) -- Panel bottom 2
- dxDrawRectangle(sX+15, sY+30, 200-30, 1, tocolor(255,255,255,40),false,true) -- Panel headline
- dxDrawText("ATM FELTÖLTÉS",sX, sY, sX+200, sY+30, tocolor(8,201,39,255), 1, font2, "center", "center")
- --dxDrawText("BIZTOS VAGY BENNE?",sX+15, sY+65, sX+200, sY+30, tocolor(255,255,255,170), 1, font1_5, "center", "center")
- dxDrawImage(sX+40,sY+40,105,95,"files/money.png",0,0,0, tocolor(255,255,255,230), false)
- dxDrawRectangle(sX+10+2, sY+150-2, 80-4, 1, tocolor(8,201,39,updatebutton1Opacity),false,false) -- update button head 1
- dxDrawRectangle(sX+10+1, sY+150-1, 80-2, 1, tocolor(8,201,39,updatebutton1Opacity),false,false) -- update button head 2
- dxDrawRectangle(sX+10, sY+150, 80, 30, tocolor(0,0,0,150),false,false) -- update button
- dxDrawRectangle(sX+10+1, sY+150+30, 80-2, 1, tocolor(8,201,39,updatebutton1Opacity),false,false) -- update button bottom 1
- dxDrawRectangle(sX+10+2, sY+150+30+1, 80-4, 1, tocolor(8,201,39,updatebutton1Opacity),false,false) -- update button bottom 2
- dxDrawText("FELTÖLT",sX+10, sY+150, sX+10+80, sY+150+30, tocolor(255,255,255,updateButtonTextOpacity), 1, font2, "center", "center")
- dxDrawRectangle(sX+10+85+10+2, sY+150-2, 85-4, 1, tocolor(255,0,0,button2Opacity2),false,false) -- cancel button head 1
- dxDrawRectangle(sX+10+85+10+1, sY+150-1, 85-2, 1, tocolor(255,0,0,button2Opacity2),false,false) -- cancel button head 2
- dxDrawRectangle(sX+10+85+10, sY+150, 85, 30, tocolor(0,0,0,150),false,false) -- cancel button
- dxDrawRectangle(sX+10+85+10+1, sY+150+30, 85-2, 1, tocolor(255,0,0,button2Opacity2),false,false) -- cancel button bottom 1
- dxDrawRectangle(sX+10+85+10+2, sY+150+1+30, 85-4, 1, tocolor(255,0,0,button2Opacity2),false,false) -- cancel button bottom 2
- dxDrawText("MÉGSEM",sX+10+85+10, sY+150, sX+10+85+10+85, sY+150+30, tocolor(255,255,255,button2TextOpacity2), 1, font2, "center", "center")
- else
- firstClick = false
- atmPanelState2 = false
- onBox = false
- end
- else
- atmPanelState2 = false
- end
- else
- --robCountdown = false
- end
- end
- if robCountdown then
- atmPanelState2 = false
- atmPanelState = false
- dxDrawText("ATM FELNYITÁSA",sx*0.3925-1,sy*0.885-(sy*0.03),(sx*0.3925-1)+(sx*0.2143), (sy*0.885-(sy*0.03))+(sy*0.025),tocolor(0,0,0,255), 1, font2, "center", "center" ) -- countdownText border left
- dxDrawText("ATM FELNYITÁSA",sx*0.3925+1,sy*0.885-(sy*0.03),(sx*0.3925+1)+(sx*0.2143), (sy*0.885-(sy*0.03))+(sy*0.025),tocolor(0,0,0,255), 1, font2, "center", "center" ) -- countdownText border right
- dxDrawText("ATM FELNYITÁSA",sx*0.3925,sy*0.885-(sy*0.03)-1,(sx*0.3925)+(sx*0.2143), (sy*0.885-(sy*0.03)-1)+(sy*0.025),tocolor(0,0,0,255), 1, font2, "center", "center" ) -- countdownText border top
- dxDrawText("ATM FELNYITÁSA",sx*0.3925,sy*0.885-(sy*0.03)+1,(sx*0.3925)+(sx*0.2143), (sy*0.885-(sy*0.03)+1)+(sy*0.025),tocolor(0,0,0,255), 1, font2, "center", "center" ) -- countdownText border bottom
- dxDrawText("ATM FELNYITÁSA",sx*0.3925,sy*0.885-(sy*0.03),(sx*0.3925)+(sx*0.2143), (sy*0.885-(sy*0.03))+(sy*0.025),tocolor(255,255,0,255), 1, font2, "center", "center" ) -- countdownText
- dxDrawRectangle((sx*0.47)+2, (sy*0.8)-2, (sx*0.06)-4, 1, tocolor(255,0,0,cancelButtonOpacity),false,false) -- cancel button head 1
- dxDrawRectangle((sx*0.47)+1, (sy*0.8)-1, (sx*0.06)-2, 1, tocolor(255,0,0,cancelButtonOpacity),false,false) -- cancel button head 2
- dxDrawRectangle(sx*0.47, sy*0.8, sx*0.06, sy*0.04, tocolor(0,0,0,150),false,false) -- cancel button
- dxDrawRectangle((sx*0.47)+1, (sy*0.8)+(sy*0.04), (sx*0.06)-2, 1, tocolor(255,0,0,cancelButtonOpacity),false,false) -- cancel button bottom 1
- dxDrawRectangle((sx*0.47)+2, (sy*0.8)+(sy*0.04)+1, (sx*0.06)-4, 1, tocolor(255,0,0,cancelButtonOpacity),false,false) -- cancel button bottom 2
- dxDrawText("MÉGSEM",sx*0.47, sy*0.8, (sx*0.47)+(sx*0.06), (sy*0.8)+(sy*0.04), tocolor(255,255,255,cancelButtonTextOpacity), 1, font2, "center", "center")
- local timeLeft = getTimerDetails(countdownTimer)
- local timeLeft = ((robMinutes*60*1000) - timeLeft)
- local timeLeft = timeLeft/(1000*60)
- local multiplier = timeLeft/robMinutes
- dxDrawRectangle(sx*0.3925, sy*0.885, sx*0.2143, sy*0.025, tocolor(0,0,0,255),false,false) -- countDown
- dxDrawRectangle(sx*0.3925+(sx*0.002), sy*0.885+(sy*0.004), (sx*0.2143-(sx*0.004))*multiplier, sy*0.025-(sy*0.008), tocolor(255,255,0,190),false,false) -- countDown line
- end
- if moneyPickOut then
- if not moneyPutIn then
- local kepernyom = {guiGetScreenSize()}
- panelSizeMe = {258, 396}
- panelSize2Me = {244, 80}
- panelPosX, panelPosY = (kepernyom[1]/2)-(panelSizeMe[1]/2), (kepernyom[2]/2)-(panelSizeMe[2]/2)
- panelPosX = panelPosX+500
- panelPosY = panelPosY+150
- panelPosX2, panelPosY2 = (kepernyom[1]/2)-(panelSize2Me[1]/2), (kepernyom[2]/2)-(panelSize2Me[2]/2)
- panelPosX2 = panelPosX2+500
- panelPosY2 = panelPosY2+150
- dxDrawImage(panelPosX,panelPosY,panelSizeMe[1],panelSizeMe[2],"files/atm_rob_case.png",0,0,0, tocolor(255,255,255,255), false) -- Case
- if casette1 then
- dxDrawImage(panelPosX2,panelPosY2-128,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 1
- end
- if casette2 then
- dxDrawImage(panelPosX2,panelPosY2-36,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 2
- --dxDrawRectangle(panelPosX2,panelPosY2-36,panelSize2[1],panelSize2[2],tocolor(255,0,0,150),false,false)
- end
- if casette3 then
- dxDrawImage(panelPosX2,panelPosY2+56,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 3
- end
- if casette4 then
- dxDrawImage(panelPosX2,panelPosY2+143,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 4
- end
- else
- moneyPutIn = false
- end
- end
- if moneyPutIn then
- moneyPickOut = false
- local kepernyom = {guiGetScreenSize()}
- panelSizeMe = {258, 396}
- panelSize2Me = {244, 80}
- panelPosX, panelPosY = (kepernyom[1]/2)-(panelSizeMe[1]/2), (kepernyom[2]/2)-(panelSizeMe[2]/2)
- panelPosX = panelPosX+500
- panelPosY = panelPosY+150
- panelPosX2, panelPosY2 = (kepernyom[1]/2)-(panelSize2Me[1]/2), (kepernyom[2]/2)-(panelSize2Me[2]/2)
- panelPosX2 = panelPosX2+500
- panelPosY2 = panelPosY2+150
- dxDrawImage(panelPosX,panelPosY,panelSizeMe[1],panelSizeMe[2],"files/atm_rob_case.png",0,0,0, tocolor(255,255,255,255), false) -- Case
- local thisATM = getElementData(localPlayer,"myATM")
- if (casettePlaces[thisATM][1] == true) then
- dxDrawImage(panelPosX2,panelPosY2-128,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 1
- end
- if (casettePlaces[thisATM][2] == true) then
- dxDrawImage(panelPosX2,panelPosY2-36,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 2
- --dxDrawRectangle(panelPosX2,panelPosY2-36,panelSize2[1],panelSize2[2],tocolor(255,0,0,150),false,false)
- end
- if (casettePlaces[thisATM][3] == true) then
- dxDrawImage(panelPosX2,panelPosY2+56,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 3
- end
- if (casettePlaces[thisATM][4] == true) then
- dxDrawImage(panelPosX2,panelPosY2+143,panelSize2Me[1],panelSize2Me[2],"files/atm_rob_casette.png",0,0,0, tocolor(255,255,255,255), false) -- Casette 4
- end
- end
- if drawBrokenATM then
- local number = (#brokenATM)
- for i = 1, number, 1 do
- local thisATM = brokenATM[i]
- if (getElementData(thisATM,"brokenATM") == true) then
- local x, y, z = getElementPosition(brokenATM[i])
- z = z+0.8
- png = outoforderikon
- c1,c2,c3 = 255, 0, 0
- dxDrawMaterialLine3D(x,y,z+1.3,x,y,z+0.5,png,0.5,tocolor(c1, c2, c3, 200)) --FASZA, AZ IKON MOZOG A KAMERÁVAL
- end
- end
- end
- end
- addEventHandler("onClientRender",root,renderHandler)
- addEvent("checkThePanel",true)
- function checkThePanelHandler(player,buttonState)
- if (player == localPlayer) then
- triggerServerEvent("panelResponse",root,player,atmPanelState)
- end
- end
- addEventHandler("checkThePanel",root,checkThePanelHandler)
- function cursorMoveHandler(curX, curY, aX, aY)
- local isCursor = isCursorShowing()
- if isCursor then
- if (robCountdown or atmPanelState or atmPanelState2) then
- if (atmPanelState and (sX) and (sY) and ((aX >= (sX+10+85+10)) and (aY >= sY+150) and (aX <= sX+10+85+10+85) and (aY <= sY+150+30))) then --right Button
- button2Opacity = 255
- button2TextOpacity = 255
- elseif (atmPanelState and (sX) and (sY) and ((aX >= (sX+10)) and (aY >= sY+150) and (aX <= sX+10+80) and (aY <= sY+150+30))) then -- left button
- button1Opacity = 255
- button1TextOpacity = 255
- elseif (robCountdown and (sX) and (sY) and (curX >= 0.47) and (curY >= 0.8) and ( curX <= ( (0.47) + (0.06) ) ) and (curY <= ((0.8) + (0.04)) ) )then -- cancelButton
- cancelButtonOpacity = 255
- cancelButtonTextOpacity = 255
- elseif (atmPanelState2 and (sX) and (sY) and ((aX >= (sX+10)) and (aY >= sY+150) and (aX <= (sX+10+80)) and (aY <= sY+150+30)))then
- updatebutton1Opacity = 255
- updateButtonTextOpacity = 255
- elseif (atmPanelState2 and (sX) and (sY) and ((aX >= (sX+10+85+10)) and (aY >= sY+150) and (aX <= sX+10+85+10+85) and (aY <= sY+150+30))) then --right Button
- button2Opacity2 = 255
- button2TextOpacity2 = 255
- else
- button1Opacity = 150
- updatebutton1Opacity = 150
- button1TextOpacity = 150
- button2Opacity = 150
- button2TextOpacity = 150
- cancelButtonOpacity = 150
- cancelButtonTextOpacity = 150
- updateButtonTextOpacity = 150
- button2Opacity2 = 150
- button2TextOpacity2 = 150
- end
- end
- end
- end
- addEventHandler("onClientCursorMove",root,cursorMoveHandler)
- addEvent("signTheRobber",true)
- function signTheRobberHandler()
- checkCriminalPos = true
- end
- addEventHandler("signTheRobber",root,signTheRobberHandler)
- addEvent("blipMaker2",true)
- function blipMakerHandler2(player,theATM)
- if player == localPlayer then
- local aX, aY, aZ = getElementPosition(theATM)
- atmBlip[theATM] = theATM
- atmBlip[theATM] = createBlip(aX, aY, aZ, 0, 1, 255, 0, 0, 255, 0, 16383.0)
- setElementData(atmBlip[theATM], "tooltipText", "Üzemképtelen ATM")
- end
- end
- addEventHandler("blipMaker2",root,blipMakerHandler2)
- addEvent("blipMaker",true)
- function blipMakerHandler(theATM)
- triggerServerEvent("blipServerFunction",root,localPlayer,theATM)
- end
- addEventHandler("blipMaker",getRootElement(),blipMakerHandler)
- function loginSync (player)
- if player == localPlayer then
- local success2 = false
- for index, value in pairs(getElementsByType("object")) do
- if getElementData(value,"bank:object") then
- if getElementData(value,"brokenATM") then
- if getElementData(value,"brokenATM") == true then
- if (#brokenATM) > 0 then
- local number = (#brokenATM)
- brokenATM[number+1] = value
- else
- brokenATM[1] = value
- end
- success2 = true
- end
- end
- end
- end
- if (success2) then
- local number = (#brokenATM)
- for i = 1, number, 1 do
- local thisATM = brokenATM[i]
- triggerServerEvent("syncServerside",root,player,brokenATM[i])
- end
- end
- success2 = false
- end
- end
- addEvent("syncFlexSound",true)
- function syncFlexSoundHandler(x,y,z,player)
- flexSound[player] = playSound3D("/files/flex.mp3",x, y, z, true)
- setSoundMaxDistance ( flexSound[player], 70 )
- setSoundMinDistance ( flexSound[player], 8 )
- effect1[player] = createEffect("prt_spark",x,y,z)
- thisTimer = setTimer(function()
- effect2[player] = createEffect("extinguisher",x,y,z)
- triggerServerEvent("attachTheElements",root,theCriminal)
- end,500,1)
- triggerServerEvent("attachTheElements",root,theCriminal)
- end
- addEvent("attacher",true)
- function attacherHandler(player)
- if isElement (effect1[player]) then
- exports.bone_attach:attachElementToBone(effect1[player], player , 11, 0.45, 0, 0.01, 45, -90, 180)
- end
- if isElement(effect2[player]) then
- exports.bone_attach:attachElementToBone(effect2[player], player , 11, 0.45, 0, 0.01, 0, 120, 0)
- end
- end
- addEventHandler("attacher",root,attacherHandler)
- addEvent("stopFlexSound",true)
- function stopFlexSoundHandler(player)
- if isElement(flexSound[player]) then
- destroyElement(flexSound[player])
- end
- if isElement (effect1[player]) then
- destroyElement(effect1[player])
- end
- if isElement (effect2[player]) then
- destroyElement(effect2[player])
- end
- if isTimer(thisTimer) then
- killTimer(thisTimer)
- end
- end
- addEventHandler("stopFlexSound",root,stopFlexSoundHandler)
- addEvent("quitPlayerHandler",true)
- function quitPlayerHandlerhandler(player)
- if (player == theCriminal) then
- if isElement(flexSound[player]) then
- destroyElement(flexSound[player])
- end
- if isElement (effect1[player]) then
- destroyElement(effect1[player])
- end
- if isElement (effect2[player]) then
- destroyElement(effect2[player])
- end
- if isTimer(thisTimer) then
- killTimer(thisTimer)
- end
- end
- end
- addEventHandler("quitPlayerHandler",root,quitPlayerHandlerhandler)
- addEvent("cancelFlexhandler",true)
- function cancelFlexhandlerHandler(player)
- if isElement(flexSound[player]) then
- destroyElement(flexSound[player])
- end
- if isElement (effect1[player]) then
- destroyElement(effect1[player])
- end
- if isElement (effect2[player]) then
- destroyElement(effect2[player])
- end
- if isTimer(thisTimer) then
- killTimer(thisTimer)
- end
- end
- addEventHandler("cancelFlexhandler",root,cancelFlexhandlerHandler)
- addEventHandler("syncFlexSound",root,syncFlexSoundHandler)
- function robHandler ()
- theCriminal = localPlayer
- local thisATM = getElementData(localPlayer,"myATM")
- triggerServerEvent("atmRobTexts",root,localPlayer,thatATM[thisATM])
- robCountdown = true
- triggerServerEvent("factionCheck",root,localPlayer, thatATM[thisATM], theCriminal)
- setElementFrozen(localPlayer,true)
- onBox = false
- outputChatBox("#FF0000[ATM]: #FFFFFFMegkezdted az ATM felnyitását! A fúrás addig történik, ameddig hozzá nem jutsz a pénzkazettákhoz!",255,255,255,true)
- setElementData(theCriminal,"underATMRob",true)
- triggerServerEvent("createPedFlex",root,theCriminal,thatATM[thisATM])
- setTimer(function()
- setElementData(thatATM[thisATM],"brokenATM",true)
- triggerServerEvent("updateToAll",root)
- end,100,1)
- countdownTimer = setTimer(function()
- if isElement(flexSound[player]) then
- destroyElement(flexSound[player])
- end
- outputChatBox("#FF0000[ATM]: #FFFFFFAz ATM-et #08C927sikeresen #FFFFFFkinyitottad! Menekülj, nehogy elkapjanak a rendőrök!",255,255,255,true)
- triggerServerEvent("updateToAll",root)
- setElementData(theCriminal,"underATMRob",false)
- atmPanelState = false
- moneyPickOut = true
- casette1 = true
- casette2 = true
- casette3 = true
- casette4 = true
- triggerServerEvent("endRobHandler",root,localPlayer)
- robCountdown = false
- end,1000*60*robMinutes,1)
- end
- function brokenATMChecker()
- local number = (#atmBlip)
- outputChatBox(tostring(number))
- for i=1, number, 1 do
- local atm = atmBlip[i]
- if getElementData(atm,"brokenATM") then
- if not (getElementData(atm,"brokenATM") == true) then
- destroyElement(atmBlip[i])
- end
- end
- end
- end
- function clickSecondHandler(button, state, aX, aY)
- local isCursor = isCursorShowing()
- if isCursor then
- if (robCountdown or atmPanelState or moneyPickOut or atmPanelState2 or moneyPutIn) then
- if (button == "left") then
- if (state == "up") then
- if (atmPanelState and (sX) and (sY) and ((aX >= (sX+10+85+10)) and (aY >= sY+150) and (aX <= sX+10+85+10+85) and (aY <= sY+150+30))) then -- right button
- atmPanelState = false
- onBox = false
- elseif (atmPanelState2 and (sX) and (sY) and ((aX >= (sX+10+85+10)) and (aY >= sY+150) and (aX <= sX+10+85+10+85) and (aY <= sY+150+30))) then -- update right button
- atmPanelState2 = false
- onBox = false
- elseif (atmPanelState and (sX) and (sY) and ((aX >= (sX+10)) and (aY >= sY+150) and (aX <= sX+10+80) and (aY <= sY+150+30))) then -- left button
- robHandler()
- atmPanelState = false
- onBox = false
- elseif (atmPanelState2 and (sX) and (sY) and ((aX >= (sX+10)) and (aY >= sY+150) and (aX <= sX+10+80) and (aY <= sY+150+30))) then -- update left button
- atmPanelState = false
- onBox = false
- local thisATM = getElementData(localPlayer,"myATM")
- local thisATM = thatATM[thisATM]
- outputChatBox(tostring(casettePlaces[thisATM]))
- if (casettePlaces[thisATM][1] == true) and (casettePlaces[thisATM][2] == true) and (casettePlaces[thisATM][3] == true) and (casettePlaces[thisATM][4] == true) then
- triggerServerEvent("endRobHandler2",root,localPlayer,thisATM)
- outputChatBox("#FF0000[ATM]: #FFFFFFAz ATM-ből nem hiányoztak pénzkazetták, jó munkát végeztél!",255,255,255,true)
- setElementData(thisATM,"brokenATM",false)
- brokenATMChecker()
- else
- moneyPutIn = true
- end
- --outputChatBox("#FFFFFFHamarosan! ~#FF0000KrisT",255,255,255,true)
- elseif (robCountdown and ( aX >= ((0.465)*ssx ) ) and ( aY >= ((0.08)*ssy) ) and ( aX <= (((0.465) + (85/ssx))*ssx) ) and ( aY <= (((0.8) + (30/ssy))*ssy) )) then
- onBox = false
- atmPanelState = false
- robCountdown = false
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- if isTimer(countdownTimer) then
- killTimer(countdownTimer)
- end
- if getElementData(localPlayer,"myFlex") then
- local thisFlex = getElementData(localPlayer,"myFlex")
- triggerServerEvent("cancelFlex",root,thisFlex,theCriminal)
- end
- if isTimer(thisTimer) then
- killTimer(thisTimer)
- end
- outputChatBox("#FF0000[ATM]: #FFFFFFAz ATM feltörését megszakítottad!",255,255,255,true)
- elseif ( (panelPosX and panelPosY) and (aX >=( panelPosX+238)) and (aY >= (panelPosY)) and (aX <= ((panelPosX+238)+20)) and (aY <= ((panelPosY)+20))) then -- casette panel exit button
- onBox = false
- if moneyPickOut then
- moneyPickOut = false
- end
- if moneyPutIn then
- moneyPutIn = false
- end
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- elseif ( moneyPickOut and casette1 and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= (panelPosX2)) and (aY >= (panelPosY2-128)) and (aX <= ((panelPosX2)+panelSize2Me[1])) and (aY <= ((panelPosY2-128)+panelSize2Me[2])) ) then
- onBox = false
- casette1 = false
- triggerServerEvent("getCasette",root,theCriminal)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][1] = false
- outputChatBox("#FF0000[ATM]: #FFFFFFKivettél egy pénzkazettát!",255,255,255,true)
- triggerServerEvent("giveCasette",root,theCriminal)
- if not casette1 and not casette2 and not casette3 and not casette4 then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPickOut = false
- end
- elseif (moneyPickOut and casette2 and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2-36)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2-36)+panelSize2Me[2]))) ) then
- onBox = false
- casette2 = false
- triggerServerEvent("getCasette",root,theCriminal)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][2] = false
- outputChatBox("#FF0000[ATM]: #FFFFFFKivettél egy pénzkazettát!",255,255,255,true)
- triggerServerEvent("giveCasette",root,theCriminal)
- if not casette1 and not casette2 and not casette3 and not casette4 then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPickOut = false
- end
- elseif (moneyPickOut and casette3 and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2+56)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2+56)+panelSize2Me[2]))) ) then
- onBox = false
- casette3 = false
- triggerServerEvent("getCasette",root,theCriminal)
- outputChatBox("#FF0000[ATM]: #FFFFFFKivettél egy pénzkazettát!",255,255,255,true)
- triggerServerEvent("giveCasette",root,theCriminal)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][3] = false
- if not casette1 and not casette2 and not casette3 and not casette4 then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPickOut = false
- end
- elseif (moneyPickOut and casette4 and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2+143)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2+143)+panelSize2Me[2]))) ) then
- onBox = false
- casette4 = false
- triggerServerEvent("getCasette",root,theCriminal)
- outputChatBox("#FF0000[ATM]: #FFFFFFKivettél egy pénzkazettát!",255,255,255,true)
- triggerServerEvent("giveCasette",root,theCriminal)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][4] = false
- if not casette1 and not casette2 and not casette3 and not casette4 then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPickOut = false
- end
- elseif (moneyPutIn and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= (panelPosX2)) and (aY >= (panelPosY2-128)) and (aX <= ((panelPosX2)+panelSize2Me[1])) and (aY <= ((panelPosY2-128)+panelSize2Me[2])) ) then
- onBox = false
- local thisATM = getElementData(localPlayer,"myATM")
- if exports['mta_item']:hasItem(localPlayer, 168, 1) then
- if (casettePlaces[thisATM][1] == false) then
- triggerServerEvent("getCasette",root,theCriminal)
- casettePlaces[thisATM][1] = true
- outputChatBox("#FF0000[ATM]: #FFFFFFBetettél egy pénzkazettát!",255,255,255,true)
- exports["mta_item"]:getPlayerItem(168)
- if (casettePlaces[thisATM][1] == true) and (casettePlaces[thisATM][2] == true) and (casettePlaces[thisATM][3] == true) and (casettePlaces[thisATM][4] == true) then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPutIn = false
- setElementData(thisATM,"brokenATM",false)
- brokenATMChecker()
- triggerServerEvent("endRobHandler2",root,localPlayer,thisATM)
- end
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- elseif (moneyPutIn and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2-36)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2-36)+panelSize2Me[2]))) ) then
- onBox = false
- local thisATM = getElementData(localPlayer,"myATM")
- --outputChatBox("casette2")
- if exports['mta_item']:hasItem(localPlayer, 168, 1) then
- if (casettePlaces[thisATM][2] == false) then
- triggerServerEvent("getCasette",root,theCriminal)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][2] = true
- exports["mta_item"]:getPlayerItem(168)
- outputChatBox("#FF0000[ATM]: #FFFFFFBetettél egy pénzkazettát!",255,255,255,true)
- if (casettePlaces[thisATM][1] == true) and (casettePlaces[thisATM][2] == true) and (casettePlaces[thisATM][3] == true) and (casettePlaces[thisATM][4] == true) then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPutIn = false
- setElementData(thisATM,"brokenATM",false)
- brokenATMChecker()
- triggerServerEvent("endRobHandler2",root,localPlayer,thisATM)
- end
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- elseif (moneyPutIn and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2+56)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2+56)+panelSize2Me[2]))) ) then
- onBox = false
- local thisATM = getElementData(localPlayer,"myATM")
- if exports['mta_item']:hasItem(localPlayer, 168, 1) then
- if (casettePlaces[thisATM][3] == false) then
- triggerServerEvent("getCasette",root,theCriminal)
- exports["mta_item"]:getPlayerItem(168)
- outputChatBox("#FF0000[ATM]: #FFFFFFBetettél egy pénzkazettát!",255,255,255,true)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][3] = true
- if (casettePlaces[thisATM][1] == true) and (casettePlaces[thisATM][2] == true) and (casettePlaces[thisATM][3] == true) and (casettePlaces[thisATM][4] == true) then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- moneyPutIn = false
- setElementData(thisATM,"brokenATM",false)
- brokenATMChecker()
- triggerServerEvent("endRobHandler2",root,localPlayer,thisATM)
- end
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- elseif (moneyPutIn and (panelPosX and panelPosY and panelSize2Me[1] and panelSize2Me[2]) and (aX >= panelPosX2) and (aY >= (panelPosY2+143)) and (aX <= ((panelPosX2)+panelSize2Me[1]) and (aY <= (( panelPosY2+143)+panelSize2Me[2]))) ) then
- onBox = false
- local thisATM = getElementData(localPlayer,"myATM")
- if exports['mta_item']:hasItem(localPlayer, 168, 1) then
- if (casettePlaces[thisATM][4] == false) then
- triggerServerEvent("getCasette",root,theCriminal)
- exports["mta_item"]:getPlayerItem(168)
- outputChatBox("#FF0000[ATM]: #FFFFFFBetettél egy pénzkazettát!",255,255,255,true)
- local thisATM = getElementData(localPlayer,"myATM")
- casettePlaces[thisATM][4] = true
- if (casettePlaces[thisATM][1] == true) and (casettePlaces[thisATM][2] == true) and (casettePlaces[thisATM][3] == true) and (casettePlaces[thisATM][4] == true) then
- setElementFrozen(localPlayer,false)
- setPedAnimation( localPlayer)
- setElementData(thisATM,"brokenATM",false)
- brokenATMChecker()
- triggerServerEvent("endRobHandler2",root,localPlayer,thisATM)
- moneyPutIn = false
- end
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- end
- end
- end
- end
- end
- end
- addEventHandler("onClientClick",root,clickSecondHandler)
- addEvent("minigameHandler",true)
- function minigameHandlerHandler(player)
- if (player == localPlayer) then
- if exports['mta_item']:hasItem(player, 94, 1) then
- if exports['mta_item']:hasItem(player, 168, 1) then
- exports["mta_minigames"]:setBalanceQTEState(true, 1, "mta_bank")
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs pénzkazettád!",255,255,255,true)
- end
- else
- outputChatBox("#FF0000[ATM]: #FFFFFFNincs feszítővasad!",255,255,255,true)
- end
- end
- end
- addEventHandler("minigameHandler",root,minigameHandlerHandler)
- function theMinigameReturns (type)
- if not type then return end
- if type == 1 then -- Nem sikerült
- outputChatBox("#FF0000[ATM]: #FFFFFFA pénzkazettákat #FF0000nem sikerült #FFFFFFfeltörnöd! A festékpatronok felrobbantak, az arcod festékes lett!",255,255,255,true)
- setElementData(localPlayer,"festekes:arc",true)
- exports["mta_item"]:getPlayerItem(168)
- triggerServerEvent("updateFace",root,localPlayer)
- else -- sikerült
- exports["mta_item"]:getPlayerItem(168)
- local percent = math.random(0,100)
- local moneyPlus
- if (percent) <= risk then
- moneyPlus = 0
- else
- moneyPlus = math.random(lootMoney[1],lootMoney[2])
- end
- if (moneyPlus > 0) then
- setElementData(localPlayer, "char:money", getElementData(localPlayer, "char:money") + moneyPlus)
- outputChatBox("#FF0000[ATM]: #FFFFFFA pénzkazettákat #08C927sikeresen #FFFFFFfelnyitottad! A kazettában található dollár: #00FF00"..moneyPlus.."$",255,255,255,true)
- elseif (moneyPlus == 0) then
- outputChatBox("#FF0000[ATM]: #FFFFFFA pénzkazettákat sikeresen felnyitottad, de a kazetta sajnos #FF0000üres volt!",255,255,255,true)
- end
- moneyPlus = 0
- end
- end
- function renderKazettaIcon()
- --local localPosition = {getElementPosition(localPlayer)}
- --local valuePosition = {getElementPosition(dasIstMarker)}
- --local worldPosition = {getScreenFromWorldPosition(valuePosition[1], valuePosition[2], valuePosition[3])}
- --local distance = getDistanceBetweenPoints3D(localPosition[1], localPosition[2], localPosition[3], valuePosition[1], valuePosition[2], valuePosition[3])
- local x,y,z = 2558.4213867188, -1294.9592285156, 1045.0771484375-1.7
- -- if distance <= 50 then
- png = kazettaikon
- c1,c2,c3 = 100, 158, 100
- dxDrawMaterialLine3D(x,y,z+1.3,x,y,z+0.85,png,0.5,tocolor(c1, c2, c3, 200)) --FASZA, AZ IKON MOZOG A KAMERÁVAL
- -- end
- end
- addEventHandler("onClientPreRender", root, renderKazettaIcon)
- addEvent("update",true)
- function outoforderIcon()
- local success = false
- for index, value in pairs(getElementsByType("object")) do
- if getElementData(value,"bank:object") then
- if getElementData(value,"brokenATM") then
- if getElementData(value,"brokenATM") == true then
- if (#brokenATM) > 0 then
- local number = (#brokenATM)
- brokenATM[number+1] = value
- else
- brokenATM[1] = value
- end
- success = true
- end
- end
- end
- end
- if not (success) then
- drawBrokenATM = false
- else
- drawBrokenATM = true
- end
- success = false
- end
- addEventHandler("update",root,outoforderIcon)
- --------------------------------------------------- ATM RABLÁS ---------------------------------------------------
- function panelFelrajzolas()
- if not panelState then return end
- if Elsolepes then
- if alpha < 255*alphaPercent then
- alpha = alpha + ((255*alphaPercent)/100)*(alphaPercent*2)
- alphaText = alphaText + ((255*alphaPercent)/100)*(alphaPercent*2)
- else
- alpha = 255*alphaPercent
- alphaText = 255
- KepAlpha = KepAlpha + 0.5
- if KepAlpha >= 255*alphaPercent then
- KepAlpha = 0
- end
- Anim = 2
- end
- Time = 5
- --Size1 = interpolateBetween(panelPos[1],0,0,kepernyom[1]/2-150/2-8,0,0,Time,progress)
- Size1 = kepernyom[1]/2-150/2-8,0,0
- Time2 = 5
- --Size2 = interpolateBetween(panelPos[1]+panelSize[1]/2+50,0,0,kepernyom[1]/2-150/2-5,0,0,Time2,progress)
- Size2 = kepernyom[1]/2-150/2-5,0,0
- if alpha == 255*alphaPercent then
- Size3 = Size3 + 3
- if Size3 >= panelSize[2] then
- Size3 = panelSize[2]
- end
- end
- elseif not Elsolepes then
- if alpha > 2 then
- alpha = alpha - ((255*alphaPercent)/100)*(alphaPercent*2)
- alphaText = alphaText - ((255*alphaPercent)/100)*(alphaPercent*2)
- Time = (getTickCount() - Tick) / 500
- --Size1 = interpolateBetween(kepernyom[1]/2-150/2-8,0,0,panelPos[1],0,0,Time,progress)
- Size1 = panelPos[1],0,0
- Time2 = (getTickCount() - Tick) / 500
- --Size2 = interpolateBetween(kepernyom[1]/2-150/2-5,0,0,panelPos[1]+panelSize[1]/2+50,0,0,Time2,progress)
- Size2 = panelPos[1]+panelSize[1]/2+50,0,0
- --Size3 = interpolateBetween(panelSize[2],0,0,25,0,0,Time2,progress)
- Size3 = 25,0,0
- else
- alpha = 0
- tranzakcio = 0
- alphaText = 0
- Anim = 3
- Elsolepes = true
- if isElement(loginguis[1]) then
- destroyElement(loginguis[1])
- end
- panelState = false
- setElementFrozen(localPlayer, false)
- end
- end
- dxDrawRectangle(panelPos[1], panelPos[2], panelSize[1], 280, tocolor(0, 0, 0, 200)) --atm panel háttér
- if tranzakcio == 0 then
- --if Size3 > 170 then
- --if Size3 > 50 then
- dxDrawRectangle(panelPos[1]+5, panelPos[2]+50, panelSize[1]-10, 50, tocolor(0, 0, 0, 200)) -- összeg mögötti téglageci
- dxDrawText("Az egyenleg a számládon : #08c927"..penz_darabolas(localPlayer:getData("char:bankmoney")).." $",panelPos[1]+5, panelPos[2]+30, panelSize[1]-10, 280-170, tocolor(255, 255, 255, 255),1, font1, "left", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- money = tonumber(guiGetText(loginguis[1])) or 0
- dxDrawText(penz_darabolas(money).." $",panelPos[1]+10, panelPos[2]+65, panelSize[1]-10, 280-170, tocolor(255, 255, 255, 255),1, font1, "left", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- if not Atm then
- for i = 1, 3 do
- dxDrawRectangle(panelPos[1]+5+60, panelPos[2]-60+35+100+i*(45), panelSize[1]-130, 40, tocolor(0, 0, 0, 200)) --kivétel bezárás mögötti téglaháttér
- if isCursorOnBox (panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250) then
- dxDrawRectangle(panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250, tocolor(Igenyles[i][2], Igenyles[i][3], Igenyles[i][4], 255))
- else
- dxDrawRectangle(panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250, tocolor(0, 0, 0, 255))
- end
- dxDrawText(Igenyles[i][1],panelPos[1]-10+panelSize[1]/2 , panelPos[2]-50+35+100+i*(45), panelPos[1]-10+panelSize[1]/2, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- end
- else
- for i = 1, 2 do
- dxDrawRectangle(panelPos[1]+5+60, panelPos[2]-60+35+100+i*(45), panelSize[1]-130, 40, tocolor(0, 0, 0, 200)) --kivétel bezárás mögötti téglaháttér
- if isCursorOnBox (panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250) then
- dxDrawRectangle(panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250, tocolor(AtmSzoveg[i][2], AtmSzoveg[i][3], AtmSzoveg[i][4], 255))
- else
- dxDrawRectangle(panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, 280-250, tocolor(0, 0, 0, 255))
- end
- dxDrawText(AtmSzoveg[i][1],panelPos[1]-10+panelSize[1]/2 , panelPos[2]-50+35+100+i*(45), panelPos[1]-10+panelSize[1]/2, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- end
- end
- --end
- --end
- --if Size3 > 50 then
- --outputChatBox(Size3)
- dxDrawRectangle(panelPos[1], panelPos[2]+280-25, panelSize[1], 25, tocolor(0, 0, 0, 200))
- dxDrawText("www.nextgamingrp.com",panelPos[1]+5+panelSize[1]/2 , panelPos[2]+280-25+5, panelPos[1]+5+panelSize[1]/2, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- --end
- end
- if tranzakcio == 1 or tranzakcio == 2 then
- --if Size3 > 50 then
- dxDrawRectangle(panelPos[1], panelPos[2]+Size3-25, panelSize[1], 25, tocolor(0,0, 0, 200))
- if tranzakcio == 1 then
- dxDrawText("A pénz hamarosan a kezedbe kerül, várj türelemmel!",panelPos[1]+5+panelSize[1]/2 , panelPos[2]+Size3-25+5, panelPos[1]+5+panelSize[1]/2, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- elseif tranzakcio == 2 then
- dxDrawText("A pénz hamarosan a bankba kerül, várj türelemmel!",panelPos[1]+5+panelSize[1]/2 , panelPos[2]+Size3-25+5, panelPos[1]+5+panelSize[1]/2, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- end
- Szamol = Szamol + 0.5
- if Szamol >= 10 then
- Szamol = 10
- end
- if Szamol == 10 then
- if tranzakcio == 1 then
- if tonumber(MoneyInPlayer) >= tonumber(money) then
- if not Atm then
- triggerServerEvent("penzkivetel",localPlayer, localPlayer, tonumber((MoneyInPlayer) - tonumber(money)), tonumber(money), 1 )
- else
- triggerServerEvent("penzkivetel",localPlayer, localPlayer, tonumber((MoneyInPlayer) - tonumber(money)), tonumber(money), 2, atmData:getData("bank:atm:id"), tonumber((atmMoney) - tonumber(money)) )
- end
- else
- outputChatBox("#dc143c[Hiba]:#ffffff Nincs elegendő pénz a számládon.", 255, 255, 255, true)
- end
- elseif tranzakcio == 2 then
- if tonumber(money) <= getElementData(localPlayer, "char:money") then
- if not Atm then
- if getElementData(localPlayer, "char:money") < money then
- outputChatBox("#08c927[NextGaming] #ffffffA tranzakció sikertelen. Nincs nálad elég pénz", 0, 0, 0, true)
- else
- triggerServerEvent("penzberakas",localPlayer, localPlayer, tonumber((MoneyInPlayer) + tonumber(money)), tonumber(money), 1 )
- end
- else
- triggerServerEvent("penzberakas",localPlayer, localPlayer, tonumber((MoneyInPlayer) + tonumber(money)), tonumber(money), 2, atmData:getData("bank:atm:id"))
- end
- else
- outputChatBox("#dc143c[Hiba]:#ffffff Nincs elegendő pénz nálad.", 255, 255, 255, true)
- end
- end
- Szamol = 0
- tranzakcio = 0
- createGuis(1)
- end
- dxDrawRectangle(panelPos[1]+5 , panelPos[2]+130,panelSize[1]-10,30,tocolor(0, 0, 0,255/1.5))
- dxDrawRectangle(panelPos[1]+10 , panelPos[2]+135,(Szamol/10)*360,20,tocolor(124, 197, 118,255/1.5))
- dxDrawText("Tranzakció folyamatban ...",panelPos[1]+10 , panelPos[2]+137, panelPos[1]+5+panelSize[1]-10, 25, tocolor(255, 255, 255, 255),1, font, "center", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- --end
- end
- dxDrawRectangle(panelPos[1], panelPos[2], panelSize[1], 25, tocolor(0, 0, 0, 200))
- if not Atm then
- dxDrawText("NextGaming - #08c927Bank",panelPos[1]+5, panelPos[2]+5, panelSize[1], 25, tocolor(255, 255, 255, 255),1, font, "left", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- else
- dxDrawText("NextGaming - #08c927ATM",panelPos[1]+5, panelPos[2]+5, panelSize[1], 25, tocolor(255, 255, 255, 255),1, font, "left", "top", false, false, false, true) --<[ External felirat kiírás ]>--
- end
- --dxDrawImage(Size1, panelPos[2]-120, 150, 150, ":mta_score/files/kepek/black.png",0,0,0, tocolor(0, 0, 0, KepAlpha)) --<[ Fekete kép ]>--
- --dxDrawImage(Size2, panelPos[2]-120, 150, 150, ":mta_score/files/kepek/green.png",0,0,0, tocolor(124, 197, 118, KepAlpha)) --<[ Zöld kép ]>--
- end
- function createGuis(number)
- for i = 1, 2 do
- if isElement(loginguis[i]) then
- destroyElement(loginguis[i])
- end
- end
- if (tonumber(number) == 1) then
- loginguis[1] = guiCreateEdit(-1000, -1000, 0, 0, "", false)
- elseif (tonumber(number) == 4) then
- loginguis[1] = guiCreateEdit(-1000, -1000, 0, 0, "", false)
- elseif (tonumber(number) == 5) then
- loginguis[1] = guiCreateEdit(-1000, -1000, 0, 0, "", false)
- elseif (tonumber(number) == 8) then
- loginguis[1] = guiCreateEdit(-1000, -1000, 0, 0, "", false)
- elseif (tonumber(number) == 9) then
- loginguis[1] = guiCreateEdit(-1000, -1000, 0, 0, "", false)
- end
- guiEditSetMaxLength ( loginguis[1], 8 )
- end
- function penz_darabolas(amount)
- local formatted = amount
- while true do
- formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1.%2')
- if (k==0) then
- break
- end
- end
- return formatted
- end
- addEventHandler ( "onClientPedDamage", getRootElement(),
- function ()
- if getElementData(source,"ped:Bank") then
- cancelEvent ()
- end
- end
- )
- addEventHandler ( "onClientObjectDamage", getRootElement(),
- function ()
- if getElementData(source,"bank:object") then
- cancelEvent ()
- end
- end
- )
- function packetLossCheck()
- local loss = getNetworkStats()["messagesInSendBuffer"]
- if (loss > 0) then
- if panelState then
- Szamol = 0
- alpha = 0
- tranzakcio = 0
- alphaText = 0
- Anim = 3
- Elsolepes = true
- if isElement(loginguis[1]) then
- destroyElement(loginguis[1])
- end
- panelState = false
- setElementFrozen(localPlayer, false)
- end
- else
- --moving = true
- end
- end
- setTimer(packetLossCheck, 1000, 0)
- function clickFunction(button, state, absX, absY, wx, wy, wz, element)
- if element and element:getData("ped:Bank") then
- if state == "down" and button == "right" then
- local x, y, z = getElementPosition(getLocalPlayer())
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <= 5 then
- if not panelState then
- --setElementFrozen(localPlayer, true)
- if klikkTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- Tick = getTickCount()
- progress = "Linear"
- panelState = true
- Elsolepes = true
- Atm = false
- removeEventHandler("onClientRender", root, panelFelrajzolas)
- triggerServerEvent("checkBankCards", localPlayer, localPlayer)
- createGuis(1)
- addEventHandler("onClientRender", root, panelFelrajzolas)
- if isTimer(klikkTimerRun) then return end
- klikkTimer = true
- klikkTimerRun = setTimer(function()
- klikkTimer = false
- end,20000,1)
- else
- end
- else
- outputChatBox("#D24D57[Hiba] #ffffffTúl messze vagy! Ilyen messziről nem tudsz beszélgetni az alkalmazottal!", 255, 255, 255, true)
- end
- end
- elseif element and element:getData("bank:object") then
- if state == "down" and button == "right" then
- local x, y, z = getElementPosition(getLocalPlayer())
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <= 5 then
- if not panelState then
- --outputChatBox(tostring(getElementData(element,"brokenATM")))
- if getElementData(element,"brokenATM") then
- if (getElementData(element,"brokenATM") == true) then
- outputChatBox("#FF0000[ATM]: #FFFFFFEz az ATM jelenleg üzemképtelen!",255,255,255,true)
- else
- --setElementFrozen(localPlayer, true)
- if klikkTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- Tick = getTickCount()
- progress = "Linear"
- panelState = true
- Elsolepes = true
- Atm = true
- removeEventHandler("onClientRender", root, panelFelrajzolas)
- triggerServerEvent("checkBankCards", localPlayer, localPlayer)
- atmMoney = element:getData("bank:atm:money")
- atmData = element
- createGuis(1)
- addEventHandler("onClientRender", root, panelFelrajzolas)
- if isTimer(klikkTimerRun) then return end
- klikkTimer = true
- klikkTimerRun = setTimer(function()
- klikkTimer = false
- end,20000,1)
- end
- else
- --setElementFrozen(localPlayer, true)
- if klikkTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- Tick = getTickCount()
- progress = "Linear"
- panelState = true
- Elsolepes = true
- Atm = true
- removeEventHandler("onClientRender", root, panelFelrajzolas)
- triggerServerEvent("checkBankCards", localPlayer, localPlayer)
- atmMoney = element:getData("bank:atm:money")
- atmData = element
- createGuis(1)
- addEventHandler("onClientRender", root, panelFelrajzolas)
- if isTimer(klikkTimerRun) then return end
- klikkTimer = true
- klikkTimerRun = setTimer(function()
- klikkTimer = false
- end,20000,1)
- end
- else
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffTúl messze vagy! Ilyen messziről nem tudsz beszélgetni az alkalmazottal!", 255, 255, 255, true)
- end
- end
- end
- if state == "down" and button == "left" and panelState and not Atm then
- for i = 1, 3 do
- if (dobozbaVan(panelPos[1]+5+65, panelPos[2]-55+35+100+i*(45), panelSize[1]-140, Size3-250,absX, absY)) then
- if i == 1 then
- if (getPlayerPing(localPlayer) < 150) then
- if bankCardTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- if localPlayer:getData("char:bankmoney") > money then
- if tonumber(money) > 0 then
- tranzakcio = 1
- if isTimer(addBankCardRun) then return end
- bankCardTimer = true
- --playSound("files/tranzakcio.wav", false)
- addBankCardRun = setTimer(function()
- bankCardTimer = false
- end,20000,1)
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffff0-nál nagyobb értéket adj meg!", 255, 255, 255 ,true)
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffNincs elég pénz a számládon!", 255, 255, 255 ,true)
- end
- end
- elseif i == 2 then
- if (getPlayerPing(localPlayer) < 150) then
- if bankCardTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- if localPlayer:getData("char:money") > money then
- if tonumber(money) > 0 then
- tranzakcio = 2
- --playSound("files/tranzakcio.wav", false)
- if isTimer(addBankCardRun) then return end
- bankCardTimer = true
- addBankCardRun = setTimer(function()
- bankCardTimer = false
- end,5000,1)
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffff0-nál nagyobb értéket adj meg!", 255, 255, 255 ,true)
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffNincs Elég pénz a kezedben!", 255, 255, 255 ,true)
- end
- end
- elseif i == 3 then
- Tick = getTickCount()
- progress = "Linear"
- Elsolepes = false
- showChat(true)
- Szamol = 0
- tranzakcio = 0
- end
- end
- end
- if (dobozbaVan(panelPos[1]+5, panelPos[2]+50, panelSize[1]-10, 280-235,absX, absY)) then
- if guiEditSetCaretIndex(loginguis[1], string.len(guiGetText(loginguis[1]))) then
- guiBringToFront(loginguis[1])
- end
- end
- end
- if state == "down" and button == "left" and panelState and Atm then
- for s = 1, 2 do
- if (dobozbaVan(panelPos[1]+5+65, panelPos[2]-55+35+100+s*(45), panelSize[1]-140, 280-250,absX, absY)) then
- if s == 1 then
- if (getPlayerPing(localPlayer) < 150) then
- if bankCardTimer then outputChatBox("Várj #dc143c20#ffffff másodpercet.",255,255,255,true) return end
- if localPlayer:getData("char:bankmoney") > money then
- if tonumber(atmMoney) >= money then
- if money < 50000 then
- if tonumber(money) > 0 then
- tranzakcio = 1
- --playSound("files/tranzakcio.wav", false)
- if isTimer(addBankCardRun) then return end
- bankCardTimer = true
- --bankSound = playSound("files/tranzakcio.wav", false)
- addBankCardRun = setTimer(function()
- bankCardTimer = false
- end,20000,1)
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffff0-nál nagyobb értéket adj meg.", 255, 255, 255 ,true)
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffMaximum #08c92750.000 #ffffff$-t tudsz kivenni egyszerre. ", 255, 255, 255 ,true)
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffJelenleg nincs pénz az ATM-ben, nézz vissza később!", 255, 255, 255 ,true)
- end
- else
- outputChatBox("#08c927[NextGaming - Bank]: #ffffffNincs Elég pénz a számládon!", 255, 255, 255 ,true)
- end
- end
- elseif s == 2 then
- Tick = getTickCount()
- progress = "Linear"
- Elsolepes = false
- showChat(true)
- Szamol = 0
- tranzakcio = 0
- end
- end
- end
- if (dobozbaVan(panelPos[1]+5, panelPos[2]+50, panelSize[1]-10, 280-235,absX, absY)) then
- if guiEditSetCaretIndex(loginguis[1], string.len(guiGetText(loginguis[1]))) then
- guiBringToFront(loginguis[1])
- end
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), clickFunction, true)
- function UpdateClinet(money, kivettmoney, number)
- if money < 0 then outputChatBox("#dc143c[Hiba]:#ffffff Túl alacsony az összeg.", 255, 255, 255, true) return end
- if tonumber(number) == 1 then
- MoneyInPlayer = money
- --setElementData(localPlayer, "char:money", getElementData(localPlayer, "char:money") + kivettmoney)
- elseif tonumber(number) == 2 then
- MoneyInPlayer = money
- --setElementData(localPlayer, "char:money", getElementData(localPlayer, "char:money") - kivettmoney)
- end
- end
- addEvent("UpdateClinet", true)
- addEventHandler("UpdateClinet", root , UpdateClinet)
- function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
- if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
- return true
- else
- return false
- end
- end
- function isCursorOnBox(xS,yS,wS,hS)
- if(isCursorShowing()) then
- XY = {guiGetScreenSize()}
- local cursorX, cursorY = getCursorPosition()
- cursorX, cursorY = cursorX*XY[1], cursorY*XY[2]
- if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then
- return true
- else
- return false
- end
- end
- end
- -------------------------------------------------------------------------------------<[ ADÓ ]>-------------------------------------------------------------------------------------
- local Player = 0
- local allPay = 0
- local Vehicle = 0
- local InteriorPay = 0
- function payAllClient()
- if not getElementData(getLocalPlayer(),"afk") or false and getElementData(getLocalPlayer(), "Timer") < 1200 then
- for index, values in ipairs (getElementsByType("player")) do
- for _, value in ipairs(getElementsByType("vehicle")) do
- if value:getData("veh:owner") == values:getData("acc:id") and getElementData(value, "veh:faction") == 0 then
- if values == localPlayer then
- Vehicle = Vehicle + 50
- end
- end
- end
- for _, interior in ipairs(getElementsByType("marker")) do
- if interior:getData("typePick") and interior:getData("typePick") == "outside" then
- if interior:getData("owner") == values:getData("char:id") then
- if values == localPlayer then
- InteriorPay = InteriorPay + 50
- end
- end
- end
- end
- end
- Player = math.floor(getElementData(localPlayer, "char:bankmoney") * 0.002)
- allPay = math.floor((InteriorPay + Vehicle))
- --outputChatBox(" ")
- outputChatBox("#19B5FEFizetés#ffffff", 255, 255 ,255, true)
- outputChatBox("Járműadó: #08c927"..Vehicle.. "$", 255, 255 ,255, true)
- outputChatBox("Ingatlanadó: #08c927"..InteriorPay.. "$", 255, 255 ,255, true)
- if allPay >= 0 then
- outputChatBox("Összesen: #08c927"..allPay.. "$", 255, 255 ,255, true)
- else
- outputChatBox("Összesen: #dc143c"..allPay.. "$", 255, 255 ,255, true)
- end
- outputChatBox("-------")
- outputChatBox("Banki kamat: #08c927"..Player.. "$", 255, 255 ,255, true)
- outputChatBox("PP bónusz: #08c927 5PP", 255, 255, 255, true)
- exports.exg_dashboard:getPlayerPayment()
- setElementData(localPlayer, "char:money", getElementData(localPlayer, "char:money") - allPay)
- setElementData(localPlayer, "char:pp", getElementData(localPlayer, "char:pp") + 5)
- triggerServerEvent("payDayServer", localPlayer, localPlayer,tonumber(Player), localPlayer:getData("char:bankmoney") + tonumber(math.floor(Player)) )
- triggerServerEvent("giveGOV", localPlayer, localPlayer, tonumber(allPay))
- else
- outputChatBox("#D24D57[Bank] #ffffffSajnálom de mivel sok volt az AFK ezért nem kapsz fizetést.", 255, 255, 255, true)
- end
- end
- function paydayCounter ()
- local pdMinutes = getElementData(localPlayer,"paydayMinutes")
- pdMinutes = tonumber(pdMinutes)
- if pdMinutes then
- if (pdMinutes >= 60) then
- payAllClient()
- triggerServerEvent("paydayExec",root, localPlayer)
- setElementData(localPlayer,"paydayMinutes",0)
- else
- setElementData(localPlayer,"paydayMinutes",tonumber(pdMinutes)+1)
- end
- else
- setElementData(localPlayer,"paydayMinutes",0)
- end
- end
- function paydaySaver ()
- triggerServerEvent("paydayExec",root, localPlayer)
- end
- function startResource()
- Player = 0
- allPay = 0
- Vehicle = 0
- InteriorPay = 0
- --setTimer(payAllClient, 1000*60*60, 1, true)
- setTimer(function()
- paydayCounter()
- end,1000*60*1, 0)
- setTimer(function()
- paydaySaver()
- end,1000*60*10, 0)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startResource)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement