nogisz Posted January 11, 2022 Share Posted January 11, 2022 Hi, I'm trying to access custom attribute from .map file but script outputs "false" as a result. As an example I have "object" node <object id="object (bevgrnd03b_law) (1)" [...] myCustomAttr="bleh"></object> and I'm trying to iterate through all "object" elements and check whether it has "myCustomAttr" by using getElementData(el, "myCustomAttr") but this doesn't work. I saw in other scripts they do this and it just works but in my case it outputs "false". Could anybody help me with this problem? Link to comment
Moderators IIYAMA Posted January 12, 2022 Moderators Share Posted January 12, 2022 On 11/01/2022 at 11:32, nogisz said: I saw in other scripts they do this and it just works but in my case it outputs "false". Could anybody help me with this problem? See this meta.xml tag. Quote <sync_map_element_data /> Controls whether map element data such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource. false: Disable transfer of map element data for all resources. This can reduce map download times considerably. true: Enable transfer of map element data for all resources. (If false and true are set in different resources, true will have priority and all resources will transfer map element data) https://wiki.multitheftauto.com/wiki/Meta.xml Set it to true in the gamemode which you are using: <sync_map_element_data>true</sync_map_element_data> Link to comment
Moderators IIYAMA Posted January 15, 2022 Moderators Share Posted January 15, 2022 @nogisza friendly reminder that your question has been answered. Link to comment
nogisz Posted January 15, 2022 Author Share Posted January 15, 2022 Okay. Thanks for help. You can close this topic. Link to comment
Recommended Posts