Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///scr_save(filename,remove_supplied_map,vars1,vars2..);
- //Up to 112 variables with scr_save_array, potentially infinite with a custom map
- //Use scr_save_array to create variable arrays - or just supply with a ds map
- //Returns - nothing
- var map, key = "", saveMap = ds_map_create();
- for (var i=2;i<argument_count;i++)
- {
- map = argument[i];
- key = ds_map_find_first(map);
- saveMap[? key] = map[? key];
- do
- {
- key = ds_map_find_next(map);
- saveMap[? key] = map[? key];
- }
- until key == ds_map_find_last(map)
- if argument[1]
- {
- ds_map_destroy(map);
- }
- }
- ds_map_secure_save(saveMap,argument0);
- ds_map_destroy(saveMap);
- ///scr_save_array(key1,val1,key2,val2..);
- //Used if the user cannot use a custom ds_map for whatever reason
- //Returns - ds map
- var suppMap = sd_map_create();
- for (var i=0;i<argument_count/2;i++)
- {
- suppMap[? (argument[i*2])] = argument[(i*2) + 1];
- }
- return suppMap;
- ///scr_load(filename);
- //Loads the ds map crated in scr_save()
- //Returns - ds_map or -1
- if !file_exists(argument0)
- {
- return -1;
- }
- return ds_map_secure_load(argument0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement