Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 09-24-2006, 07:38 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Maybe do your calculations serverside? just convert the player's chat serverside, would be alot more secure. :]
__________________
Reply With Quote
  #3  
Old 09-25-2006, 02: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
Quote:
Originally Posted by xAndrewx View Post
Maybe do your calculations serverside? just convert the player's chat serverside, would be alot more secure. :]
True. :]
__________________
Deep into the Darkness peering...
Reply With Quote
Reply


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 11:17 PM.


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