Possibly.
It's much harder to judge if something will work than write it :-D
Try it :-D
EDIT: And there's no point to strlen ShortestName every iteration - you can just save it.
No, it won't work.
If only because you got you > and < the wrong way around ...
That, and shortestname starts off empty. So its strlen is 0. So no other string can be shorter :-D
Re-EDIT: this:
PHP Code:
{
new Players[32], Num, Player, ShortestName[32],ShNameLen=9999;
get_players(Players, Num);
for(new i = 0 ; i < Num ; i++)
{
Player = Players[i];
static Name[32], NameLen ;
get_user_name(Player, Name, sizeof Name - 1);
NameLen = strlen(Name);
if(NameLen < ShNameLen)
{
copy(ShortestName, sizeof ShortestName - 1, Name);
ShNameLen = NameLen
}
}
return ShortestName;
}
works fine.
I only changed a little - mainly swapping < for >, initialising shNameLen as 9999 and saving ShNameLen between iterations, rather than getting it each time.