Author Topic: Client message help.  (Read 477 times)

Ok, hello
This is my attempt at a code to do this purpose:
An Administrator can type the command: /forcemessage <PlayerName> and that player should get a message box with a predifined message (The variable).

Code: [Select]
function serverCmdForceMessage(%client,%name)
{
 %target = %client.player;
  if(%client.isAdmin && %name !$= "")
    %target = FindClientByName(%name).player;
  if(isObject(%target))
    %Target
    {
      MessageBoxOK("Server Message",$Servermessage);
    }
}

Please tell me where I have gone wrong.

The actual player does not receive messages, it's the client.
Code: [Select]
function serverCmdForceMessage(%client,%name)
{
  %target = %client;
  if(%client.isAdmin && %name !$= "")
    %target = FindClientByName(%name);
  if(isObject(%target))
    {
      commandToClient(%target,'MessageBoxOK',"Server Message",$Servermessage);
    }
}

That should work. You can look and see the changes.
« Last Edit: March 09, 2010, 02:09:07 PM by lilboarder32 »