There are some minor things you could change :
- You should check '/' before all the others checks and you should organized them better, something like :
Code:
if ( Args[ 0 ] != '/' )
{
return;
}
if ( get_pcvar_num( Admins_Only ) && !is_user_admin( id ) )
{
client_print( id, print_chat, "%L", id, "ONLY_ADMINS" );
}
else if ( containi( Args, "info" ) != -1 )
{
...
}
- Instead of writing sizeof - 1 ; you can use the macro charsmax(). Something you should apply for all, not only in format().
- Use formatex() instead of format(), it's faster and you can use it safely here.
- It's more efficient to use get_players() like suggested by fezh instead of looping through all players + is_user_connected().
- So using get_players() you will know total players with the second param and you can remove client_putinserver/client_disconnect.
- Don't create var in a loop when you can.
- No need to check if '<' is present before, use directly replace().
- In the first three format(), you could save 2 natives by using only one format.
This plugin doesn't seem useful ; you should try to add more features.
btw :
Code:
[fr]
INFO_PLAYERS = Infos sur les joueurs
NICK = Nom
HEALTH = Vie
ARMOR = Armure
MONEY = Argent
TOTAL = Total des joueurs
ONLY_ADMINS = Uniquement les admins peuvent utiliser la commande.
__________________