04.08.2016, 17:54
I didn't test it out, but it should work:
But it will bug if there is another ']' inside of the clan tag.
You could improve it if you want.
Use "k<playername>" instead of "u".
Код:
SSCANF:playername(string[]) { if (isnull(string)) return INVALID_PLAYER_ID; new tmp; if (!sscanf(params, "i", tmp)) { if (!IsPlayerConnected(tmp)) return INVALID_PLAYER_ID; return tmp; } new player_name[25]; for (new i, j = GetPlayerPoolSize(); i <= j; i++) { if (IsPlayerConnected(i)) continue; GetPlayerName(i, player_name, 25); if (player_name[0] == '[' && (tmp = strfind(player_name, "]", false)) != -1) { if (!strcmp(player_name[tmp+1], string, true, strlen(string)) { return i; } } } return INVALID_PLAYER_ID; }
You could improve it if you want.
Use "k<playername>" instead of "u".