Blockland Forums > Modification Help
New player list
Kalphiter:
--- Quote from: Furling on February 27, 2011, 07:51:07 PM ---that not full code, just simple code.
--- Code: ---package Fancy_Badges
{
function NPL_List::addRow(%this, %row, %text, %index)
{
if(%row == 0)
if(%text $= "A")
%text = "<bitmap:....>";
else if(%text $= "S")
%text = "<bitmap:....>";
return parent::addRow(%this, %row, %text, %index);
NPL_Scroll.add(bitmap);
}
};
activatePackage(Fancy_Badges);
--- End code ---
--- End quote ---
%bitmap = new GuiBitmapCtrl()
{
position = "";
extent = "16 16";
bitmap = %text;
};
NPL_Scroll.add(%b);
Position will have to be calculated, based on its position in the list.
Furling:
--- Quote from: Kalphiter on February 27, 2011, 08:25:01 PM ---%bitmap = new GuiBitmapCtrl()
{
position = "";
extent = "16 16";
bitmap = %text;
};
NPL_Scroll.add(%b);
Position will have to be calculated, based on its position in the list.
--- End quote ---
--- Code: ---package Shield_PlayerList
{
function NPL_List::addRow(%this, %row, %text, %index)
{
if(%row == 0)
if(%text $= "H")
%text = "<bitmap:add-ons/script_InformationPlayer/icon_hostshield.png>";
else if(%text $= "SA")
%text = "<bitmap:add-ons/script_InformationPlayer/icon_superadminshield.png>";
else if(%text $= "S")
%text = "<bitmap:bitmap:add-ons/script_InformationPlayer/icon_adminshield.png>";
else if(%text $= "-")
%text = "<bitmap:bitmap:add-ons/script_InformationPlayer/icon_playershield.png>";
return parent::addRow(%this, %row, %text, %index);
%bitmap = new GuiBitmapCtrl()
{
position = "";
extent = "16 16";
bitmap = %text;
};
NPL_Scroll.add(%b);
}
};
activatePackage(Shield_PlayerList);
--- End code ---
Correct? and create folder client_name? and client notepad too, I want make sure it will work. aslo what about icon name? Not forget I will give you a credit for this. I am part of it too.
Kalphiter:
You just have to figure out the position, and check %text, what if it's not H, S, or A?
Furling:
--- Quote from: Kalphiter on February 27, 2011, 09:10:14 PM ---You just have to figure out the position, and check %text, what if it's not H, S, or A?
--- End quote ---
gui name is NPL_List and Position is 0 0, that all I got this.
But Ephialtes wrote this script:
--- Code: ---function RTBSI_onServerInfo(%tcp,%line,%type,%data)
{
if(%type $= "PLIST")
{
%players = strReplace(%data,"~","\t");
for(%i=0;%i<getFieldCount(%players);%i++)
{
%player = strReplace(getField(%players,%i),";","\t");
%status = getField(%player,2);
if(%status $= 3)
%status = "H";
else if(%status $= 2)
%status = "S";
else if(%status $= 1)
%status = "A";
else
%status = "-";
RTBSI_PlayerList.addRow(getField(%player,2),getField(%player,2) TAB %status TAB getField(%player,0) TAB getField(%player,3) TAB getField(%player,1),0);
}
}
--- End code ---
Furling:
bump