Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Custom Profiles =) (https://forums.graalonline.com/forums/showthread.php?t=68975)

KuJi 09-26-2006 09:11 PM

Custom Profiles =)
 
1 Attachment(s)
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

contiga 09-26-2006 09:39 PM

Nice :)

I like the IM windows, it's better then PM's, but private :-D

Sum41Freeeeek 09-26-2006 09:50 PM

The IMs are cool, but did you make an accept system where you can turn
off and on IMs? So you're not pking or something and someone goes HI

Skyld 09-26-2006 09:51 PM

Quote:

Originally Posted by KuJi (Post 1222567)
P.S. Skyld.. thanks for info @ openprofile command =).

You're welcome!

KuJi 09-26-2006 09:51 PM

Quote:

Originally Posted by Sum41Freeeeek (Post 1222586)
The IMs are cool, but did you make an accept system where you can turn
off and on IMs? So you're not pking or something and someone goes HI

The message doesn't take focus, your graal keeps focus.

BUT: I am going to work on a friends / ignore list soon =). I'll probally add new features asap =)

Quote:

Originally Posted by Skyld (Post 1222587)
You're welcome!

=D. Deserve it, else I wouldn't of thought of the idea lol

Rapidwolve 09-27-2006 12:29 AM

Yawr umm, everytime I try to make one of these I always have this one problem with player indexes z.z

KuJi 09-27-2006 03:58 AM

Quote:

Originally Posted by Rapidwolve (Post 1222661)
Yawr umm, everytime I try to make one of these I always have this one problem with player indexes z.z

Now you have a base =)

Rapidwolve 09-27-2006 04:41 AM

All I needed was teh players part :]

<3 thx

KuJi 09-27-2006 05:40 AM

Quote:

Originally Posted by Rapidwolve (Post 1222751)
All I needed was teh players part :]

<3 thx

=). Glad to help.. rep me =)

*Edit* Woah... it's only been one day and we've had a nifty amount of views - awsuem. Maybe I should contribute more =P.

xAndrewx 09-27-2006 08:41 AM

yea Skyld rocks :]

Darlene159 09-27-2006 12:30 PM

Quote:

Originally Posted by KuJi (Post 1222768)
=). Glad to help.. rep me =)

*Edit* Woah... it's only been one day and we've had a nifty amount of views - awsuem. Maybe I should contribute more =P.

I wish people would contribute more. Would be very helpful to the community. :)

Jackel9 09-27-2006 04:02 PM

I just want to know which server is that screenshot on you post.

Twinny 09-27-2006 04:09 PM

Quote:

Originally Posted by Darlene159 (Post 1222808)
I wish people would contribute more. Would be very helpful to the community. :)

And thus Code Gallery was introduced. Give it time.

KuJi 09-27-2006 09:11 PM

Quote:

Originally Posted by Jackel9 (Post 1222844)
I just want to know which server is that screenshot on you post.

Graal X.. my server of course.

Admins 09-28-2006 12:11 AM

Thanks for sharing the code :)


All times are GMT +2. The time now is 02:08 PM.

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