Jump to content

Tabla serverside


Krujitoz

Recommended Posts

[sOLUCIONADO]

Buenas :| , mi pregunta es porque no funciona el script automáticamente al iniciar el scipt:

-- Client

function testc ( test ) 
    for t = 1, #test do 
        outputChatBox ( "[sERVER]: " .. test[t].n ) 
    end 
end 
  
addEvent( "testc", true ) 
addEventHandler( "testc", getRootElement(), testc ) 
  
addEventHandler ( "onClientResourceStart", getRootElement(), 
function () 
    triggerServerEvent ( "tests", getRootElement() ) 
end ) 

-- Server

function tests () 
    triggerClientEvent ( "testc", getRootElement(), {  
    [1]={ n = 1 }, 
    [2]={ n = 2 }, 
    [3]={ n = 3 }, 
    [4]={ n = 4 }  
    } ) 
end 
addEvent( "tests", true ) 
addEventHandler( "tests", getRootElement(), tests ) 

Al iniciar el scipt con el "onResourceStart" obtengo los siguientes errores del /debugscript 3

[2013-04-01 22:17:23] ERROR: Server triggered clientside event test, but event is not added clientside 
[2013-04-01 22:17:23] ERROR: test\client.lua:2: attempt to get length of local 'table' (a userdata value) 

Sin embargo si utilizo el comando /tests muestra el resultado deseado (?

[sERVER]: 1 
[sERVER]: 2 
[sERVER]: 3 
[sERVER]: 4 

En que estoy mal ?

[sOLUCIONADO]

Edited by Guest
Link to comment
  • Recently Browsing   0 members

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