Jump to content

Calculador

Members
  • Posts

    197
  • Joined

Posts posted by Calculador

  1. Hello, 

    I have a problem with php sdk for MTA with my web page when it is hosted. When i test the php sdk and the script that i made in mi localhost with XAMPP this works fine, but when i upload the page to my host this doesn't work. I want to ask if anyone knows about a permissions or something like that that i need to be aware when working  with PHP SDK and hosting, because the server and page are hosted.

    The error i get in the page is: Connection refused.

  2. Hello everyone,

    Does anyone know of a page that converts youtube url to url to play by 3D sound?

    Or there is some other way to reproduce a 3D sound which it is hearding in a browser in the game for example.

    I want to play sound 3D of youtube URL, but the links that i used in the past versions of my script now dont works.

    Thanks.

  3. 20 hours ago, Chris!i! said:

    Thanks, this does work, but.. How i make that the sound will be convert in the server, so how i take the url of the sound when i put the link in the server ?

    Because the link convert a url and a sound, but how i do this in the server only with the link of youtube.

    With the previous link i did how this:

      fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) -- with url of youtube

    Thanks for your answer.

  4. Hello everyone,

    In this post i want to ask about a script with youtube music. I did a system that play sound 3D with a link of youtube, but this system doesnt work, i dont know the reason, but i think that the page to convert the link dead. I would want know if anyone have a link to convert youtube links or how i can do a system take the link of a song that are play in the browser of the player.

    The link that i used is: http://www.convertmp3.io

    Thanks.

  5. Thanks, this work without the tag "html" in the meta. 

    But  I came up another question about the section "Resource Web Access": 


    In the example that propose so that through a button made in html a message is sent on the server,  could be executed only with a host that has availability to open the website in that way, or it could also be locally ?

     

  6. @IIYAMA  

    What I tried to do at the beginning was to try thus example of the wiki:

    local browser = guiGetBrowser(guiCreateBrowser(200, 200, 400, 200, true, false, false))
    
    addEventHandler("onClientBrowserCreated", browser,
        function ()
            loadBrowserURL(source, "http://mta/local/page.html") --Containing <span id="nick"></span> somewhere in the file
        end)
    
    --The page has to load first
    addEventHandler("onClientBrowserDocumentReady", browser,
        function ()
            executeBrowserJavascript(source, "document.getElementById('nick').innerHTML = '" .. getPlayerName(localPlayer) .. "'");
        end)

    But my file of html does not work.

    In the meta i did put this:

     <html src='page.html' default='true' />

     

  7. Good morning, I have a question about the following function: 

    loadBrowserURL

    I want to use a remote website hosted on my resource, and I put the URL as indicated by the wiki for this purpose, but it does not work, it appears as if the link was damaged. I wanted to ask if it is strictly necessary for some type of port to be open or any additional requirement for this URL to load.

    For more understanding, what i want to do:

     loadBrowserURL(source, "http://mta/resource/page.html")

    But this does not work.

    Thanks in advance.

  8. Buenas a todos, tengo una pregunta básica acerca de la siguiente función:

    loadBrowserURL

    Quiero utilizar un sitio web remoto alojado en mi resource, y pongo la URL como lo indica la wiki para este fin, pero no me funciona, aparece como si el link estuviera dañado. Quería preguntar si es estrictamente necesario que algún tipo de puerto este abierto o algún requisito adicional para que pueda cargar esta URL.

    Gracias de ante mano.

  9. Que buscas exactamente con el for de la función de ingreso (playerJoin) porque si necesitas que slot sea una variable que incremente automáticamente te estas complicando mucho. Igual, si puedes envía foto del error que te bota el debug para ayudarte mejor.

  10. 22 hours ago, aka Blue said:

    Si usas guiGetText y destroy["nombre del edit"] para obtener la edad, lo único que haces poniendo la # delante es comprobar la longitud de la cantidad introducida. Es decir, que si pones 18 el #edad devolverá 2, no 18. Deberías utilizar tonumber( edad ) o algo similar.

    Es exactamente esto...

     

    function verifyEdad( edad )
    	if not edad then
    		return "No has una edad."
    	elseif tonumber(edad) < 18 then
    		return "Tu edad minima solo puede ser de 18 años."
    	elseif tonumber(edad) >= 99 then
    		return "Tu edad maxima solo puede ser 99 años."
    	elseif tonumber(text) then
    		return "No puedes usar letras"
    	elseif foundSpace then
    		return "No puedes usar espacios"
    	end
    end
    
    function verifyNacionalidad( nacionalidad )
    	if not nacionalidad then
    		return "No has puesto una nacionalidad"
    	elseif not tonumber(text) then
    		return "No tienes ninguna letra escrita"
    	elseif nacionalidad and type(nacionalidad) == "number" then 
    		return "No puedes usar numeros"
    	end
    end
    
    function verifyEstatura( estatura )
    	if not estatura then
    		return "No has una estatura."
    	elseif tonumber(estatura) >= 200 then
    		return "Tu estatura maxima solo puede ser de 200 CM."
    	elseif tonumber(estatura) < 140 then 
    		return "Tu estatura minima solo puede ser de 140 CM."
    	elseif tonumber(text) then
    		return "No puedes usar letras"
    	elseif foundSpace then
    		return "No puedes usar espacios"
    	end
    end

     

  11. Gracias a todos por tomarse el tiempo de responder a mi pregunta, yo también siempre prefiero guardar mis datos en db; simplemente quise experimentar otro método que nunca había usado, pero no resulta tan eficiente como ustedes ya lo han dicho. Sin embargo, no esta de más saber utilizar este tipo de archivos para poder darle una mejor utilidad en otras que valgan la pena.

  12. Gracias a los dos por responder.

    Me ha surgido otra pregunta, ¿cuál es el uso más recomendable con este tipo de archivos? Tenía pensado utilizarlo como herramienta para guardar datos simples,  pero me he puesto a pensar y si se realiza directamente desde client no sería tan eficiente, pues si se crea en el caché de el jugador, a la hora de cambiar de pc o reinstalar el MTA todo aquello que está guardado en este archivo se perdería. ¿es así o estoy mal? 

    Nuevamente muchas gracias. 

  13. 1 hour ago, TRtam said:

    No aparece en tu resource porque ahi no es donde se guarda, se guarda en el cache

    Vale, creo que ya encontré el lugar donde se almacena. Pero entonces, cuando uso la función en un archivo tipo server me aparece en el resource y cuando no, ¿siempre se iría a esa dirección?

    Gracias por responder.

  14. Buenas a todos,

    Me ha surgido una duda cuando trate trabajar por primera vez con archivos de tipo 'XML'. Bueno, lo que pasa es que al intentar crear un archivo XML con la función xmlCreateFile (función compartida) en un archivo lua de tipo "server" el XML se crea con normalidad y aparece en mi resource; pero cuando intento crearlo en un archivo lua tipo client éste no aparece en mi resource. ¿Alguien sabe  el porque?, no me tira ningún error y al parecer ejecuta la función de manera correcta,  ¿Tiene algún sentido esto?

     

    Muchas gracias.

  15. 6 hours ago, NodZen_42 said:

    Hola Chicos, estoy aprendiendo esto del scripting y bueno, tengo este error con mi script

     

    
    function setear_humanos ()
    local GET_TEAM_HUMANOS = isPlayerInTeam(source, "Humanos")
         if GET_TEAM_HUMANOS then
             setElementModel(source, skins_humanos[math.random(#skins_humanos)][1])
    		 outputChatBox("Ahora eres humano", source, 0,200,0)
    	end
    end
    addEventHandler("onPlayerSpawn", root, setear_humanos)
    

    Alguna ayuda?

    Creo que te hace falta pegar la "function source" que es la que contiene la función como tal, en la wiki esta y se especifica que debes usarla. Revisa nuevamente y copia y pega lo que te he dicho anteriormente. (función: isPlayerInTeam)

  16. Tu error es que en el primer argumento estas enviando un String, ya que la función "getPlayerName" te devuelve un String con el nombre del jugador, en vez de eso tienes que poner como tal el elemento jugador dependiendo de lo que estés usando.

    Una función que si te devuelve el jugador de acuerdo al nombre es la siguiente: "getPlayerFromName". 
     

    • Thanks 1
  17. On 14/4/2018 at 17:22, DostMaster said:

    No entiendo sobre esa función como se utiliza, de hecho como lo adapto al elementData?

    Quiero hacer un sistema de niveles + experiencia.

    Esos funciones se utilizan para retornar un valor mayor o menor de acuerdo a tus argumentos, es decir, si sumas/restas x cantidad a la experiencia actual, sumara x cantidad hasta que llegues al valor máximo/mínimo , tal  como se muestra en el ejemplo que puso @aka Blue. Lo puedes adaptar fácilmente interactuando con los valores, por ejemplo en el caso de el ejemplo anteriormente mencionado la variable "Exp", podría ser cualquier elementData de tu uso.

  18. 
      for k, players in ipairs( getElementsByType("player")) do
        accountname = getAccountName (getPlayerAccount(players))
          if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then
    	   setElementData(players, "TuElementData", "TuKey")
    	  end
    end

    Creo que esto se acomoda a lo que quieres.

  19. 10 hours ago, DostMaster said:

    Hola, quisiera saber como puedo hacer que cuando un jugador recibe un elementData osea sumándole 2 como si fuera una experiencia al llegar al cierta experiencia suba de nivel (Eso ya esta hecho).

    Las tablas esta perfectamente, todo esta bien lo que pasa es que cuando llega a tal experiencia cuando le sumo +2 no sube de nivel osea no le da la otra data que debería de dar.

    Ejemplo: Juanito tiene 499 de Experiencia, para subir de nivel tiene que llegar a los 500 que le daría la otra data que hice, pero como le ando sumando +2 en total tendría 501 pero no le suma el nivel y si uso el '>=' termina bugeando todo termina sumándose muchas veces al recibir una Experiencia, no se me ocurre como hacer eso, llego a los 501 y en esa experiencia ya debería de subir al Nivel 1 pero no, solamente funciona si le sumo 1 y no 2.

    ¿Alguna manera de hacer que funcione perfectamente por más que le sume 5, 6, 7, etc.?

    ¿Ya intentaste poniendo en tu condicional si su experiencia es mayor a 499 ( < 499 )?, ahí no tomaría el 499 pero si de 500 en adelante. Aunque creo que tu problema no es ese, porque podrías solucionar lo que dices que no te siga sumando haciendo otra restricción donde detectes que ya es ese nivel y no te lo vuelva a dar si sigue sumando experiencia.

×
×
  • Create New...