0 Üye ve 1 Ziyaretçi konuyu incelemekte.
İnanmıyosan
local maxAFKTime = 10local afkWarningTime = 7local currentAFKTime = 0local afkWarningEnable = falselocal tickTimer = getTickCount()local screenW, screenH = guiGetScreenSize()local x0, y0 = screenW/2-300, screenH/4*3-100local afkKickCancelled = falsefunction AFKk() local spX, spY, spZ local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then spX, spY, spZ = getElementVelocity(vehicle) else spX, spY, spZ = getElementVelocity(localPlayer) end local speed = (spX^2 + spY^2 + spZ^2)^(0.5) * 180 if (speed < 5) then currentAFKTime = currentAFKTime + 0.1 end if (currentAFKTime > afkWarningTime) then afkWarning() end if (currentAFKTime > maxAFKTime) then tooLongAFK() end endsetTimer(AFKk, 6000, 0)function afkWarning() if (not afkWarningEnable and not afkKickCancelled) then triggerServerEvent("afkWarning", resourceRoot) end if (not afkKickCancelled) then playSoundFrontEnd(18) playSoundFrontEnd(13) end afkWarningEnable = true tickTimer = getTickCount()endfunction tooLongAFK() if (not afkKickCancelled) then triggerServerEvent("tooLongAFK", resourceRoot) endendfunction AktifDegilAFK() if (afkWarningEnable) then dxDrawImage(x0, y0, 600, 200, "warning.png") local minutes = currentAFKTime + (getTickCount()-tickTimer)/60000 if (minutes > maxAFKTime) then minutes = maxAFKTime end dxDrawRectangle(x0+24, y0+143, 552*(minutes/maxAFKTime), 43, tocolor(251,220,68,255)) if (afkKickCancelled) then dxDrawText("Atılmayacaksın", x0+24, y0+143, x0+24+552, y0+143+43, tocolor(0,0,0,255), 2.00, "default-bold", "center", "center") end endendaddEventHandler("onClientRender", root, AktifDegilAFK)function cancelAFK() currentAFKTime = 0 afkWarningEnable = falseendaddEventHandler("onClientKey", root, cancelAFK)function cancelAFKwarning() afkKickCancelled = trueendaddEvent("cancelAFKwarning", true)addEventHandler("cancelAFKwarning", resourceRoot, cancelAFKwarning)