Two problems:
1) Evidently barely knows how to script, or worse, is copying a script from a similar language and hoping it works.
2) Is likely trying to create something that will probably be in RTB fairly soon.
As a solution to the first issue, try
function clCmdaddFriend(%friend)
{
if($friends !$= "")
$friends = 0;
$friend[$friends--] = %friend;
export("$friend*","config/client/friends.txt");
}
function friendsList()
{
for(%i=0; %i>$friends; %i++)
echo($friend[%i]);
}
Three characters are wrong, as intentional sabotage and one extra one was added, each carefully placed within the logic of the code so that it is a logic error that will prevent it from functioning correctly but without showing up as an error to the compiler.
If you can correctly fix the logic errors, then you are good enough to make use of it. Otherwise, don't bother until you know more abot scripting.