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 04-09-2011, 04:38 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
Stealth Script Help

PHP Code:
//Please dont steal this script from the forums, forum viewers.
function onActionServerSide()
  {
  if (
params[0] == "stealth")
    {
    for (
players)
      {
      
this.admins = {"Owner","Events Team","LAT"};
      if (!(
p.guild in this.admins))
      {
      
p.triggerclient("gui",this.name,"stealth",params[2],params[1]);
      }
      else
      {
      
temp.p2 params[2];
      if (
findplayer(temp.p2).clientr.on 1)
      {
      
p.triggerclient("gui",this.name,"stealth",params[2],0.75);
      }
      else
      {
      
p.triggerclient("gui",this.name,"stealth",params[2],1);
      }
      }
    }
    }
  }
//#CLIENTSIDE
function onKeyPressed(codekeyscancode)
  {
  if (
key == "5")
    {
    
this.canuse = {"Owner","LAT"}; 
     if (
player.guild in this.canuse)
      {
    if (
this.on == false)
      {
      
this.on true;
      
triggerserver("gui",this.name,"stealth",0,player.account);
      
sleep(0.5);
      
player.alpha 0.75;
      
client.message.add("Stealth Mode On");
      }
    else
      {
      
this.on false;
      
triggerserver("gui",this.name,"stealth",1,player.account);
      
sleep(0.5);
      
player.alpha 1;
      
client.message.add("Stealth Mode Off");
      }
    }
  }
  }
function 
onActionClientSide()
  {
  if (
params[0] == "stealth")
    {
    
findplayer(params[1]).alpha params[2];
    }
  } 
This has been added to all players...
The problem is that the other admins who are defined in this.admins, only see us other stealthed admins with alpha 1, not alpha 0.75 which is a problem because you don't know if their in stealth, though other players can not see the player that is in stealth.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #2  
Old 04-09-2011, 05:44 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
try this, just a quick thought script, haven't tested.
PHP Code:
function onCreated()
{

  
this.admins = { "Owner""Events Team""LAT"};

}

function 
onActionServerside()
{

  if ( 
params0] == "stealth")
  {

    
player.clientr.stealthMode = !player.clientr.stealthMode;

    for ( 
temp.allplayers)
      
temp.p.triggerclient"gui"this.name"stealth"player.index,  player.clientr.stealthMode, ( temp.p.guild in this.admins));

  }
}

//#CLIENTSIDE

function onCreated()
{

  
this.canUse = { "Owner" ,"LAT"}; 

}

function 
onKeyPressedtemp.codetemp.keytemp.scancode)
{

  if ( 
temp.key == "5" && player.guild in this.canUse)
    
triggerserver"gui"this.name"stealth");

}

function 
onActionClientside()
{
  
  if ( 
params0] == "stealth")
    
playersparams1]].alpha float( !params3]? params2]: (  params2]? 0.751));


__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #3  
Old 04-09-2011, 05:56 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
This is a job better done by using ganis.

You can simply making a copy of walk, and idle. I.e: server_stealth-idle, server_stealth-walk.

Have this placed at the bottom of the ganis:

PHP Code:
SCRIPT
function onPlayerEnters() {
  if (
clientr.staff) {  // You will need to alter Control-NPC/Login
    
player.alpha 0.5// Scripts to set a flag if they're staff.
  
} else {
    
player.alpha 0;
  }
}
SCRIPTEND 
then you can simply keep the weapon to your own. I.e:

-Staff/Stealth
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.stealthed false;


function 
ChatBar.onAction() {
  if (
ChatBar.text == "/stealth") {
    
setStealth();
    
ChatBar.text "";
  }
}

function 
setStealth() {
  
this.stealthed = !this.stealthed;
  if (
this.stealthed) {
    
replaceani("idle""stealth-idle");
    
replaceani("walk""stealth-walk");
  } else {
    
replaceani("idle""idle");
    
replaceani("walk""walk");
  }

__________________
Quote:
Reply With Quote
  #4  
Old 04-09-2011, 06:22 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
that didnt help xP
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #5  
Old 04-09-2011, 06:34 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
clarify
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #6  
Old 04-09-2011, 06:37 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well we're not going to spoon feed you complete solutions, what part are you struggling with?
__________________
Quote:
Reply With Quote
  #7  
Old 04-09-2011, 07:01 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
Well Mr.Omega's script had the same problem as mine, and with ganis' nicknames would show
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #8  
Old 04-09-2011, 07:19 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Astram View Post
Well Mr.Omega's script had the same problem as mine, and with ganis' nicknames would show
Considering that both scripts effectively do the same thing (change the player's alpha) I would say that if the gani way shows nicknames than your way would too.
__________________
Quote:
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 01:59 PM.


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