Graal Forums  

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

View Poll Results: Was this useful to you?
Yeah 7 87.50%
No 1 12.50%
Voters: 8. You may not vote on this poll

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-26-2006, 09:11 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Custom Profiles =)

Version: 1.00
Made By: KuJi
At 3 AM.. dont complain =(

PHP Code:
// NPC Created by KuJi (September 26, 2006)
//#CLIENTSIDE
function onCreated()
{
  
this.commands = {"Profile"};
}

function 
onMouseDown(temp.mtype)
{
  switch (
temp.mtype)
  {
    case 
"right":
    {
      
this.pid onFindPlayers();
      
      if (
this.pid >= 0)
      {
        if (
this.pid == 0)
        {
          
player.showProfile();
        }
          else
        {
          
onShowMenu();
        }
      }
      
      break;
    }
  }
}

function 
onFindPlayers()
{
  
// Method 1 - UNTESTED -
  /*temp.found = testplayer(mousex, mousey);
  
  if (temp.found)
  {
    return temp.found;
  }
    else
  {
    return -1;
  }*/
  
  // Method 2
  
for (temp.0temp.players.size(); temp.I++)
  {
    if (
mousex in |players[temp.I].xplayers[temp.I].3| && mousey in |players[temp.I].yplayers[temp.I].3|)
    {
      return 
temp.I;
    }
  }
  
  return -
1;
}

function 
onShowMenu()

  new 
GuiContextMenuCtrl(Profile_Menu)
  {
    
profile     "GuiBluePopUpMenuProfile";
    
textprofile "GuiBlueTextListProfile";
    
text        players[thiso.pid].account;
    
width       20;
    
    
clearrows();
    
    
addRow(0players[thiso.pid].account);
    
addrow(-1"-");
    for (
temp.0temp.thiso.commands.size(); temp.I++)
    {
      
addRow(temp.1thiso.commands[temp.I]);
    }
    
    
open(mousescreenxmousescreeny);
  }
}

function 
Profile_Menu.onSelect(entryidtext)
{
  switch (
text)
  { 
    case 
"Profile":
    {
      
players[this.pid].showProfile();
      
      break;
    }
  }
  
  
Profile_Menu.destroy();

If you don't like it, whatever. Basically when you right-click a player it will show there account then a ---- (basically a line) which seperates the commands. (Those shown in this.commands on the onCreated function). There are two methods for checking for players on your right-click, they both SHOULD work (unsure =o). I prefer method 2 as it's more accurate in right-clicking. Anyway, when you right-click and click Profile it will show there graal profile.. right-clicking your self will show your own profile without the menu (is changable though)

If you have a suggestion add it, once again. I made this @ 3 AM.. so dont complain =(.

P.S. Skyld.. thanks for info @ openprofile command =).

Also, the attached picture is the profile menu opened ASWELL as the chat system (not included) which is basically direct-messaging (like aim? =o).

I will probally add a savelog (chat log) command, and maybe even a load log command. Gotta wait tho =P
Attached Thumbnails
Click image for larger version

Name:	graal_1159299077.png
Views:	500
Size:	341.0 KB
ID:	37993  

Last edited by KuJi; 09-26-2006 at 09:33 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 10:27 PM.


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