View Single Post
  #1  
Old 03-13-2007, 07:24 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Outift Save - Opinions?

This isn't really a general question looking for help or such but rather what you think so far as I have been learning to script.

The general idea of this script is to be able to save your current outfit with a specified name using the command, "/save oufit "name"" as well as load it later using the command, "/load outfit "name"". It's not finished but tell me what you think.

PHP Code:

public function test() {

}

function 
onCreated () {

  
client.head "";
  
client.body "";
  
client.shield "";
  
client.sword "";

}

function 
onPlayerChats () {

if (
player.chat.starts("/save outfit")) {
  
player.chat.tokenize();
  
this.outfitname tokens[2];
  
client.head.add(player.head);
  
client.body.add(player.body);
  
client.shield.add(player.shield);
  
client.sword.add(player.sword) ;
  }

if (
player.chat.starts("/load outfit")) {
  
player.chat.tokenize();
    for(
i=0;i<client.size();i++) {
    
player.head[i] = client.head[i];
    
player.body[i] = client.body[i];
    
player.shield[i] = client.shield[i];
    
player.sword[i] = client.sword[i];
    }
  }


P.S. I'm considering creating functions for each part. But Hell Raven has taught me it's best to make independent functions. Tho, I have not done so here.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote