Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-24-2006, 05:38 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
EP Sys

PHP Code:
//By: Gambet
//Modified by Omega
function onActionServerSide() {
  if ( 
params[0] == "addec" )
  {
    if ( 
params[2] != params[3] )
    {
      
with findplayerparams[2] ) ) {
        
clientr.ec+=params[1];
        
player.chat "You have received " params[1] @ " EC from " params[3] @"!";
      }
      
player.chat "You have just sent " params[1] @ " EC to " params[2] @"!";
    }
    else
    {
      
player.chat "You cannot give yourself EC!";
    }
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.guild == "Events Team" || player.guild == "Events Admin")
  {
    if (
player.chat.starts("-addec") )
    {
      
tokens player.chat.tokenize();
      
this.addvalue abstokens[1] );
      
this.adder player.account;
      
this.addto tokens[2];
      if ( 
this.addvalue in |1,15| )
      {
        if ( 
this.addto != NULL )
        {
          
triggeraction00"serverside"name"addec"this.addvaluethis.addtothis.adder );
        }
        else
        {
          
player.chat "Invalid Syntax: /add <number_of_ec> <acc>";
        }
      }
      else
      {
        
player.chat "Amount exceeds allowed range!";
      }
    }
  }

Just load this in a weapon and give it to all players. :]
A friend gave this to me awhile ago. I figured I should share. I hope you enjoy it as much as I do.
__________________
Deep into the Darkness peering...
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 09:33 AM.


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