Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Sasu

    On playSound

    I don't have experience with XML. for _, resource in ipairs ( getResources() ) do if getResourceInfo ( resource,"type" ) == "map" then local resourceName = getResourceName ( resource ) local metaPath = ":"..resourceName.."/meta.xml" local meta = xmlLoadFile ( metaPath ) if meta then local children = xmlNodeGetChildren ( meta ) if children then for _, node in ipairs ( children ) do local nodeName = xmlNodeGetName ( node ) if nodeName == "file" then local song = xmlNodeGetAttribute ( node,"src" ) if string.find( song, ".mp3" ) or string.find ( song, ".wav" ) then xmlNodeSetAttribute ( node, "download", "false" ) end end end end xmlSaveFile ( meta ) xmlUnloadFile ( meta ) end end end Is it correct?
  2. No, it will always returns false because the function callServerFunction doesn't return anything -> nil
  3. Sasu

    Weird problem

    Maybe it is under the ground. What about if you leave "z" instead of "z-1"?
  4. I don't know if it works but you can try: guiSetProperty ( text, "MaxTextLength", "300" )
  5. Another question, are the projectiles synced with the clients? Or I have to trigger server and then client?
  6. Then, show us the part where it renders the names.
  7. Lol, I didn't know that. haha. Thank you very much.
  8. Hi all! I'm trying to do a shooter script but I have a problem with the projectile direction: function ejectProjectile() local localVehicle = getPedOccupiedVehicle(source) local ax, ay, az = getElementPosition(source) local x,y,z = getPositionFromElementOffset(localVehicle,0,5,0) local _, _, rz = getElementRotation(localVehicle) local vx, vy = x - ax, y - ay createProjectile(source, 19, x, y, z, 100, nil, 0, 0, 180 - rz, vx/3, vy/3, 0) -- I take velocity math here: viewtopic.php?p=357503#p357503 end The problem is that the projectile goes right(red arrow) and not straight(blue arrow) where it should go. I'm not good in math so if anybody can help me I will be very grateful . Thank you very much.
  9. Two questions: *- Is there anyway to set an alpha value to the browser with webui? *-What does transparent value(createBrowser) do? Because I can't see the difference. And finally good work with CEF, it is awesome that you integrated it to mta 1.5. I can't wait anymore.
  10. Intenta agregar esto en el script: setOcclusionsEnabled( false )
  11. Works! Thank you very much.
  12. But if I do: string.format("%02d:0%.1f", 0, 21.2) -> 00:021.2 And I want get 00:21.2 Thanks for helping me!
  13. Hello! Can someone help me with my problem? I want to use string.format to get something like this: 00:00.2 but only I could get 00:0.2 with string.format("%02d:%.1f", 0, 0.2) Thanks!
  14. You can make a script in mta that create a image's file and send the image to it via php
  15. Sasu

    XML

    No me preguntes por qué pero se suele solucionar con fileExists junto con la sentencia if antes de xmlLoadFile
  16. Lo agregue mientras estaba probando, no hace falta que armes tanto lío por algo que no afecta en nada. ¿Podrías publicar una foto con el recurso funcionando y el debugscript activo? Le dices a un pregunta tanto lio? No te estaba corrigiendo, solo preguntaba ya que se que tienes mas conocimientos que yo y tuve esa duda. De cualquier manera, no me saldre del tema, veo que lo estas ayudando asi que dejo el thread.
  17. Sasu

    Ayuda

    No es para nada dificil utilizar SQLite (no MySQL, parecido), checa la función executeSQLQuery
  18. Te recomiendo usar smoothMoveCamera
  19. Sasu

    Ayuda

    Mira, si te soy sincero, no se utilizar las funciones XML o tengo muy poco conocimiento pero si te puedo dar una sugerencia es que yo, personalmente, usaria SQL, pienso que es mas efectivo.
  20. Sasu

    Estoy indeciso

    En caso de que sean datos propios del cliente, me parece mas eficiente XML.
  21. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!", root,0,255,0,true) else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")", root,0,255,0,true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted)
  22. if not joinData or joinData.status ~= 'fail' then -- if not joinData ?
  23. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted)
  24. Sasu

    Ayuda

    Puedes hacer otro xml y guardar el ultimo id al detener el recurso y utilizarlo cuando se inicie guardandolo en una variable. Lo del memo deberia reportarse en bugs.mtasa.com.
×
×
  • Create New...