Erm, I know you're excited about your first script but it's just not Code Gallery material.
- It's explicit to your scenario
- Improper Indentation / Random white-spacing
- Only uses events (for this kind of script the purpose is to provide reusable functions)
- There's no comments
Also, player.chat = ":load" should be player.chat == ":load"
TStaticVar + loadvars/savevars Example:
PHP Code:
function onCreated() {
// Define Path to File
temp.filepath = "levels/path/to/randomfile.txt";
// Create TStaticVar
temp.file = new TStaticVar();
// Assign Value to File StaticVar
temp.file.testvariable = "Hello World!";
// Save Values to File
temp.file.savevars(temp.filepath, 0);
// Destroy and Re-create File Object (Example Purposes)
temp.file = "";
temp.file = new TStaticVar();
// Load File
temp.file.loadvars(temp.filepath);
// Display Variable
echo(temp.file.testvariable);
}