mortal Posted November 22, 2017 Share Posted November 22, 2017 (edited) como poner una notificación al Respawn_Autos y no salga en chat del juego server : function respawnExplodedVehicle() setTimer(respawnVehicle, 5000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle) ---------------------------------------------------------------------------------------------------------------------------------- el otro lua server _: function respawnVehicles() outputChatBox ( "Legends// los vehiculos respawnearan en 20 segundos" ) setTimer(function () local vehicles = getElementsByType ( "vehicle" ) outputChatBox ( "Legends// vehiculos respawneados" ) for k, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then respawnVehicle ( vehicle ) end end end, 20000, 1) end setTimer(respawnVehicles, 1000000, 0) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if (type( passengers ) == 'number') then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end Edited November 22, 2017 by mortal Link to comment
mortal Posted June 4, 2018 Author Share Posted June 4, 2018 On 23/11/2017 at 06:13, msyyn said: English. I get it but it's out of control Respawn_Autos with ??? dx when the respawn is activated it does not work for me to remove local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) alpha = 0 local alphaState = true function alphaFunction() if alphaState == true then alpha = alpha + 10 if alpha >= 255 then alphaState = false end end if alphaState == false then alpha = alpha - 10 if alpha <= 0 then alphaState = true end end end addEventHandler("onClientRender", getRootElement(), alphaFunction) function chat(nome_jogador) nome = nome_jogador; tick15 = getTickCount() addEventHandler ("onClientRender", root, started) setTimer(function() removeEventHandler ("onClientRender", root, started) tick52 = getTickCount() addEventHandler("onClientRender", root, stopped) end, 5000, 1 ) addEventHandler("onClientRender", root, som) setTimer(function() tick52 = getTickCount() removeEventHandler("onClientRender", root, som) end, 50, 1) setTimer(function() removeEventHandler("onClientRender", getRootElement(), stopped) end, 7000, 1) end addEvent ("LimpouChat", true) addEventHandler ("LimpouChat", root, chat) local font = dxCreateFont("gfx/chalet.ttf", local font2 = dxCreateFont("gfx/mypro.ttf", 10) function started() dxDrawRectangle(x*45, y*573, x*291, y*160, tocolor(0, 0, 0, 220), false) dxDrawImage(x*55, y*582, x*18, y*12, "gfx/env.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("#00FF00Mensagem:", x*80, y*579, x*0, y*0, tocolor(255, 255, 255, 255), 1.0, font2, "left", "top", false, false, true, true, false) dxDrawText(nome.."#FFFFFF limpou o bate-papo.", x*0, y*650, x*370, y*0, tocolor(255, 255, 255, 255), 1.0, font2, "center", "top", false, false, true, true, false) end function som() playSound("sfx/notification.mp3", false) end function stopped () local fade,pox,_ = interpolateBetween(100, 200, 0, 0, 200, 0, ((getTickCount() - tick52) / 500), "Linear") dxDrawRectangle(x*45, y*573, x*291, y*160, tocolor(0, 0, 0, fade), false) dxDrawImage(x*55, y*582, x*18, y*12, "gfx/env.png", 0,0,0, tocolor(255,255,255,fade)) dxDrawText("#00FF00Mensagem:", x*80, y*579, x*0, y*0, tocolor(255, 255, 255, fade), 1.0, font2, "left", "top", false, false, true, true, false) dxDrawText(nome.."#FFFFFF limpou o bate-papo.", x*0, y*650, x*370, y*0, tocolor(255, 255, 255, fade), 1.0, font2, "center", "top", false, false, true, true, false) end Link to comment
mortal Posted June 9, 2018 Author Share Posted June 9, 2018 On 23/11/2017 at 06:13, msyyn said: estes el cliente ... local screenW, screenH = guiGetScreenSize()local x, y = (screenW/1366), (screenH/768)local font = dxCreateFont("gfx/chalet.ttf", local font2 = dxCreateFont("gfx/mypro.ttf", 10)activado = truesetTimer(function()activado = false end, 5000, 1)activado1 = falsesetTimer(function()activado1 = trueend, 5000, 1)function respawnVehicles()if activado thenaddEventHandler("onClientRender",root,dxDrawImage)dxDrawRectangle(x*45, y*573, x*291, y*160, tocolor(0, 0, 255, 220), false)dxDrawImage(x*55, y*582, x*18, y*12, "gfx/env.png", 0,0,0, tocolor(255,255,255,255))dxDrawText("Legends// los vehiculos respawnearan en 20 segundos", x*80, y*579, x*0, y*0, tocolor(255, 255, 255, 255), 1.0, font2, "left", "top", false, false, true, true, false)end setTimer(function () local vehicles = getElementsByType ( "vehicle" ) if activado1 thendxDrawRectangle(x*45, y*573, x*291, y*160, tocolor(0, 0, 255, 220), false)dxDrawImage(x*55, y*582, x*18, y*12, "gfx/env.png", 0,0,0, tocolor(255,255,255,255))dxDrawText("#00FF00Legends// vehiculos respawneados:", x*80, y*579, x*0, y*0, tocolor(255, 25, 255, 255), 1.0, font2, "left", "top", false, false, true, true, false)endfor k, vehicle in ipairs ( vehicles ) doif isEmpty( vehicle ) thenrespawnVehicle ( vehicle )endendend, 20000, 1)end setTimer(respawnVehicles, 30000, 0)function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), respawnVehicles) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) function isEmpty( vehicle )local passengers = getVehicleMaxPassengers( vehicle )if (type( passengers ) == 'number') thenfor seat = 0, passengers doif getVehicleOccupant( vehicle, seat ) thenreturn falseendendendreturn trueendfunction HandleTheRendering ( )addEventHandler( "onClientPreRender", root, respawnVehicles )addEventHandler("onClientRender", root, renderDisplay) -- Mantenga todo visible con onClientRender.addEventHandler("onClientRender",root,dxDrawText)addEventHandler("onClientRender",root,dxDrawRectangle)endaddEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) y el server ... function respawnExplodedVehicle() setTimer(respawnVehicle, 5000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle) ----------------------------------me da conflicto es el time se bujea con el time de la funcion del respawn con el time de este activado1 = false setTimer(function() activado1 = true end, 5000, 1) < este time--------------------------- Link to comment
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