Jump to content

Problema con eventos


Mimimiguel

Recommended Posts

Posted

Hola a todos! Bueno, tengo un problema con OnPlayerClick, de hecho, no me funciona, también he intentado con OnElementClicked pero tampoco me va, bueno, la idea es que llegue un evento al cliente que abrirá una interfaz, pero no me funciona:

 carl = createPed( 0, 224.99, 1289.12, 1082.24, 180 ) 
    setElementInterior( carl, 1 ) 
    setElementDimension( carl, 122 ) 
  
addEventHandler( "OnPlayerClick", getRootElement(), function ( button, state, player ) 
        if player == carl then 
            outputChatBox( "Carl dice: ¿Qué necesitas?", source, 255, 255, 255 ) 
            triggerClientEvent( "useCarl", source) 
        end 
    end 
) 

Ese es el script, yo no entiendo por qué no quiere funcionar. Tampoco da errores en debugscript 3. El script lo ejecuta el servidor (serverside).

Un saludo, suerte y gracias.

Posted

Lua es entre mayúsculas y minúsculas.

carl = createPed( 0, 224.99, 1289.12, 1082.24, 180 ) 
setElementInterior( carl, 1 ) 
setElementDimension( carl, 122 ) 
  
addEventHandler( "onPlayerClick", getRootElement(), -- Es 'onPlayerClick, no 'OnPlayerClick'. 
    function ( button, state, player ) 
        if ( player and player == carl ) then 
            outputChatBox( "Carl dice: ¿Qué necesitas?", source, 255, 255, 255 ) 
            triggerClientEvent( "useCarl", source) 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

De nada.

P.D: A todos nos pasan cosas asi ;).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...