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 09-04-2011, 10:58 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Mouse over for names and info

It basically just shows their nick, account and if there staff their position
add accounts in this.staffposition for their names to have a rank.
PHP Code:
//#CLIENTSIDE
function onCreated() {
//This is a list of ranks, add graal accounts to it as you please.
  
this.lats = {
    
"Graal######"
  
};
  
this.admins = {
    
"Graal######"
  
};
  
this.nats = {
    
"Graal######"
  
};
  
this.gfx = {
    
"Graal######"
  
};
  
this.sfx = {
    
"Graal######"
  
};
  
this.eventsteam = {
    
"Graal######"
  
};
  
onTimeout();
}

function 
onTimeout() {
//Hides the info so that if your mouse isnt over players they wont show.
  
Player_Name.hide();
  
Player_Account.hide();
  
Admin_Ranks.hide();
  
LAT_Ranks.hide();
  
NAT_Ranks.hide();
  
GFX_Ranks.hide();
  
Events_Team_Ranks.hide();
  
SFX_Ranks.hide();
//Checks if your mouse is over a player.
  
for (temp.pl: findNearestPlayers(mousex, mousey)) {
    if (
mousex in | pl.x, pl.x + 2.5 | && mousey in | pl.y, pl.y + 3 | ) {
//Creates the gui's to show.
      
new GuiTextCtrl("Player_Name") {
        
profile = GuiBlueTextProfile;
        
height = 20;
        
text = "Name:       " @ temp.pl.nick;
        
width = 200;
        
x = mousescreenx + 15;
        
y = mousescreeny - 5;
        
red = 1;
        
green = 1;
        
blue = 1;
        
alpha = 1;
      }
      new 
GuiTextCtrl("Player_Account") {
        
profile = GuiBlueTextProfile;
        
height = 20;
        
text = "Account:   " @ temp.pl;
        
width = 200;
        
x = mousescreenx + 15;
        
y = mousescreeny + 10;
        
red = 1;
        
green = 1;
        
blue = 1;
        
alpha = 1;
      }
//Shows "Rank: Staffrank" if your account is listed above.
      
if (temp.pl.account in this.admins) {
        new 
GuiTextCtrl("Admin_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:         Admin";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
Admin_Ranks.show();
        }
      }
      if (
temp.pl.account in this.lats) {
        new 
GuiTextCtrl("LAT_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:        LAT";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
LAT_Ranks.show();
        }
      }
      if (
temp.pl.account in this.nats) {
        new 
GuiTextCtrl("NAT_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:        NAT";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
NAT_Ranks.show();
        }
      }
      if (
temp.pl.account in this.gfx) {
        new 
GuiTextCtrl("GFX_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:        GFX";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
GFX_Ranks.show();
        }
      }
      if (
temp.pl.account in this.sfx) {
        new 
GuiTextCtrl("SFX_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:        SFX";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
SFX_Ranks.show();
        }
      }
      if (
temp.pl.account in this.eventsteam) {
        new 
GuiTextCtrl("Events_Team_Ranks") {
          
profile = GuiBlueTextProfile;
          
height = 20;
          
text = "Rank:         Events Team";
          
width = 200;
          
x = mousescreenx + 15;
          
y = mousescreeny + 25;
          
red = 1;
          
green = 1;
          
blue = 1;
          
alpha = 1;
          
Events_Team_Ranks.show();
        }
      }
//Shows players name and account regardless of it there staff.
      
Player_Name.show();
      
Player_Account.show();
    }
  }
//Loops it so its checking constantly if your mouse is on a player.
  
settimer(0.05);
} 
Any feedback is appreciated
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 09-04-2011 at 04:01 PM..
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 08:12 AM.


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