Findclientbyname
by Joshua Hedger · in Technical Issues · 12/12/2008 (2:58 pm) · 0 replies
Ok I am trying to make a function called "findclientbyName" so I could do somthing such as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function servercmdkill(%sender, %args)
{
%target = findClientByName(%target);
if(!isobject(%target))
{
return;
}
if (%target)
{
%target.player.kill();
messageAll('MsgAll', '%1 has been killed by the Admin', %target.name);
}
else
{
messageClient(%sender, 'MsgClient', 'Invalid Target!');
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function servercmdkill(%sender, %args)
{
%target = findClientByName(%target);
if(!isobject(%target))
{
return;
}
if (%target)
{
%target.player.kill();
messageAll('MsgAll', '%1 has been killed by the Admin', %target.name);
}
else
{
messageClient(%sender, 'MsgClient', 'Invalid Target!');
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
About the author