Jump to content

PezFenix2016

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by PezFenix2016

  1. Está bien, y para guardarlo en un xml simplemente lo creo y, para llamarlo al Client que puedo utilizar?
  2. Ok parece que el error se ha quitado, pero ahora cuando uso /outputlogs no me muestra nada, sería mejor meterlo en un xml y luego mostrarlo directamente en el memo?
  3. Si, me sigue tirando el mismo error: ERROR: outputpanel/c.lua:310: attempt to concatenate field "?" (a nil value) la línea 310 es la que contiene esta parte del código cadenitaTexto = autores[v].."agregó un output cuyo texto era: "..outputs.."\n" pero creo que el error me la debe estár causando esta local textoString = table.concat(informacionTotal)
  4. dice que en la línea 310, pero debe ser en la que uso el table.concat
  5. Ah! ya entendí! ahora me funciona perfecto, gracias capo. otra pregunta y creo que la última, tengo esto: autores = {} outputs = {} informacionTotal= {} function output1() local text = guiGetText ( nombreBox ) local text1 = guiGetText ( mensajeBox ) if ( (guiCheckBoxGetSelected(staffCheck) == false) and (guiCheckBoxGetSelected(gobiernoCheck) == false) and (guiCheckBoxGetSelected(faCheck) == false) and (guiCheckBoxGetSelected(swatCheck) == false) and (guiCheckBoxGetSelected(desempleadosCheck) == false) and (guiCheckBoxGetSelected(desocupadosCheck) == false) and (guiCheckBoxGetSelected(emergencyCheck) == false) and (guiCheckBoxGetSelected(civilCheck) == false) and (guiCheckBoxGetSelected(pandillerosCheck) == false) and (guiCheckBoxGetSelected(policiasCheck) == false) and (guiCheckBoxGetSelected(criminalesCheck) == false) and (guiCheckBoxGetSelected(honourablesCheck) == false) and (guiCheckBoxGetSelected(hitCheck) == false) and (guiCheckBoxGetSelected(noticiasCheck) == true)) then if (text1 ~= "") then textito14 = "\n#00FF00NOTICIAS: #FFFFFF "..text1.."\n" triggerServerEvent("onClientMessage", localPlayer, textito14) table.insert(autores,getPlayerName(localPlayer)) table.insert(outputs,textito14) end end for k,v in ipairs(autores) do for _,i in ipairs(outputs) do cadenitaTexto = tostring(autores[v].."agregó un output cuyo texto era: "..outputs[i].."\n") table.insert(informacionTotal,cadenitaTexto) end end end addEventHandler("onClientGUIClick", showingButton, output1) function mostrarLogs() if (guiGetVisible(ventanaLogs) == true) then local textoString = table.concat(informacionTotal) guiMemoSetCaretIndex(memoLogs,#textoString) end end function mostrarLogs() if (guiGetVisible(ventanaLogs) == true) then local textoString = table.concat(informacionTotal) guiMemoSetCaretIndex(memoLogs,#textoString) end end Básicamente, lo que pasa es que cuando el jugador que tiene la GUI abierta, clickee en la checkbox y acto seguido llene la información de 2 edit box que hay, me mande un mensaje al outputChatBox, hasta ahí todo funciona correctamente. ahora lo que quiero hacer es que, usando tables, me guarde el nombre y el mensaje que dicho jugador ha enviado al output, todo eso en una nueva tabla que se llama "informacionTotal", para hacer una especie de "logs", luego cuando el jugador use /outputlogs, el memo que tengo vacío se llene con la información que tiene la tabla. el problema es que, el debugscript me arroja el siguiente error: ERROR: outputpanel/c.lua:310: attempt to concatenate field "?" (a nil value) y lo que no logro entender es, por qué hay un valor vacío si se supone que cuando el jugador le da click al botón de la primera gui, me guarda en una table la información que esté llenó... en donde me estaré equivocando?
  6. Si pero sería mucho más facil en client porque estoy trabajando con todas las variables que necesito no? en todo caso, hice un trigger pero parece que no funciona
  7. Gracias capo, otra preguntica, eso me lo está mostrando en client pero, como hago para que todos vean mi mensaje? intenté hacer trigger pero al parecer nadie lo ve excepto yo...
  8. hola, pues es una pequeña duda que tengo y además un problema, nunca había trabajado con un outputChatBox en clientSide, primera vez que lo he hecho, ahora mismo estoy haciendo un pequeño script y tengo un problema y es el siguiente: outputChatBox("\n#00FF00 NOTICIAS: #ffFFff "..text1.."\n") lo que pasa es que, se supone que al ponerle los códigos HTML de colores, los debería de leer, pero no me está apareciendo el color, al contrario, cuando sale el mensaje en el chat, se muestra precisamente así: #00FF00 NOTICIAS: #ffFFfffcomo están?? a lo que quiero llegar es que, no me está mostrando los colores indicados, he visto un script que realizó alguien mas y le funciona perfectamente, lo que no entiendo es por qué a la hora de yo hacerlo no me está funcionando. Agradezco ayuda.
  9. Ok, pero con las funciones que me has dado, solo se podría cuando un jugador escribe un comando, pero no tengo ni idea de como detectar si un jugador está presionando un bind...
  10. Hola buen día, iré directo al grano y es que tengo una pequeña pregunta, es posible saber si un jugador tiene cierto comando bindeado a un tecla? Por ejemplo, saber si un jugador tiene el comando /hola a la tecla "k", y luego ejecutar una acción cuando este jugador presione dicha tecla, por ejemplo, asesinar al jugador cuando este presione la tecla? En resumen lo que quiero hacer es un script que me detecte si un jugador tiene cierto bind y luego ejecutar una acción; es esto posible? Si es posible, agredecería a alguien que me dijera que funciones pueden ser útiles para realizar este script. Saludos gente!
  11. Hello, this is just a little question, how can I know if a player already hit a marker? I mean, I created a marker, then executed certain functions once the player hit the marker, but it's executing those functions again when the player hit the marker again. How can I make a restriction for that? I just want it works only once (only when the player hit the marker for the first time). Someone told me to use tables so I can get the players' names on it, then make a restriction with those names, but I don't know how to start. can someone give me a hand with useful functions that I can use to make it works? thanks for taking your time on reviewing my topic.
  12. Perdón por el double post, esto es lo que tengo actualmente, se supone que lo que quiero que haga es que, me llene una tabla con los nombres de los jugadores en el team "hit", luego, me recorra esa tabla, y cuando el jugador vuelva a pasar por el marker, me cancele ese evento, pero no me está funcionando, al contrario, me está tirando error el debugscript: s.lua:12: Bad argument @ 'AddEventHandler' [Expected function at argument 3, got number '1999'] Me podrían decir en donde me estoy equivocando? porque hasta donde veo, el argumento 3 debería regresarme el nombre del jugador, no un número aquí les dejo mi código: Jugadore:~s = getPlayersInTeam (teamHits) Jugadores ={} teamHits= createTeam( "Hits", 0, 0, 0 ) cantidad = 0 function hit(player, commandName, hitMoney) if ((tonumber(hitMoney)> 0) and (tonumber(hitMoney) <= 100000)) then cantidad = tonumber(hitMoney) x,y,z = getElementPosition( player) marcador = createMarker ( x+2,y,z-1, "cylinder", 2.0, 0, 255, 0 ) addEventHandler("onMarkerHit",marcador, paraHit) addEventHandler("onMarkerHit",marcador, cantidad) else outputChatBox( "Error: Cantidad máxima por hit es de $100.000",player, 255, 0, 0) end end addCommandHandler("hitmarker", hit) function paraHit( hitElement, matchingDimension) if (getElementType( hitElement )== "player") then setPlayerTeam ( hitElement, teamHits ) blip = createBlipAttachedTo(hitElement, 26) setPlayerNametagColor ( hitElement, 0, 0, 0) triggerClientEvent (hitElement, "crearTexto", hitElement) outputChatBox ("Un nuevo hit se ha plantado sobre "..getPlayerName(hitElement).." de $"..cantidad..", matalo para ganar el dinero!", getRootElement(), 243, 255, 28) end end function getMoney(ammo, killer,killerweapon, bodypart) if ( killer ) and ( killer ~= source ) then givePlayerMoney(killer, cantidad) destroyElement(blip) setPlayerNametagColor(source, 243, 255, 28) triggerClientEvent ( source, "removerTexto", source) outputChatBox(getPlayerName(killer).." ha completado el hit sobre "..getPlayerName(source).." y ganado una recompensa de $"..cantidad,getRootElement(), 243, 255, 28) end destroyElement(blip) end addEventHandler("onPlayerWasted", root, getMoney) function destruirMarker() if isElement(marcador) then destroyElement(marcador) end end addCommandHandler("removerhitmarker", destruirMarker) function cantidad() for i=1,#Jugadore:~s do local playerName = getPlayerName(Jugadore:~s[i]) . table.insert( Jugadores, playerName ) end table.sort( Jugadores ) for i=1,#Jugadores do if (getPlayerTeam(Jugadores[i]) == "Hits" ) then removeEventHandler("onMarkerHit",marcador, paraHit) end end end
  13. Podrías darme un indicio de como empezar más o menos? así tengo la idea y lo termino yo solo, te lo agradecería
  14. Muchas gracias! funcionó perfectamente, sos un crack. Tengo otra pregunta, como hago para garantizar que el jugador no vaya a pasar por el marker una segunda vez? osea, que solo toque el marker una vez y listo
  15. Bueno muy buenas a todos, iré directo al grano, estoy haciendo un sistema de hits, para que cuando el admin coloque /hitme <cantidad> se cree un marker, luego, al ingresar cualquier jugador, se ofrecerá una recompensa de la cantidad dada, y obviamente, todo aquel jugador que lo mate obtendrá esa recompensa. El problema que tengo es que, al momento de usar el eventHandler "onMarkerHit", me dice que está obteniendo un nil en el segundo argumento de este, pero lo extraño es que arriba tengo creado el marker con el cual se va a ejecutar la acción , si alguien podría ser tan amable de decirme en donde me he equivocado, se lo agradezco mucho. Aquí está mi código: function ejecutar(thePlayer,commandName, ammount) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if (isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) )) or (isObjectInACLGroup ("user."..accName, aclGetGroup ( "L2" ) )) or (isObjectInACLGroup ("user."..accName, aclGetGroup ( "L3" ) )) or (isObjectInACLGroup ("user."..accName, aclGetGroup ( "L4" ) )) or (isObjectInACLGroup ("user."..accName, aclGetGroup ( "L5" ) )) or (isObjectInACLGroup ("user."..accName, aclGetGroup ( "L1337" ) )) then if (ammount >= tostring(100000)) then x,y,z = getElementPosition( thePlayer) theMarker = createMarker( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 ) else outputChatBox( "Error: Cantidad máxima por hit es de $100.000",thePlayer, 255, 0, 0) end else outputChatBox( "Error: No tienes permiso para ejecutar este comando",thePlayer, 255, 0, 0) end end addCommandHandler("hitmarker", ejecutar) function paraHit( hitPLayer, matchingDimension ) if getElementType ( hitPLayer ) == "player" then nameOfThePlayer = getPlayerName ( hitPLayer ) setPlayerNametagColor ( hitPLayer, 0, 0, 0) triggerClientEvent ( hitPLayer, "crearTexto", hitPLayer) outputChatBox ("Un nuevo hit se ha plantado sobre "..nameOfThePlayer.." de $"..ammount..", matalo para ganar el dinero!", getRootElement(), 255, 0, 0) end end addEventHandler("onMarkerHit",theMarker, paraHit) function recompensaHit( ammo, killer, killerweapon, bodypart ) --Si hay un asesino, y ese asesino es diferente a el mismo if ( killer ) and ( killer ~= source ) then if ( killer ) and ( killer == hitPLayer ) then givePlayerMoney(killer, ammount) nameOfTheKiller = getPlayerName(killer) outputChatBox(nameOfTheKiller.." ha completado el hit sobre "..nameOfThePlayer.." y ganado una recompensa de $"..ammount, getRootElement(), 243, 255, 28) setPlayerNametagColor(hitPLayer, 181, 32, 33) triggerClientEvent ( hitPLayer, "removerTexto", hitPLayer) end end end addEventHandler ( "onPlayerWasted", getRootElement(), recompensaHit )
  16. Algo debes estar haciendo mal al momento de restringir los permisos con el ACL, postea tu código e intentaremos ayudarte en lo más que podamos.
  17. I'm getting this problem, the video isn't even playing. can you please give me atleast one example about how should I use the dxDraw to render the image?
  18. Well but that isn't the main problem as it seems to been working but the video isn't playing. I guess you mean this part of the code right? function dxDrawImage3D(x,y,z,w,h,m,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c , ...) end
  19. Hey there, I have been scripting a cinema for myself, the problem is that it isn't showing the video, The video does not play on the screen, it just stays static, I do not see any errors in my code, what do you guys think I'm doing wrong? Here you go, this is my client-sided code: local ventanitaLinda = guiCreateWindow(281, 281, 484, 149, "YT", false) addEventHandler("onClientResourceStart", resourceRoot, function () guiWindowSetSizable(ventanitaLinda, false) guiSetVisible(ventanitaLinda,false) links = guiCreateEdit(117, 31, 353, 36, "", false,ventanitaLinda) guiWindowSetSizable(ventanitaLinda, false) guiSetAlpha(ventanitaLinda, 1.00) etiqueta= guiCreateLabel(42, 36, 139, 25, "Ingrese ID:", false,ventanitaLinda) btngo = guiCreateButton(10, 90, 191, 44, "Crear", false,ventanitaLinda) btncancel = guiCreateButton(274, 88, 191, 44, "Cancelar", false,ventanitaLinda) etiqueta2 = guiCreateLabel(224, 102, 31, 22, "O", false,ventanitaLinda) guiSetVisible(ventanitaLinda,false) end ) function dxDrawImage3D(x,y,z,w,h,m,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c , ...) end local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() local x, y = 110.7, 1024.15 dxDrawMaterialLine3D(x, y, 23.25, x, y, 14.75, webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19) end function fullscreen() local URLs = tostring(links) if source == btngo then loadBrowserURL(webBrowser, "https://www.youtube.com/embed/"..URLs.."?autoplay=1&iv_load_policy=3&enablejsapi=1&fs=0&theme=light") addEventHandler("onClientRender", root, webBrowserRender) end end addEventHandler("onClientBrowserCreated", webBrowser, fullscreen) addEventHandler("onClientGUIClick",root,fullscreen) function url() guiSetVisible(ventanitaLinda,true) showCursor( true ) guiSetInputEnabled( true ) end addEvent("onAbrir", true) addEventHandler("onAbrir", root, url) function closeman() if source == btncancel then guiSetVisible(ventanitaLinda,false) showCursor( false ) guiSetInputEnabled(false) end end addEventHandler("onClientGUIClick",root,closeman) Thanks for the help btw.
  20. Ok, gracias por responder, lo he cambiado a onClientRender, pero el problema que tengo ahora es que, no me reproduce el video, es como si no leyera lo que tengo en la caja de texto... y encima, el debugscript 3 me tira un error: Bad Usage @ "addEventHandler" ['OnClientRender' with this function is already handled] No entiendo que está pasando aquí...
  21. Buen día, he estado trabajando con este script para crear una ventana de youtube, el problema es que, por ahora, simplemente cuando ingreso el URL en la GUI, crea la pantalla de youtube pero no me reproduce el vídeo, osea, simplemente me lo está dejando estático, no lo reproduce, independientemente de cual sea el URL que coloque, alguien podría ser tan amable de decirme en donde me estoy equivocando? para saber que debo corregir. Agradezco de antemano la ayuda que me brinden. Aquí está el código que he construido: local ventanitaLinda = guiCreateWindow(281, 281, 484, 149, "Fish Cinema", false) addEventHandler("onClientResourceStart", resourceRoot, function () guiWindowSetSizable(ventanitaLinda, false) guiSetVisible(ventanitaLinda,false) links = guiCreateEdit(117, 31, 353, 36, "", false,ventanitaLinda) guiWindowSetSizable(ventanitaLinda, false) guiSetAlpha(ventanitaLinda, 1.00) etiqueta= guiCreateLabel(42, 36, 139, 25, "Ingrese ID:", false,ventanitaLinda) btngo = guiCreateButton(10, 90, 191, 44, "Crear", false,ventanitaLinda) btncancel = guiCreateButton(274, 88, 191, 44, "Cancelar", false,ventanitaLinda) etiqueta2 = guiCreateLabel(224, 102, 31, 22, "O", false,ventanitaLinda) guiSetVisible(ventanitaLinda,false) end ) function dxDrawImage3D(x,y,z,w,h,m,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c , ...) end local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() local x, y = 110.7, 1024.15 dxDrawMaterialLine3D(x, y, 23.25, x, y, 14.75, webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19) end function fullscreen() local URLs = tostring(links) if source == btngo then loadBrowserURL(webBrowser, "https://www.youtube.com/embed/"..URLs.."?autoplay=1&iv_load_policy=3&enablejsapi=1&fs=0&theme=light") addEventHandler("onClientPreRender", root, webBrowserRender) end end addEventHandler("onClientBrowserCreated", webBrowser, fullscreen) addEventHandler("onClientGUIClick",root,fullscreen) function url() guiSetVisible(ventanitaLinda,true) showCursor( true ) guiSetInputEnabled( true ) end addCommandHandler("cinema",url) function closeman() if source == btncancel then guiSetVisible(ventanitaLinda,false) showCursor( false ) guiSetInputEnabled(false) end end addEventHandler("onClientGUIClick",root,closeman)
  22. Hello, I'm selling a complete server with the old DKR server/Badwolf server Style, here you can see the amount of people that used to play on those servers, you can get people on an easy way. More information about, leave a message please. Thanks.
  23. Hola, gracias! pude ver que tenía ese error, lo cambié y seguía sin funcionar, entonces intenté modificar el script de otra manera, quedó así: Client: addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == takebtn ) then local row, col = guiGridListGetSelectedItem ( skinsgrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( skinsgrid, row, 1 ) if ( skinName == "Pizzero" ) then triggerServerEvent ( "setPizza1", localPlayer) elseif ( skinName == "Pizzera" ) then triggerServerEvent ( "setPizza2", localPlayer) end guiSetVisible ( windowjob, false ) showCursor ( false ) else outputChatBox("Error: Por favor escoge un traje de la lista", 255,0,0) end elseif ( source == closebtn ) then guiSetVisible ( windowjob, false ) showCursor ( false ) end end ) Server: local pizzablip = createBlip(2104.6, -1787.8, 12.6, 56) theTeam = createTeam("Trabajadores Civiles", 255,255,21) function Pizzas1(source) ponerTeam = setPlayerTeam(source, theTeam) elskin1 = setElementModel(source, 155) end addEvent("setPizza1", true ) addEventHandler( "setPizza1", resourceRoot, Pizzas1) function Pizzas2(source) ponerTeam = setPlayerTeam(source, theTeam) elskin2 = setElementModel(source, 205) end addEvent("setPizza2", true ) addEventHandler( "setPizza2", resourceRoot, Pizzas2) El problema es que en ningún momento cuando selecciono el skin del gridList y le doy en aceptar me coloca el skin de pizzero o me mueve al team de trabajadores civiles, ya he intentado y no me funciona
  24. Hola buen día, tengo lo siguiente: En Client: ddEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == takebtn ) then local row, col = guiGridListGetSelectedItem ( skinsgrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( skinsgrid, row, 1 ) if ( skinName == "Pizzero" ) then triggerServerEvent ( "setPizza", localPlayer, 155 ) elseif ( skinName == "Pizzera" ) then triggerServerEvent ( "setPizza", localPlayer, 205 ) end guiSetVisible ( windowjob, false ) showCursor ( false ) else outputChatBox("Error: Por favor escoge un traje de la lista", 255,0,0) end elseif ( source == closebtn ) then guiSetVisible ( windowjob, false ) showCursor ( false ) end end ) En server: function Pizzas(thePlayer, skinID) elskin = SetElementModel(thePlayer, skinID) end addEvent("setPizza", true ) addEventHandler( "setPizza", resourceRoot, Pizzas) Basicamente lo que quiero hacer es poder poner el ID del skin en el otro argumento del "TriggerServerEvent", por eso puse el " triggerServerEvent ( "setPizza", localPlayer, 205 )", siendo el 205 el ID del skin que quiero que apareza al seleccionar un elemento del gridList y presionar en "aceptar", se supone que con lo que está codeado en el serverside se podría poner la ID sin problemas, pero no pasa nada, tendré algún error? Apreciaría cualquier ayuda
  25. Hola, tengo una duda sobre el gridList, y quisiera saber si es posible almacenar los datos o textos que hay en las columnas de un gridList en una tabla y luego poder llamar dichos objetos con un for. Es posible? me podrían dejar un ejemplo de como podría empezar? Se los agradezco
×
×
  • Create New...