Author Topic: Gui Player List Help  (Read 854 times)


My Gui won't show the players in a server but there is a tab in each spot of where the player's name and bl_id should be. Does anyone know how to fix?


Fixed.

New Question: How do I send a command to the selected player in the list?

For Example: This sends the MessageOkBox to me every time instead of the person who is selected in the player list.
(clientsided)
Code: [Select]
function CityRPG::message(%gui)
{
if($IAmAdmin > 0)
{
%row = CityRPGList.getSelectedID();

if(%row >= 0)
{
%name = getField(CityRPGList.getRowTextById(%row), 0);

commandToServer('Box', %name);
}
}
else
{
MessageBoxOK("Error", "You are not an Admin, so you cannot use this command.");
}
}
(serversided)
Code: [Select]
function ServerCmdBox(%name)
{
echo("Sending WelcomeBox...");
%name = %name;

commandToClient(%name, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}
« Last Edit: May 11, 2010, 08:27:14 AM by Wicked »

Code: [Select]
commandToClient(%client, 'AddProfile');

Maybe because you didn't specify any parameters?

What do the parameters that I need look like?
« Last Edit: May 10, 2010, 05:12:19 PM by Wicked »

Code: [Select]
function clientCmdAddProfile(%name, %BL_ID)
I would say, Name and BLID?

« Last Edit: May 10, 2010, 05:43:22 PM by Wicked »


My Gui won't show the players in a server but there is a tab in each spot of where the player's name and bl_id should be. Does anyone know how to fix?


Fixed.

New Question: How do I send a command to the selected player in the list?

For Example: This sends the MessageOkBox to me every time instead of the person who is selected in the player list.
(clientsided)
Code: [Select]
function CityRPG::message(%gui)
{
if($IAmAdmin > 0)
{
%row = CityRPGList.getSelectedID();

if(%row >= 0)
{
%name = getField(CityRPGList.getRowTextById(%row), 0);

commandToServer('Box', %name);
}
}
else
{
MessageBoxOK("Error", "You are not an Admin, so you cannot use this command.");
}
}
(serversided)
Code: [Select]
function ServerCmdBox(%name)
{
echo("Sending WelcomeBox...");
%name = %name;

commandToClient(%name, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}
« Last Edit: May 11, 2010, 08:26:36 AM by Wicked »

Code: [Select]
function ServerCmdBox(%name)
{
echo("Sending WelcomeBox...");
%name = %name;

commandToClient(%name, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}
%name = %name; -> You realize that is doing nothing?
Also, I think you need to specify a client, not a name.

You need to get a client ID number and use that in your commandToClient()

try this:
Code: [Select]
function ServerCmdBox(%name)
{
echo("Sending WelcomeBox...");
%client = findClientByName(%name);

commandToClient(%client, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}

You need to get a client ID number and use that in your commandToClient()

try this:
Code: [Select]
function ServerCmdBox(%name)
{
echo("Sending WelcomeBox...");
%client = findClientByName(%name);

commandToClient(%client, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}

Wow you don't know how serverCmd's work do you?
Code: [Select]
function ServerCmdBox(%client)
{
echo("Sending WelcomeBox...");
commandToClient(%client, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}

Wow you don't know how serverCmd's work do you?
Code: [Select]
function ServerCmdBox(%client)
{
echo("Sending WelcomeBox...");
commandToClient(%client, 'messageBoxOK', "Welcome Message", "Please follow the server rules. To view them type: /help view rules.");
}
That doesn't work already tried it and of course I know how server commands work. I figured out the solution now thanks guys.