
07-03-2010, 09:54 PM
|
|
Registered User
|
Join Date: Jul 2010
Posts: 9
|
|
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.i = 0; temp.i < allplayerscount; temp.i ++)
if (params[1] in | allplayers[temp.i].x,allplayers[temp.i].x + 3 | && params[2] in | allplayers[temp.i].y,allplayers[temp.i].y + 3 | && 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;
x = screenwidth / 2 - (width / 2);
y = screenheight / 2 - (height / 2);
new GuiScrollCtrl("Profile_MultiLine_Scroll")
{
profile = GuiBlueScrollProfile;
height = 168;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 346;
y = 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;
y = 172;
}
}
}
function Profile_Button_Close.onAction()
{
Profile_Window.hide();
}
|
|
|
|