megaman54 Posted March 7, 2012 Posted March 7, 2012 I'm currently using the function takePlayerScreenshot and i need to transfer the data to client side for preview but sometimes the string size of the screenshot data is over 65535 characters and that is over the argument length limit in triggerClientEvent. How i could split that argument to pieces and send it and then combine the pieces client side?
drk Posted March 7, 2012 Posted March 7, 2012 Maybe split ? https://wiki.multitheftauto.com/wiki/Split EPT Team Server Development: 0% Learning C++ | C++ is amazing
drk Posted March 7, 2012 Posted March 7, 2012 LOL? I posted the link of split function in Wiki. EPT Team Server Development: 0% Learning C++ | C++ is amazing
SDK Posted March 7, 2012 Posted March 7, 2012 I think you don't need to split it if you use this function: https://wiki.multitheftauto.com/wiki/Tri ... lientEvent Not sure, since I never used it myself before Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
Castillo Posted March 7, 2012 Posted March 7, 2012 But that function isn't available until MTA 1.3.1 onwards. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted March 7, 2012 Posted March 7, 2012 Solution is create table. And check sub string like 1,65535. And send with parts to client. Like this: function fPack ( str ) local t = { } local new = str while #new >= 65535 do t[ #t + 1 ] = string.sub( new, 1, 65535 ) triggerClientEvent( root, 'onSomeEvent', root, t[ #t ] ) new = string.gsub( new, string.sub( new, 1, 65535 ), '' ) end t[ #t + 1 ] = string.sub( new, 1, #new ) triggerClientEvent( root, 'onSomeEvent', root, t[ #t ] ) if #t == 0 then t[1] = new end return t end http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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