I'm trying to make it so when I call a server command it can do two different things. Pretty much function overloading but I'm pretty sure torque doesn't allow for function overloading.
function serverCmdTest(%client, %target)
{
%target = findClientByName(%target);
if(isObject(%target))
{
messageClient(%client,'',"It's a player!");
return;
}
messageClient(%client,'',"It's not a player!");
}
Now this will work and tell me if there's a player for pretty much all cases. My username is ProletariatPatryk and it finds a player when I do /test a. That's the only time it doesn't work. Is there some part of my username I'm missing that has "a" in it?
EDIT: I just figured out why it was happening, it just looks for any letter in the player's name. Is there a way to make it so it only uses parts of the player name starting from the beginning. So like p, pr, pro and so on like that?