/id <part of nickname>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMD:id(playerid, params[]) | |
{ | |
#if !defined COMMAND_ID_MAX_MATCHES | |
#define COMMAND_ID_MAX_MATCHES 10 | |
#endif | |
new | |
ids[COMMAND_ID_MAX_MATCHES]; | |
if (sscanf(params, "?<MATCH_NAME_PARTIAL=1>u[" #COMMAND_ID_MAX_MATCHES "]", ids)) { | |
SendClientMessage(playerid, -1, "{FFCC66}[Usage]: {FFFFFF}/id <part of nickname>"); | |
return 1; | |
} | |
#undef COMMAND_ID_MAX_MATCHES | |
new | |
i, | |
insert_pos, | |
string[MAX_PLAYER_NAME + 18 + 3 + 3 + 1]; | |
while (ids[i] != INVALID_PLAYER_ID) { | |
if (ids[i] == cellmin) { | |
SendClientMessage(playerid, -1, "{FFCC66}* {FFFFFF}and more..."); | |
break; | |
} | |
GetPlayerName(ids[i], string, sizeof(string)); | |
insert_pos = strfind(string, params, true); | |
if (insert_pos != -1) { | |
strins(string, "{FFFFFF}", strlen(params) + insert_pos); | |
strins(string, "{FF8888}", insert_pos); | |
} | |
format(string, sizeof(string), "{FFCC66}* {FFFFFF}%s - %d", string, ids[i]); | |
SendClientMessage(playerid, -1, string); | |
++i; | |
} | |
if (i == 0) { | |
SendClientMessage(playerid, -1, "{FFCC66}* {FFFFFF}No one found"); | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment