Jump to content

Calculador

Members
  • Posts

    197
  • Joined

Everything 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. Podrías crear una col, posteriormente adicionar el comando cuando el jugador ingrese en ella y removerlo cuando salga. Esto hará que solo en una zona definida por ti el jugador pueda utilizar el comando.
  3. function morir(player, cmd) setTimer(killPed, 5000, 1, player, player) end addCommandHandler("kill", morir) Con el siguiente código al ejecutar el comando "kill" morirás en cinco segundos. No probé que funcionara, pruebalo y comenta por favor.
  4. Calculador

    Question

    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.
  5. 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.
  6. Calculador

    Question

    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.
  7. 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 ?
  8. @IIYAMA So how could the local server do it and be read by the URL?
  9. @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' />
  10. Calculador

    Question

    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.
  11. Calculador

    Pregunta

    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.
  12. 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.
  13. 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
  14. Excelente descripción, así es los estaremos esperando para la apertura, recuerden que sin ustedes que son los jugadores nada de esto sería posible. Saludos ?
  15. 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.
  16. 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.
  17. 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.
  18. 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.
  19. 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)
  20. Si no estas en la capacidad de hacerlo, busca uno gratis en la comunidad.
  21. 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".
  22. 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.
  23. 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.
  24. ¿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...