| Blockland Forums > Modification Help |
| Saving And Loading Vars |
| << < (2/8) > >> |
| MegaScientifical:
--- Quote from: -Jetz- on December 07, 2011, 01:43:41 PM ---You sure it didn't just go into a folder of the same name, in the same directory as the zip? --- End quote --- ... Weird, there's a folder of my zip... For forgets sake, if that's really what happened, I'm going to be pissed. I directly transferred my entire Blockland folder to the new computer, so I never got to test but... Wow, I had asked lots of people when it originally happened, and you're the first to say that. Seems to make sense, too, because there' a vars.cs is here... Holy forget. |
| jes00:
Soooo yea, syntax error: $Skill::Client[%client.bl_id]::Gold = %client.Gold; |
| Superb:
--- Quote from: jes00 on December 07, 2011, 02:50:30 PM ---Soooo yea, syntax error: $Skill::Client[%client.bl_id]::Gold = %client.Gold; --- End quote --- You can do $something[%client.bl_id,"gold"] = %client.gold; To retrieve the data: %client = someclientobj; %clientGold = $something[%client.bl_id,"gold"]; I don't understand why we are using global variables though.. |
| jes00:
Not workin D: --- Code: ---function serverCmdSaveMe(%client) { $Skill::Client::Gold[%client.bl_id] = %client.Gold; export("$Skill::" @ %client.bl_id @ "*", "config/server/Skill/" @ %client.name @ "'s vars", False); echo("Saved!"); } function serverCmdLoadMe(%client) { exec("config/server/Skill/" @ %client.name @ "'s vars"); echo("Loaded!"); } --- End code --- |
| MegaScientifical:
I don't get where you got the idea to mess with the export command like that. You're telling it to look for "$Skill::18831*" which you never make, and then trying to make individual files for each person, which would be console spam to reload them all one by one. You also removed the filetype, and gave it ' marks and crap which could forget with some code. You shouldn't load individuals if you expect a lot of people: --- Code: ---function serverCmdSaveMe(%client) { $Skill::Client::Gold[%client.bl_id] = %client.Gold; export("$Skill::Client::*", "config/server/Skill/ClientPrefs.cs", False); echo("\c2Skill Client Saved."); } function serverCmdLoadMe(%client) { exec("config/server/Skill/ClientPrefs.cs"); %client.Gold = $Skill::Client::Gold[%client.bl_id]; echo("Skill Client Loaded."); } --- End code --- It's set up a bit wonky since I don't have the full thing you're trying to do, but I trust you understand after this and can adapt it properly. Apologies all around. |
| Navigation |
| Message Index |
| Next page |
| Previous page |