View Single Post
  #2  
Old 03-12-2010, 06:47 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.filepath0);
  
// 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);

__________________
Quote:
Reply With Quote