-
Posts
321 -
Joined
-
Last visited
Everything posted by Flipi
-
I appears an error: WARNING: reglas\reglas.lua:11: Bad argument @ 'outputChatBox' [Expected element at argument 2, got number '255']
-
something like this could be? addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) cancelEvent () if message == "!reglas" end then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end
-
in this part? if message == "!reglas" then addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) if message == "!reglas" then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end )
-
Hi, How do for the command "!rules" appears on the bottom of posts? I explain it right? image: http://img35.imageshack.us/img35/402/wchm.png addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) if message == "!reglas" then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end )
-
asi? local sx, sy = guiGetScreenSize() local sx = sx / 2 local sy = sy / 2 function drawText() local r,g,b = (0,128,255) local width = dxGetTextWidth(theText, 3, "default") local height = dxGetFontHeight(3, "default") local leftB = sx - width / 2 local topB = sy - (height + 5) local left = sx - width / 2 local top = sy - height dxDrawText(theText, leftB+2, topB+2, left, top, tocolor(0, 0, 0, 255), 3, "default-bold", "left", "top", false, true, true) dxDrawText(theText, leftB, topB, left, top, RGBColor(r,g,b), 3, "default-bold", "left", "top", false, true, true) end draw = false function drawShout(text) if not draw then theText = text addEventHandler("onClientRender", root, drawText) draw = true setTimer(function() draw = false removeEventHandler("onClientRender", root, drawText) end, 5000, 1) end end addEvent("onShouts", true) addEventHandler("onShouts", root, drawShout) function RGBColor(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return end No, donde están las variables que representan los valores obtenidos del settings? en el local r,g,b, ahí seria o no?
-
Con eso no tendría sentido usar el settings porsupuesto, el objetivo es hacer que se pueda ocupar un setting para el color del texto
-
asi? local sx, sy = guiGetScreenSize() local sx = sx / 2 local sy = sy / 2 function drawText() local r,g,b = (0,128,255) local width = dxGetTextWidth(theText, 3, "default") local height = dxGetFontHeight(3, "default") local leftB = sx - width / 2 local topB = sy - (height + 5) local left = sx - width / 2 local top = sy - height dxDrawText(theText, leftB+2, topB+2, left, top, tocolor(0, 0, 0, 255), 3, "default-bold", "left", "top", false, true, true) dxDrawText(theText, leftB, topB, left, top, RGBColor(r,g,b), 3, "default-bold", "left", "top", false, true, true) end draw = false function drawShout(text) if not draw then theText = text addEventHandler("onClientRender", root, drawText) draw = true setTimer(function() draw = false removeEventHandler("onClientRender", root, drawText) end, 5000, 1) end end addEvent("onShouts", true) addEventHandler("onShouts", root, drawShout) function RGBColor(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return end
-
claro pero para el color del texto que get uso? en el local r,g,b Ponle variables entonces se borra el local r,g,b y la función que agregue abajo o no?
-
claro pero para el color del texto que get uso? en el local r,g,b
-
Gracias, oie una consulta, para editar el color como setting en panel de admin agrege esto, pero el r,g,b (colores) como pongo para que se modifique el texto? local sx, sy = guiGetScreenSize() local sx = sx / 2 local sy = sy / 2 function drawText() local r,g,b = local width = dxGetTextWidth(theText, 3, "default") local height = dxGetFontHeight(3, "default") local leftB = sx - width / 2 local topB = sy - (height + 5) local left = sx - width / 2 local top = sy - height dxDrawText(theText, leftB+2, topB+2, left, top, tocolor(0, 0, 0, 255), 3, "default-bold", "left", "top", false, true, true) dxDrawText(theText, leftB, topB, left, top, RGBColor(r,g,b), 3, "default-bold", "left", "top", false, true, true) end draw = false function drawShout(text) if not draw then theText = text addEventHandler("onClientRender", root, drawText) draw = true setTimer(function() draw = false removeEventHandler("onClientRender", root, drawText) end, 5000, 1) end end addEvent("onShouts", true) addEventHandler("onShouts", root, drawShout) function RGBColor(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return end Meta setting... name="*Color de texto" value="#0080FF" />
-
muchas gracias !, me dirías cuales podrían ser las coordenadas para que se adapte según cualquier resolución de pantalla, con tal de que quede centrado?
-
Reemplaza lo de client por esto: function shouts( message ) if isTimer( d ) then return end theText = message addEventHandler ( "onClientRender", root, drawing ) d = setTimer ( function() removeEventHandler( "onClientRender", root, drawing ) end, 5000, 1 ) end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) function drawing() dxDrawText( theText, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) end tampoco, no aparece nada en la pantalla
-
Se me ocurre algo así: Server: function shout( player, cmd, ... ) local accountname = getAccountName( getPlayerAccount( player ) ) local w = {...} local message = table.concat(w, " ") if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( root, "onShouts", root, message ) else outputChatBox( "* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true ) end end addCommandHandler( "shout", shout ) Client: function shouts( message ) if isTimer( d ) then killTimer( d ) end message = message addEventHandler ( "onClientRender", root, drawing ) d = setTimer ( function() removeEventHandler( "onClientRender", root, drawing ) end, 5000, 1 ) end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) function drawing() dxDrawText( message, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) end lo probé y no manda el mensaje...
-
algo asi?, se que esta mal Client.... function shouts(player, ...) local message = table.concat({...}," ") dxDrawText(""..message, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) if not outputChatBox("* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true) then end end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) server... function shout(player, cmd, ...) local times = 5000 local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then for id, players in ipairs(getElementsByType("player")) do triggerClientEvent ( "onShouts", getRootElement()) setTimer("", times, 1) end else outputChatBox("* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true) end end addCommandHandler("shout", shout)
-
Hola, no logro hacerlo de manera correcta , me echan una mano?, trata sobre un shout para admin..... function shout(player, cmd, ...) local times = 5000 local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then for id, players in ipairs(getElementsByType("player")) do local message = table.concat({...}," ") dxDrawText(""..message, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "left", "top", false, false, true, true, false ) setTimer(stopDisplayDrawText, times, 1) end else outputChatBox("* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true) end end addCommandHandler("shout", shout)
-
y como lo agrego al script si ya tengo un guiStaticImageLoadImage?
-
I have an error in this part Error: Warning: resource\server.lua:47: Bad argument @ 'killtimer' [Expected lua-timer at argument 1] local discoTimer = {} local discoState = {} addCommandHandler("disco", function(source) local vehicle = getPedOccupiedVehicle(source) if not vehicle then outputChatBox( "* #0080FFNecesitas un vehiculo para usar el comando!", source, 255, 255, 255, true ) return end if not discoState[source] then discoState[source] = true discoTimer[source] = setTimer( function (veh) setVehicleOverrideLights(veh, 2) setVehicleHeadLightColor(veh, math.random(0,255), math.random(0,255), math.random(0,255) ) end, 150, 0, vehicle) outputChatBox( "* #0080FFDisco light Activado!", source, 255, 255, 255, true ) else outputChatBox( "* #0080FFDisco light Desactivado!", source, 255, 255, 255, true ) if discoTimer[source] then killTimer( discoTimer[source] ) discoState[source] = false setVehicleOverrideLights(vehicle, 1) setVehicleHeadLightColor(vehicle, 255, 255, 255 ) end end end ) addEventHandler( "onResourceStart",resourceRoot, function() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end ) addEventHandler( "onPlayerJoin",root, function() discoState[source] = false end ) addEventHandler( "onPlayerQuit", root, function() discoState[source] = false killTimer( discoTimer[source] ) end )
-
the problem is that I get this error: WARNING: resource\traidor.lua:16: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil] ERROR: resource\traidor.lua:16: attempt to concatenate a boolean value WARNING: resource\traidor.lua:8: Bad argument @ 'getPlayerName' [Expected element at argument 1, got boolean] ERROR: resource\traidor.lua:8: attempt to concatenate a boolean value local msgs = {'traidor', 'espia', 'malo'} local randomPlayer = getRandomPlayer ( ) addCommandHandler ("traidor", function() local text = msgs [ math.random ( #msgs )] outputChatBox ( "* #FFFFFF"..getPlayerName ( randomPlayer ).." #0080FFes el #FF8000"..text.." #0080FFen cubierto!",root, 255, 255, 255, true ) end ) addEventHandler("onPlayerChat",getRootElement(), function(message,messageType,randomPlayer) if message == "!traidor" then local text = msgs [ math.random ( #msgs )] outputChatBox ( "* #FFFFFF"..getPlayerName ( randomPlayer ).." #0080FFes el #FF8000"..text.." #0080FFen cubierto!", getRootElement(), 255, 255, 255, true ) end end )
-
thanks !, you help me with this?: local msgs = {'traidor', 'espia', 'malo'} local randomPlayer = getRandomPlayer ( ) function cuest(text,randomPlayer) local text = msgs [ math.random ( 1, #msgs )] if text then outputChatBox ( "* #FFFFFF"..getPlayerName ( randomPlayer ).." #0080FFes el #FF8000"..text.." #0080FFen cubierto!", getRootElement(), 255, 255, 255, true ) end end addCommandHandler ("traidor", cuest) function cuests(message,messageType,randomPlayer) if message == "!traidor" then local text = msgs [ math.random ( 1, #msgs )] outputChatBox ( "* #FFFFFF"..getPlayerName ( randomPlayer ).." #0080FFes el #FF8000"..text.." #0080FFen cubierto!", getRootElement(), 255, 255, 255, true ) end end addEventHandler("onPlayerChat",getRootElement(),cuests)