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 07-03-2010, 09:54 PM
BlackTemplar BlackTemplar is offline
Registered User
Join Date: Jul 2010
Posts: 9
BlackTemplar is on a distinguished road
Red face Custom Profile System

Profile System

Installing

1): Make a weapon-NPC, and name it '-System/Profile'.
2): Go to Control-NPC, and under 'onActionPlayerOnline()', add:


PHP Code:
clientr.account player.account;
clientr.communityname player.communityname;
clientr.upgradestatus player.upgradestatus

Enjoy!

-BlackTemplar


PHP Code:
/*
Custom Profile System
Made By BlackTemplar
7/3/2010
*/
function onActionServerSide()
  {
  switch (
params[0])
    {
    case 
"Profile":
    {
      
this.player.clear();
      for (
temp.0temp.allplayerscounttemp.++)
        if (
params[1in allplayers[temp.i].x,allplayers[temp.i].| && params[2in allplayers[temp.i].y,allplayers[temp.i].| && allplayers[temp.i].level != NULL)
          {
        
this.player allplayers[temp.i];
        
triggerClient("weapon",this.name,"Profile",this.player,this.player.clientr.communityname,this.player.clientr.upgradestatus);
        break;
      }
    }
  }
}
//#CLIENTSIDE
function onActionClientSide()
  {
  
Profile(params[1],params[2],params[3]);
}
function 
onCreated()
  {
  
EnableFeatures(allfeatures 0x800); //Disables Default Profile
  
Profile_Window.hide();
}
function 
onMouseDown(button)
  {
  if (
button == "right")
    {
    
triggerServer("weapon",this.name,"Profile",mousex,mousey);
  }
}
function 
Profile(account,communityname,upgradestatus)
  {
  
Profile_Window.show();
  new 
GuiWindowCtrl("Profile_Window")
    {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "346,200";
    
canmaximize closequery destroyonhide false;
    
canmove canresize true;
    
text "*" account;
    
screenwidth - (width 2);
    
screenheight - (height 2);
    
    new 
GuiScrollCtrl("Profile_MultiLine_Scroll")
      {
      
profile GuiBlueScrollProfile;
      
height 168;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 346;
      
1;
      
      new 
GuiMLTextCtrl("Profile_MultiLine")
        {
        
profile GuiBlueMLTextProfile;
        
height 16;
        
horizsizing "width";
        
text "<center>Player Information</center>" NL "<center><u>Account</u></center>" NL "<center>" account "</center>" NL "<center><u>Community Name</u></center>" NL "<center>" communityname "</center>" NL "<center><u>Account Status</u></center>" NL "<center>" upgradestatus "</center>";
        
width 321;
      }
    }
    new 
GuiButtonCtrl("Profile_Button_Close")
      {
      
profile GuiBlueButtonProfile;
      
height 25;
      
text "Close";
      
width 346;
      
172;
    }
  }
}

function 
Profile_Button_Close.onAction()
  {
  
Profile_Window.hide();

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 09:31 AM.


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