Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Sasu

    String Value

    Elimina el segundo argumento 'veh' de la funcion(linea 5) puesto que no te sirve, y remplaza 'veh' por 'veh[counterddd2]' en la linea 15.
  2. No entendieron mi codigo anterior pero bueno lo dejo como antes, intenta esto: local sx, sy = guiGetScreenSize() local screenX = 1024 local screenY = 768 local scX, scY = ( 1 / screenX ), ( 1 / screenY ) function _dxDrawRectangle(posX, posY, ancho, largo, ...) local x, y, w, h = sx * ( posX * scX ), sy * ( posY * scY), sx * ( ancho * scX ), sy * ( largo * scY) dxDrawRectangle(x, y, w, h, ...) end function mostrarsed () local sed = getElementData(localPlayer,"sed") or 100 local anchototal = 120 local anchototal2 = (sed*anchototal)/100 _dxDrawRectangle( 842 , 185, 138, 86, tocolor(0, 0, 0, 90), false) _dxDrawRectangle( 848, 198, 124, 14, tocolor(0, 0, 0, 255), false) _dxDrawRectangle( 850, 200, anchototal, 10, tocolor(0, 0, 0, 90), false) _dxDrawRectangle( 850, 200, anchototal2, 10, tocolor(0, 255, 0, 200), false) _dxDrawText("Sed", sx * ( 890 * scX ), sy * ( 184 * scY), sx * ( 845 * scX ), sy * ( 213* scY), tocolor(255, 255, 255, 255), 0.40, "bankgothic", "left", "top", false, false, false, false, false) end function abrirsed() addEventHandler ( "onClientRender", getRootElement(), mostrarsed ) end addEvent( "onSed", true ) addEventHandler( "onSed", getRootElement(), abrirsed )
  3. Los dxDrawRectangle dejalos como yo te los pase o modifica el nombre de la funcion de la linea 7
  4. De hecho, hice que el dxDrawRectangle pase a llamarse _dxDrawRectangle asi pudiera crear una funcion con el nombre del dxDrawRectangle pero que este se diferencie en que los valores absolutos de los primeros cuatro argumentos los convierta en valores relativos. Despues lo demás no cambie nada, asi que no me lo agredezcas a mí, tan solo ordené un poco el script.
  5. local sx, sy = guiGetScreenSize() local screenX = 1024 local screenY = 768 local scX, scY = ( 1 / screenX ), ( 1 / screenY ) local _dxDrawRectangle = dxDrawRectangle function dxDrawRectangle(posX, posY, ancho, largo, ...) local x, y, w, h = sx * ( posX * scX ), sy * ( posY * scY), sx * ( ancho * scX ), sy * ( largo * scY) _dxDrawRectangle(x, y, w, h, ...) end function mostrarsed () local sed = getElementData(localPlayer,"sed") or 100 local anchototal = 120 local anchototal2 = (sed*anchototal)/100 dxDrawRectangle( 842 , 185, 138, 86, tocolor(0, 0, 0, 90), false) dxDrawRectangle( 848, 198, 124, 14, tocolor(0, 0, 0, 255), false) dxDrawRectangle( 850, 200, anchototal, 10, tocolor(0, 0, 0, 90), false) dxDrawRectangle( 850, 200, anchototal2, 10, tocolor(0, 255, 0, 200), false) dxDrawText("Sed", sx * ( 890 * scX ), sy * ( 184 * scY), sx * ( 845 * scX ), sy * ( 213* scY), tocolor(255, 255, 255, 255), 0.40, "bankgothic", "left", "top", false, false, false, false, false) end function abrirsed() addEventHandler ( "onClientRender", getRootElement(), mostrarsed ) end addEvent( "onSed", true ) addEventHandler( "onSed", getRootElement(), abrirsed )
  6. Dijo que no le devolvia el pais de la IP española. @Dannys, fetchRemote funciona con web's remotas(no son propio del mismo host) solo en server-side, tendras que usar triggerClientEvent
  7. Fijate desde la pagina si no te la reconoce http://ip-api.com/json . Y sino puedes buscar tu alguna que la reconozca. EDIT: Aqui tienes otro para probar http://www.telize.com/geoip | https://ip.nf/me.json
  8. Sasu

    Ayuda

    Lo que tu has puesto es para abrir un archivo HTML dentro de la carpeta del resource. Si tu tienes una web, pon la direccion normal.
  9. fetchRemote("http://ip-api.com/json/"..getPlayerIP(player), returnData, "", false, player) function returnData(data, err, player) if err == 0 then local json = fromJSON(data) outputChatBox(getPlayerName(player).." proviene de "..json.country, root) end end No lo he probado, estoy desde el telefono.
  10. 1- 'onClientResourceStart' es client y por lo que veo ese script es de carácter server. 2- Podrias poner el setTimer con un intervalo de un minuto.
  11. Reply this topic with your resource's link: viewtopic.php?f=108&t=45807&start=1245
  12. https://community.multitheftauto.com/index.php?p= ... ls&id=6639 https://community.multitheftauto.com/index.php?p= ... ls&id=7157 https://community.multitheftauto.com/index.php?p= ... ls&id=7286 DONE
  13. Bubble chat Well, as the tittle says, is a bubble chat resource. Screenshots: Resource's download: https://community.multitheftauto.com/index.php?p= ... s&id=12008 SUGGESTIONS ARE ACCEPTED! CHANGELOG
  14. No pusiste en todos las posiciones de los rectangulos(botones)
  15. He visto que pones las posiciones del dxDrawText, y estas tienen un diferente sistema de tamaño a las del dxDrawRectangle. ¿Por qué no intentas poner las posiciones del dxDrawRectangle (botón)? Si me equivoco, te pido disculpas.
  16. Mod downloader (beta) Hi there! I've just made a mod downloader. With this resource, you can download mods that you want using a GUI(open with /mods). Make sure you add files in the meta.xml and in mods.lua, where you have an example. Having some doubt? Ask me here. Screenshots: WARNING: This resource is a beta version, so it may fail. If you find any bug, reply this thread. Resource's download: https://community.multitheftauto.com/index.php?p= ... s&id=12000
  17. getCursorPosition ya devuelve los valores de manera relativa. function isCursorOnElement(x,y,w,h) local cursorx, cursory = getCursorPosition () if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end
×
×
  • Create New...