View Issue Details

IDProjectCategoryView StatusLast Update
0008848Multi Theft Auto : San AndreasScriptingpublic2017-06-28 22:48
ReporterGallardo9944 Assigned Toqaisjp  
Status resolvedResolutionfixed 
Target Version1.5Fixed in Version1.5 
Summary0008848: [Request] Add toJSON compact mode

Currently toJSON returns a string containing a lot of spaces, e.g.:

{ "posY": -1669.1435546875, "rotZ": 90, "posX": 3500.5869140625, "model": 10937, "posZ": 5.2926301956176758 },

We could add an argument to trim spaces in toJSON so it becomes like this:


Multiplied by a huge amount of such data, useless spaces take a nice amount of memory. Adding compact toJSON may reduce the amount of traffic sent to players by (for example) converting a table to a compact JSON string.

Additional Information

toJSON could look like that:

string toJSON ( var value, [ bool compact = false ] )

TagsNo tags attached.



2015-05-10 13:14

manager   ~~0023275

It'd make much more difference if you rounded those ridiculously long numbers.


2015-05-10 13:54

viewer   ~~0023276

toJSON actually does cause such long numbers:

/run outputChatBox(toJSON({0.0053453}))
[ [ 0.0053452998399734497 ] ]


2015-05-30 01:48

administrator   ~~0023329

Audifire made a pull request

Merge commit:

Individual commits:

Issue History

Date Modified Username Field Change