Jump to content

PezFenix2016

Members
  • Posts

    31
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

PezFenix2016's Achievements

Rat

Rat (9/54)

0

Reputation

  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 )
×
×
  • Create New...