0 Üye ve 1 Ziyaretçi konuyu incelemekte.
-- Client.lua --local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 10)local dxfont1_fonte = dxCreateFont("font/fonte.ttf", 35)local screenW, screenH = guiGetScreenSize()local resW, resH = 1360,768local x, y = (screenW/resW), (screenH/resH)--math.abs(math.sin(getTickCount()/300))*255)function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return falseendfunction menu() tocolor1 = tocolor(0, 0, 0, 164) if isCursorOnElement(screenW * 0.4110, screenH * 0.4766, screenW * 0.1176, screenH * 0.0521) then tocolor1 = tocolor(16, 102, 231, 180) end tocolor2 = tocolor(201, 0, 4, 0) if isCursorOnElement(screenW * 0.6007, screenH * 0.3307, screenW * 0.0279, screenH * 0.0469) then tocolor2 = tocolor(201, 0, 4, 220) end dxDrawRectangle(screenW * 0.2963, screenH * 0.3307, screenW * 0.3324, screenH * 0.2318, tocolor(0, 0, 0, 164), false) dxDrawRectangle(screenW * 0.2963, screenH * 0.3307, screenW * 0.3324, screenH * 0.0469, tocolor(0, 0, 0, 164), false) dxDrawText("Uyku Sistemi V.1.0 SancaK #1066E7", screenW * 0.3066, screenH * 0.3411, screenW * 0.4779, screenH * 0.3906, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("Uyumak İçin Sadece!", screenW * 0.3066, screenH * 0.3854, screenW * 0.4779, screenH * 0.4349, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText(" #FFFFFFUyu Butonuna Bas ", screenW * 0.3066, screenH * 0.4089, screenW * 0.4779, screenH * 0.4583, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText(" #1066E7#FFFFFF", screenW * 0.3066, screenH * 0.4349, screenW * 0.4779, screenH * 0.4844, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.4110, screenH * 0.4766, screenW * 0.1176, screenH * 0.0521, tocolor1, false) dxDrawText("Uyu", screenW * 0.4500, screenH * 0.4922, screenW * 0.6213, screenH * 0.5417, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(screenW * 0.6007, screenH * 0.3307, screenW * 0.0279, screenH * 0.0469, tocolor2, false) dxDrawText("X", screenW * 0.6110, screenH * 0.3411, screenW * 0.7824, screenH * 0.3906, tocolor(255, 255, 255, 200), x*1.30, "default-bold", "left", "top", false, false, false, false, false)endfunction dinfo() local alpha = interpolateBetween(1, 0, 0, 255, 0, 0, (getTickCount()-tick2)/1000, "Linear") dxDrawRectangle(x*0, y*0, x*1360, y*768, tocolor(0, 0, 0, alpha), false) dxDrawText("Uyuyorsun...", screenW * 0.3581, screenH * 0.4336, screenW * 0.7132, screenH * 0.5182, tocolor(255, 255, 255, math.abs(math.sin(getTickCount()/300))*255), x*1.00, dxfont1_fonte, "left", "top", false, false, false, false, false)endfunction render() if not isEventHandlerAdded("onClientRender", root, menu) then addEventHandler("onClientRender", root, menu) showCursor(true) endendaddEvent("hotelMenuH", true)addEventHandler("hotelMenuH", root, render)function renderD() if not isEventHandlerAdded("onClientRender", root, dinfo) then addEventHandler("onClientRender", root, dinfo) endendaddEvent("renderD", true)addEventHandler("renderD", root, renderD)function closeDx() if isEventHandlerAdded("onClientRender", root, menu) then removeEventHandler("onClientRender", root, menu) showCursor(false) endendfunction closeDxD() if isEventHandlerAdded("onClientRender", root, dinfo) then removeEventHandler("onClientRender", root, dinfo) showCursor(false) endendfunction close(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.6007, screenH * 0.3307, screenW * 0.0279, screenH * 0.0469) then removeEventHandler("onClientRender", root, menu) showCursor(false) end end endendaddEventHandler("onClientClick", root, close)function dormir(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.4110, screenH * 0.4766, screenW * 0.1176, screenH * 0.0521) then tick2 = getTickCount() triggerServerEvent("dormir", localPlayer) closeDx() setTimer(function() closeDxD() end, 30000, 1) end end endendaddEventHandler("onClientClick", root, dormir)function isCursorOnElement( posX, posY, width, height ) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return falseend-- Server.lua --function fadeCameraDelayed(player) if (isElement(player)) then fadeCamera(player, true, 0.5) endendlocal marker = createMarker(1919.75561, -2404.73730, 13.53911, "cylinder", 2, 255, 255, 0, 0) local inutil = createMarker(1919.75561, -2404.73730, 13.53911, "cylinder", 2, 255, 255, 255, 0) setElementInterior(marker, 15) setElementDimension(marker, 2) setElementInterior(inutil, 15) setElementDimension(inutil, 2)local blip = createBlip(1919.75561, -2404.73730, 13.53911)---İÇERİ GİRİŞlocal pickup = createPickup(1919.75561, -2404.73730, 13.53911, 3, 1272, 1)---KAPI MARKERİlocal pickup2 = createPickup(1923.45056, -2400.44580, 13.69380, 3, 1272, 0)---İÇERİ GİRİNCEKİ YER setElementInterior(pickup2, 15) setElementDimension(pickup2, 2)function entrar(thePlayer) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) setTimer(fadeCameraDelayed, 1000, 1, thePlayer) setTimer(function() setElementInterior(thePlayer, 15, 1918.73693, -2386.32324, 13.69380) setElementDimension(thePlayer, 2) end, 1000, 1)endaddEventHandler("onPickupHit", pickup, entrar)function dormir() if getElementType(source) == "player" then money = getPlayerMoney(source) if money >= 0 then triggerClientEvent(source, "renderD", root) takePlayerMoney(source, 500) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#1066E7[Uyku] #FFFFFF30 SANİYE SONRA UYANICAKSIN", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) setTimer(fadeCamera, 30000, 1, source, false, 1.0, 0, 0, 0) setTimer(fadeCameraDelayed, 30000, 1, source) setTimer(setElementInterior, 30000, 1, source, 0, 1939.57751, -2396.55981, 13.69380) ----UYANINCA SPAMLANMA YERİ setTimer(setElementDimension, 30000, 1, source, 0) setTimer(setElementData, 30000, 1, source, "sono", 100) else outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#FF0000[Uyku] YETERSİZ PARA.", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) end endend addEvent("dormir",true)addEventHandler("dormir", root, dormir)function sair(thePlayer) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) setTimer(fadeCameraDelayed, 1000, 1, thePlayer) setTimer(function() setElementInterior(thePlayer, 0, 1939.57751, -2396.55981, 13.69380)---MAVİ MARKERDEN ÇIKIŞ YAPINCA IŞINLAR setElementDimension(thePlayer, 0) end, 1000, 1)endaddEventHandler("onMarkerHit", exit, sair)function open(source) triggerClientEvent(source, "hotelMenuH", root)endaddEventHandler("onPickupHit", pickup2, open)
{-1384.048828125,-68.69130706787,14.1484375 -1.1,"cylinder", 1, 255, 0, 0, 255},
Kardeşim sorununu tam olarak anlayamadım eğer marker yerin içinde ise bu markeri yukarıya taşımak istiyorsan guiCreateMarker kısmından 13 ile kordinatı 14 - 15 arası birşey yap