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.I = 0; temp.I < players.size(); temp.I++)
{
if (mousex in |players[temp.I].x, players[temp.I].x + 3| && mousey in |players[temp.I].y, players[temp.I].y + 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(0, players[thiso.pid].account);
addrow(-1, "-");
for (temp.I = 0; temp.I < thiso.commands.size(); temp.I++)
{
addRow(temp.I + 1, thiso.commands[temp.I]);
}
open(mousescreenx, mousescreeny);
}
}
function Profile_Menu.onSelect(entryid, text)
{
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