.:HyPeX:. Posted October 1, 2015 Share Posted October 1, 2015 (edited) Well hello, i'm sending a 75 object table to the client wich are all resource elements. However, when the table reaches the client is empty, tried using the resource names instead and it worked. So i'm assuming the reason is resource elements cant be sent via triggerElements, but it is said in the wiki "Any lua data type except functions", so i dont know why it isnt working? Server: addCommandHandler('maps',function() local MapList = exports.mapmanager:getMapsCompatibleWithGamemode ( getResourceFromName('race') ) outputChatBox(#MapList) triggerClientEvent(root,'maps', resourceRoot,MapList) end) Client: addEvent('maps',true) addEventHandler('maps',root,function(maps) outputChatBox(#maps) end) Output: 75 0 Greetz HyPeX Edited October 1, 2015 by Guest Link to comment
TAPL Posted October 1, 2015 Share Posted October 1, 2015 You have sent 'list' but your variable is 'MapList'. Link to comment
Cadu12 Posted October 1, 2015 Share Posted October 1, 2015 triggerClientEvent(root,'maps', resourceRoot,MapList) Link to comment
.:HyPeX:. Posted October 1, 2015 Author Share Posted October 1, 2015 You have sent 'list' but your variable is 'MapList'. My bad, i actually have fixed it in my script, i just was testing another thing in the meanwhile and forgot to set the variable back here addCommandHandler('maps',function() local MapList = exports.mapmanager:getMapsCompatibleWithGamemode ( getResourceFromName('race') ) local list = {} for i=1, #MapList do table.insert(list, getResourceName(MapList)) end triggerClientEvent(root,'maps', resourceRoot,list) end) EDITED OP, still looking on the issue why i cant send the direct resource pointer.. Link to comment
Tomas Posted October 1, 2015 Share Posted October 1, 2015 Try to send it as a string using JSON. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now