Blockland Forums > Modification Help
finding stats to do with the server
Wordy:
Right then guys. I am learning to script within Blockland which I shall post a lot of topics. But let me get to the point.
I am making a script which is client sided, but I was wondering if I would be able to find out the functions for...
*The name of the server.
*My Blockland Identification number.
*My Client ID.
*My Blockland Name.
*My score within the server.
Thank you.
Port:
--- Quote from: Wordy on January 28, 2012, 01:38:55 PM ---*The name of the server. = Substring operations on NPL_Window.getValue()
--- End quote ---
--- Code: ---function getServerName()
{
%value = NPL_Window.getValue();
%pos = strPos( %value, " Players - " );
if ( %pos < 0 )
{
return "";
}
return getSubStr( %value, %pos + 11, strLen( %value ) );
}
--- End code ---
--- Quote from: Wordy on January 28, 2012, 01:38:55 PM ---*My Blockland Identification number.
--- End quote ---
getNumKeyID()
--- Quote from: Wordy on January 28, 2012, 01:38:55 PM ---*My Client ID.
--- End quote ---
What do you mean by this?
--- Quote from: Wordy on January 28, 2012, 01:38:55 PM ---*My Blockland Name.
--- End quote ---
$Pref::Player::NetName
Wordy:
--- Quote from: Port on January 28, 2012, 01:42:26 PM ---*My Client ID. = What do you mean by this?
--- End quote ---
Uh, as in my Object ID when I have spawned.
Port:
--- Code: ---function getServerName()
{
return $ServerInfo::Name;
}
function getMyScore()
{
%count = NPL_List.rowCount();
for ( %i = 0 ; %i < %count ; %i++ )
{
%row = NPL_List.getRowText( %i );
if ( getField( %row, 1 ) $= $Pref::Player::NetName && getField( %row, 3 ) == getNumKeyID() )
{
return getField( %row, 2 );
}
}
return 0;
}
function getMyPlayer()
{
return serverConnection.getControlObject();
}
function getMyName()
{
return $Pref::Player::NetName;
}
function getMyBL_ID()
{
return getNumKeyID();
}
--- End code ---
All in function form because I don't know why.
Headcrab Zombie:
--- Quote from: Port on January 28, 2012, 01:42:26 PM ---function getServerName()
{
%value = NPL_Window.getValue();
%pos = strPos( %value, " Players - " );
if ( %pos < 0 )
{
return "";
}
return getSubStr( %value, %pos + 11, strLen( %value ) );
}
--- End quote ---
$ServerInfo::Name
--- Quote from: Wordy on January 28, 2012, 01:44:37 PM ---Uh, as in my Object ID when I have spawned.
--- End quote ---
Not sure if you could get the client object client-side, but you can get your player object with serverConnection.getControlob ject()
There's not a lot you can do with it though