Jump to content

Edikosh998

Members
  • Posts

    569
  • Joined

  • Last visited

Posts posted by Edikosh998

  1. Source va con minusculas y lo otro te recomendaria (aunque daria igual, CREO) :

    addEventHandler("onClientGuiClick",Login,function () triggerServerEvent("Logacc",getLocalPlayer(),txtUser,txtPass) end) 
    

  2. Igual no entendiste bien la idea de trigger, te digo los errores, para que lo entiendas. El trigger pide el nombre del evento (perfecto), el source (ahi pusiste localPlayer, muy bien) y los argumentos opcionales (AHI TIENE QUE SER USERNAME y password). El username y password los sacas con guiGetText. Luego en el server el source no lo tenes que poner como parametro de la funcion, solo el username y password.

    Si no entendiste algo, decimelo

  3. Necesitas hacer un trigger, la funcion "Logacc" , debe ir en el lado del servidor.

    Usa el evento onClientGUIClick para triggear.

    Igual miralo bien en la wiki lo del trigger y preguntame alguna duda al respecto. Pero no me pidas hecho la cosa, sino no sirve.

  4. Ok pero primero decime que es una funcion, que puede llegar a devolver. Y por otro lado, que son los argumentos.

    Si sabes eso, te doy un ejemplo de elementData.

    Porque , que facil es que te de un ejemplo para que luego lo copies y cambies una letrita.

  5. Aaaaaa...Porque intentas hacer esas cosas?

    Aunque el script vaya o no server-side, el tema es que, estas tratando de que Castillo te lo arregle (tirando al azar funciones).

    Lee que es una funcion, que devuelve. Que es un argumento, que tipos de argumentos hay. Lee que es una variable, y sus tipos.

    Lee sobre las condiciones. No entiendo la desesperacion de querer hacer algo tan avanzado. Hay que ir por pasos...

    Si vos pensas que esto solo te va a servir en el MTA, estas en otra. Porque hay miles de usos en la programacion, y por eso se pide mucho por eso.

    Igual, pienso que esto no lo leen y que seguramente vas a seguir preguntando lo mismo, creando otros topics, debes de capaz encontrarle la vuelta a cada problema. ;)

  6. Sabes que carlos, tenes razon. Soy un boludo

      
    if x and  triggerServerEvent ("checker", v) == true then 
      
      
    

    Pero no pensamo que hay un evento llamado "onPlayerMute" y "onPlayerUnmute", mucho mas facil, no?

      
      
    function onPlayerMut() 
      
    triggerClientEvent(source,"onMute",source) 
    end 
    addEventHandler("onPlayerMute",root,onPlayerMut) 
      
    function onPlayerUnMut() 
      
    triggerClientEvent(source,"unMute",source) 
    end 
    addEventHandler("onPlayerUnmute",root,onPlayerUnMut) 
      
      
    

    Client

      
      
    function onMuted() 
      
    addEventHandler("onClientRender",root,showing) 
      
    end 
    addEvent("onMuted",true) 
    addEventHandler("onMuted",root,onMuted) 
      
    function unMuted() 
      
    removeEventHandler("onClientRender",root,showing) 
      
    end 
    addEvent("unMuted",true) 
    addEventHandler("unMuted",root,unMuted) 
      
    function showing( ) 
        local px, py, pz, tx, ty, tz, dist 
        px, py, pz = getCameraMatrix( ) 
        for _, v in ipairs( getElementsByType 'player' ) do 
            tx, ty, tz = getElementPosition( v ) 
            dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) 
            if dist < 30.0 then 
                if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then 
                   local sx, sy, sz = getPedBonePosition( v, 1 ) 
                   local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) 
                   if x and  triggerServerEvent ("checker", v) == true then 
                    dxDrawText( "Muted ", x, y, x, y, tocolor(150, 0, 0), 0.85 + ( 15 - dist ) * 0.02, "pricedown", "center" ) 
                   end 
                end 
            end 
        end 
    end 
      
    

  7. 1) DE DONDE sacas el evento "chequear"? No hay trigger ni nada.

    2) La variable Obtener devuelve "true/false" no devuelve "player"

    3) El evento nombre, vos lo pusiste, creyendo QUE IBA A DEVOLVER EL nombre. Si ves la wiki, los trigger devuelven bool, osea sirven para ejecutar algo tanto en client/server.

    Espero que te sirva.

  8. Carlos, no tiene sentido ese script

    Mira tendria que ser asi :

      
      
    function mutecheck () 
    for i,v in ipairs(getElementsByType("player")) do 
    if isPlayerMuted ( v ) then 
        triggerClientEvent(v,"onMuted",v) 
    end 
    end 
    end -- Faltaba un end ademas... 
      
    setTimer(muteCheck,5000,0) -- Si lo pones 1 , lo chequea solo una vez. Tenes que poner en 0 
      
      
    

    Client Side

      
      
    function onMuted() 
      
    addEventHandler("onClientRender",root,showing) 
      
    end 
    addEvent("onMuted",true) 
    addEventHandler("onMuted",root,onMuted) 
      
      
    function showing( ) 
        local px, py, pz, tx, ty, tz, dist 
        px, py, pz = getCameraMatrix( ) 
        for _, v in ipairs( getElementsByType 'player' ) do 
            tx, ty, tz = getElementPosition( v ) 
            dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) 
            if dist < 30.0 then 
                if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then 
                   local sx, sy, sz = getPedBonePosition( v, 1 ) 
                   local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) 
                   if x and  triggerServerEvent ("checker", v) == true then 
                    dxDrawText( "Muted ", x, y, x, y, tocolor(150, 0, 0), 0.85 + ( 15 - dist ) * 0.02, "pricedown", "center" ) 
                   end 
                end 
            end 
        end 
    end 
      
    

    Ah y el client, tampoco se entiende, pero esperame que me fijo porque no entendi bien.

    EDIT 1 : Usas clientRender y timer a la vez? :shock::shock:

    EDIT 2 : YA ENTENDI LO QUE BUSCAS mira lo que tenes que hacer...

  9. I know this sounds a little weird, but are you able to add some kind of data on the message to mark it as a longer message, and if it's a longer message, the next message will be sent one line lower? I know, it sounds pretty lame and unofficial fix but yeah.

    I was going to say the same. Like using a "string.len" function.

    PD : Castillo asking something on the scripting forum :o:o

  10. Le falta el evento xD

    Es verdad :):), gracias Alex

    mauroo , de nada. Hacemo lo que podemos, no tenemos la capacidad de debuggear un error de un script de 100 lineas, si saber de que se trata. Capaz haya alguno que si, pero no te va a querer ayudar si vos no mostras un poco de esfuerzo a aprender a programar. A ver, entiendan que programar es un trabajo, y vos podes ganar mucha plata con eso. Pero para llegar a eso, se requiere estudio y aprendizaje como cualquier otra materia. Entonces no creas que alguien te de servido las cosas, sino que tendras que estudiar y averiguar. Aca te van a ayudar, solo si sos concreto con lo que preguntas y demostras que entendes el problema y la respuesta. De nada sirve un script hecho por otro, sin entender una letra y pegando lo que puso PARA LUEGO PREGUNTAR por otro error como esos.

  11.   
      
      
    function contestarPregunta() 
      
    local respuesta 
    local user = getForumUser(source) 
      
      
    if getGanasDeAprenderDelTipo(source) < 20 then 
    respuesta = "No se contesta" 
    elseif getGanasDeAprenderDelTipo(source) > 50 then 
    respuesta = "Ahi si" 
    end 
    return respuesta 
    end 
      
    

    Cual sera el problema ahi?

  12. No estoy muy seguro de lo de exportar, pero si la forma era "exports.slothboth:isPedBot" (Que deberia estar bien, es parecido a objetos, el slothbot seria la clase y el isPedBot una sub clase).

    if exports.slotboth:isPedBot( attacker ) == false then 
    cancelEvent() -- Si no es el bot del slothbot cancelar 
      
    end 
    end 
      
    

    Si no anda, es porque capaz esta mal escrito o la funcion no devuelve boolean, pero la idea esta bien.

  13. No se puede cancelar ese evento, tenes que cancelar el onClientPlayerDamage.
    function casigod ( attacker, weapon, bodypart, loss ) 
        if ( attacker ) and ( getElementType ( attacker ) == "player" ) or ( getElementType ( attacker ) == "vehicle" ) then 
           cancelEvent ( ) 
       end 
    end 
    addEventHandler ( "onClientPlayerDamage", localPlayer, casigod ) 
    

    SABEEE, la verdad que me habia olvidado. Sory

  14. Alex :o , eso es un concepto matematico

    Siempre la flecha que señale al otro item, determina que ese item que señala es menor al que esta detras suyo. Por ende, el ">" determina que el primer item es mayor que el segundo.

  15. Eso parece que esta copiado de algun lado...porque targetElem no esta ni definido

      
      
    function casigod ( attacker, weapon, bodypart, loss ) 
        if getElementType ( attacker ) == "player" or getElementType ( attacker ) == "vehicle" then 
           cancelEvent() 
       end 
    end 
    addEventHandler ( "onPlayerDamage", getRootElement (), casigod ) 
      
      
    

  16. It's better to use the new database functions:
    dbConnect 
    dbQuery 
    dbExec 
    dbPoll 
    dbFree 
    

    Yeah, MySQL is much better. You can use XAMPP for it (localhost). But be careful, because you must use "dbPoll" to get a table data. Then, if you want to INSERT, DELETE or UPDATE something, you can use "dbExec"

  17. Tenes que ponerlo en todo, porque sino se te va a ver sobredimensionados los botones de adentro si no me equivoco. Igual proba, primero pone el window en relative true...y testea usando 2 resoluciones.

×
×
  • Create New...