added amb932 on a lark... %N maps to a client name, or "Console"
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401426
This commit is contained in:
parent
38a8e8ac80
commit
f8816ab556
@ -789,6 +789,26 @@ reswitch:
|
|||||||
arg++;
|
arg++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'N':
|
||||||
|
{
|
||||||
|
CHECK_ARGS(0);
|
||||||
|
cell_t *value;
|
||||||
|
pCtx->LocalToPhysAddr(params[arg], &value);
|
||||||
|
|
||||||
|
const char *name = "Console";
|
||||||
|
if (*value)
|
||||||
|
{
|
||||||
|
CPlayer *player = g_Players.GetPlayerByIndex(*value);
|
||||||
|
if (!player || !player->IsConnected())
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
|
||||||
|
}
|
||||||
|
name = player->GetName();
|
||||||
|
}
|
||||||
|
AddString(&buf_p, llen, name, width, prec);
|
||||||
|
arg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
CHECK_ARGS(0);
|
CHECK_ARGS(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user