Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   EP Sys (https://forums.graalonline.com/forums/showthread.php?t=68914)

Angel_Light 09-24-2006 05:38 AM

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.

xAndrewx 09-24-2006 07:38 PM

Maybe do your calculations serverside? just convert the player's chat serverside, would be alot more secure. :]

Angel_Light 09-25-2006 02:38 AM

Quote:

Originally Posted by xAndrewx (Post 1221610)
Maybe do your calculations serverside? just convert the player's chat serverside, would be alot more secure. :]

True. :]


All times are GMT +2. The time now is 03:30 AM.

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