Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-20-2011, 08:32 PM
Arch_Angel Arch_Angel is offline
Registered User
Join Date: Apr 2007
Posts: 482
Arch_Angel is on a distinguished road
Send a message via AIM to Arch_Angel
Help with name disaply

Okay, so I looked at a couple custom name/attribute displays to display what you want under players. Or make your own custom nick design.

But, problem is - When someone else logs in, it all goes haywire. By myself, it looks fine and such. Now I'm new to all this, so it is probably something stupid like "oh hey add this line here, done". So if someone could help me, would be much appreciated! (fowlplay, i know you're out there! )

So right now, I've just made it so it displays staff on tag, and players HP. It still needs the players nicks added to it with another line of showtext(blahblah, player[a].nick);. But, I wish to find out this problem of why its all going weird when another player logs in!

Help would be appreciated

PHP Code:
//#CLIENTSIDE
function onCreated( )
{
  
this.staff_list =
  {
    
"Manager""Admin",
    
"Head Developer""Developer",
    
"GAT""LAT""NAT""GANI",
    
"Staff""Working"
  
};
  
  
onTimeOut( );
}

function 
onTimeOut( )
{
  
player.attr[4] = clientr.hp"/" @clientr.hpmax;
  
  
hideimgs200 );
  for( 
0playerscounta++ )
  {
    if ( 
players[a].guild in this.staff_list )
    {
      
showtext201 aplayers[a].1.5players[a].3.0"Arial Bold""c", @players[a].nick );
      
changeimgcolors201 a111.7 );
      
changeimgvis201 a);
      
changeimgzoom201 a.7 );
    }
    else {
      
//HP01
      
showtext202 aplayers[a]..325player[a].2.9"Arial""b""HP:" SPC players[a].attr[4] );
      
changeimgcolors202000.4 );
      
changeimgzoom2020.6 );
      
changeimgvis202);
      
//HP02
      
showtext203 aplayers[a]..2player[a].2.9"Arial""b""HP:" SPC players[a].attr[4] );
      
changeimgcolors2031.3.3.85 );
      
changeimgzoom2030.6 );
      
changeimgvis203);
    }
  }
  
  
setTimer0.05 );

Reply With Quote
  #2  
Old 07-20-2011, 08:39 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
PHP Code:
    else {
      
//HP01
      
showtext202 aplayers[a]..325player[a].2.9"Arial""b""HP:" SPC players[a].attr[4] );
      
changeimgcolors( [B]202[/B], 000.4 );
      
changeimgzoom( [B]202[/B], 0.6 );
      
changeimgvis( [B]202[/B], );
      
//HP02
      
showtext203 aplayers[a]..2player[a].2.9"Arial""b""HP:" SPC players[a].attr[4] );
      
changeimgcolors( [B]203[/B], 1.3.3.85 );
      
changeimgzoom([B203[/B], 0.6 );
      
changeimgvis( [B]203[/B], );
    } 
You are missing something in the bold area- [look for ''[B]'' stuff ]

Also only update the attr[4] when needed- (if the players health changes...)
__________________
Reply With Quote
  #3  
Old 07-20-2011, 08:42 PM
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
Let's see...

hideimgs usage:

hideimg(start_index, end_index); - Hides images with ID range specified. (Inclusive)

I.e:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
showimg(200"block.png"3030);
  
showimg(201"block.png"3030);
  
showimg(202"block.png"3030);
  
showimg(203"block.png"3030);
  
hideimgs(200204); // Hides above blocks.

You can just do:

hideimgs(200, 1000);

To hide all your images. The way your script is setup right now you're also drawing over existing image indexes. I.e:

a = 0
200 + a = 200
201 + a = 201

a = 1
200 + a = 201 (Overlapping here)
201 + a = 202


You can replace (GS1 Way):

PHP Code:
for( 0playerscounta++ ) { 
    if ( 
players[a].guild in this.staff_list ) { 
With (GS2/Object-oriented Way):

PHP Code:
temp.0;
for (
temp.plplayers) {
  if (
temp.pl.guild in this.staff_list) {
    
  }
  
temp.+= 3;

__________________
Quote:
Reply With Quote
  #4  
Old 07-21-2011, 06:25 AM
Arch_Angel Arch_Angel is offline
Registered User
Join Date: Apr 2007
Posts: 482
Arch_Angel is on a distinguished road
Send a message via AIM to Arch_Angel
Quote:
Originally Posted by fowlplay4 View Post
Let's see...

hideimgs usage:

hideimg(start_index, end_index); - Hides images with ID range specified. (Inclusive)

I.e:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
showimg(200"block.png"3030);
  
showimg(201"block.png"3030);
  
showimg(202"block.png"3030);
  
showimg(203"block.png"3030);
  
hideimgs(200204); // Hides above blocks.

You can just do:

hideimgs(200, 1000);

To hide all your images. The way your script is setup right now you're also drawing over existing image indexes. I.e:

a = 0
200 + a = 200
201 + a = 201

a = 1
200 + a = 201 (Overlapping here)
201 + a = 202


You can replace (GS1 Way):

PHP Code:
for( 0playerscounta++ ) { 
    if ( 
players[a].guild in this.staff_list ) { 
With (GS2/Object-oriented Way):

PHP Code:
temp.0;
for (
temp.plplayers) {
  if (
temp.pl.guild in this.staff_list) {
    
  }
  
temp.+= 3;

I wish I could rep+ you every day. Thanks, stay tuned for my next thread in a few days

And thank you Andrew as well, I appreciate your help.
Reply With Quote
  #5  
Old 07-21-2011, 06:39 PM
Arch_Angel Arch_Angel is offline
Registered User
Join Date: Apr 2007
Posts: 482
Arch_Angel is on a distinguished road
Send a message via AIM to Arch_Angel
I got it all working using the new for( );

What would I do if I want it to display other players' nicks as well. Right now it only shows their own clients nick and HP, not every bodies
Reply With Quote
  #6  
Old 07-21-2011, 07:01 PM
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 Arch_Angel View Post
I got it all working using the new for( );

What would I do if I want it to display other players' nicks as well. Right now it only shows their own clients nick and HP, not every bodies
Your system is scripted to only show nicknames for people who are staff.
__________________
Quote:
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 06:02 PM.


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