mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Add new special format specifiers.
This commit is contained in:
parent
27f451a868
commit
54eb83c302
@ -774,6 +774,38 @@ reswitch:
|
||||
arg++;
|
||||
break;
|
||||
}
|
||||
case 't':
|
||||
{
|
||||
CHECK_ARGS(0);
|
||||
cell *addr = get_amxaddr(amx, params[arg]);
|
||||
const char* auth = "Console";
|
||||
|
||||
if (*addr)
|
||||
{
|
||||
CPlayer *player = NULL;
|
||||
|
||||
if (*addr >= 1 && *addr <= gpGlobals->maxClients)
|
||||
{
|
||||
player = GET_PLAYER_POINTER_I(*addr);
|
||||
}
|
||||
|
||||
if (!player || !player->initialized)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Client index %d is invalid", *addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
auth = GETPLAYERAUTHID(player->pEdict);
|
||||
if (!auth || auth[0] == '\0')
|
||||
{
|
||||
auth = "STEAM_ID_PENDING";
|
||||
}
|
||||
}
|
||||
|
||||
AddString(&buf_p, llen, auth, width, prec);
|
||||
arg++;
|
||||
break;
|
||||
}
|
||||
case '%':
|
||||
*buf_p++ = static_cast<D>(ch);
|
||||
if (!llen)
|
||||
|
Loading…
Reference in New Issue
Block a user