PHP Code:
function onActionServerSide(act, acc) {
if (act == "getPlayerVar") {
with(findplayer(acc)) {
plmoney = (@"-System/Money").getMoney(acc);
if(player.ismale){
plgender = "Male";
}
elseif(player.isfemale){
plgender = "Female";
}
else{
plgender = "";
}
temp.data = {
acc, player.account, plgender, clientr.hp, clientr.maxhp, plmoney, clientr.kills, clientr.deaths
};
}
player.triggerclient("gui", this.name, "profiledata", temp.data);
}
}
//#CLIENTSIDE
function onActionClientSide(act, playerdata) {
if (act == "profiledata") {
showProfilesWindow(temp.playerdata[0], temp.playerdata[1], temp.playerdata[2], temp.playerdata[3], temp.playerdata[4], temp.playerdata[5], temp.playerdata[6], temp.playerdata[7]);
}
}
function onMouseDown(type) {
if (type == "right") {
for (temp.p: players) {
if (mousex in | temp.p.x, temp.p.x + 3 | && mousey in | temp.p.y, temp.p.y + 3 | ) {
triggerServer("weapon", this.name, "getPlayerVar", p.account);
break;
}
}
}
}
function showProfilesWindow(acc, placc, plgender, plhp, plmaxhp, plmoney, plkills, pldeaths)
{
BasicWindow.show();
temp.playdata = findplayer(acc);
temp.profileTabs = {
{"Name", temp.playdata.nick, "name"},
{"Gender", plgender, "gender"},
{"HP", plhp SPC "/" SPC plmaxhp, "hp"},
{"Ap", temp.playdata.ap, "ap"},
{"Gralats", plmoney, "gralats"},
{"Kills", plkills, "kills"},
{"Death", pldeaths, "deaths"}
};
new GuiControl("BasicWindow") {
wSTW = screenwidth;
hSTW = (screenheight / 2.5);
useownprofile = true;
profile.opaque = true;
profile.border = 1;
profile.borderColor = "0 0 0";
profile.fillColor = "57 57 57";
extent = {
wSTW, hSTW
};
position = {
0, 0
};
canMove = canResize = canMaximize = canClose = false;
alpha = 1;
new GuiControl("BasicWindowTitle") {
useownprofile = true;
profile.opaque = true;
profile.border = 1;
profile.borderColor = "0 0 0";
profile.fillColor = "37 37 37";
position = {
0, 0
};
extent = {
wSTW, 30
};
canResize = canMaximize = canClose = canMove = false;
new GuiTextCtrl("BasicWindowTitleText") {
useownprofile = true;
profile.fontColor = "255 255 255";
profile.fontSize = 16;
profile.justify = "center";
position = "0 0";
width = 100;
height = 30;
text = "Profile:" SPC temp.playdata.nick;
}
}
new GuiControl("BasicWindowBackButton") {
WHeight = hSTW - 40;
useownprofile = true;
profile.opaque = true;
profile.border = 1;
profile.borderColor = "0 0 0";
profile.fillColor = "37 37 37";
position = {
0, WHeight
};
extent = "100 40";
canResize = canMaximize = canClose = canMove = false;
new GuiTextCtrl("BasicWindowBackButtonTitleText") {
useownprofile = true;
profile.fontColor = "255 255 255";
profile.fontSize = 16;
profile.justify = "center";
position = "0 0";
width = 100;
height = 40;
text = "Back";
}
}
new GuiShowImgCtrl("BasicWindowPlayerImg") {
x = screenwidth / 2;
y = 50;
width = 150;
height = 150;
zoom = 2.2;
ani = "idle";
playerlook = false;
actor.head = temp.playdata.head;
actor.body = temp.playdata.body;
actor.shield = temp.playdata.shield;
for (i = 1; i <= 30; i++)
actor.attr[i] = temp.playdata.attr[i];
for (i = 0; i < 5; i++)
actor.colors[i] = temp.playdata.colors[i];
offsetx = 50;
offsety = 50;
}
paramsY1 = 20;
for (temp.e = 0; e < profileTabs.size(); e++) {
paramsY1 += 20;
new GuiTextCtrl("BasicWindowName_" @ profileTabs[e][2]) {
useownprofile = true;
profile.fontColor = "255 255 255";
profile.fontSize = 16;
profile.justify = "left";
x = screenwidth / 4;
y = paramsY1;
width = 200;
height = 30;
text = profileTabs[e][0] SPC ":" SPC profileTabs[e][1];
}
}
}
}
function BasicWindowTitle.onMouseDown() {
BasicWindow.hide();
}
function BasicWindowBackButton.onMouseDown() {
BasicWindow.hide();
}