Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.