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 04-13-2011, 02:25 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Talking Staff Stealth (Complete)

Hi, this is my first official, working script I made myself that is posted to the forums. =D

(in the stealth script help thread, I found my own way =D)

Add this weapon to all players, add a staff tag to, this.canuse for the guild be able to use it, and add a guild to the this.admins for them to be able to see the stealthed admins. Enjoy. This works on all servers, just simply install it, no ganis', no nothin'. All credit goes to me by the way.

PHP Code:
//Script Made By Toad (Astram)
function onActionServerSide()
  {
  if (
params[0] == "stealth")
    {
    for (
players)
      {
      
temp.alpha params[1];
      
temp.acct params[2];
      
temp.staffalpha params[3];
      
this.admins = {"Owner","PR Admin","NAT","GANI"}; 
       if (!(
p.guild in this.admins))
         {
         
p.triggerclient("gui",this.name,"stealth",temp.acct,temp.alpha);
         }
       else
         {
         
p.triggerclient("gui",this.name,"stealthadmin",temp.acct,temp.staffalpha);
         }
         }
         }
   if (
params[0] == "stealthcheck")
     {
     for (
pl players)
       {
       if (
pl.clientr.stealth == 1)
         {
         
pl.triggerlient("gui",this.name,"check",0,pl,0.5);
         }
         }
         }
         }
//#CLIENTSIDE
function onKeyPressed(codekeyscancode)
  {
  if (
key == "5")
    {
    
this.canuse = {"Owner","LAT","PR Admin","NAT","GANI"}; 
     if (
player.guild in this.canuse)
      {
    if (
this.on == false)
      {
      
this.on true;
      
clientr.on 1;
      
triggerserver("gui",this.name,"stealth",0,player.account,0.5);
      
client.message.add("Stealth Mode On");
      
clientr.stealth 1;
      }
    else
      {
      
clientr.on 0;
      
this.on false;
      
triggerserver("gui",this.name,"stealth",1,player.account,1);
      
client.message.add("Stealth Mode Off");
      
clientr.stealth 0;
      }
    }
  }
  }
function 
onActionClientSide()
  {
  if (
params[0] == "stealth")
    {
    
findplayer(params[1]).alpha params[2];
    }
  if (
params[0] == "stealthadmin")
    {
    
findplayer(params[1]).alpha params[2];
    }
  if (
params[0] == "check")
    {
    
this.admins = {"Owner","PR Admin","NAT","GANI"};
    if (!(
player.guild in this.admins))
    {
    
findplayer(params[2]).alpha params[1];
    }
    else
    {
    
findplayer(params[2]).alpha params[3];
    }
  }
  }
function 
onCreated()
  {
  
setTimer(.5);
  }
function 
onTimeOut()
  {
  
setTimer(.5);
  
triggerserver("gui",this.name,"stealthcheck");
  } 
=D

Btw, to use press 5 while your tag is on.
And if this script looks messy, it was me tinkering with it to fix up the glitchs in that area (stealthcheck for example)
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


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 07:47 PM.


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