core/sm_stringutil.cpp
changeset 1420 0591a57b25e7
parent 1352 4241c756c278
child 1505 d063f3dee725
     1.1 --- a/core/sm_stringutil.cpp	Thu Sep 13 17:21:41 2007 +0000
     1.2 +++ b/core/sm_stringutil.cpp	Thu Sep 13 17:30:27 2007 +0000
     1.3 @@ -789,6 +789,26 @@
     1.4  				arg++;
     1.5  				break;
     1.6  			}
     1.7 +		case 'N':
     1.8 +			{
     1.9 +				CHECK_ARGS(0);
    1.10 +				cell_t *value;
    1.11 +				pCtx->LocalToPhysAddr(params[arg], &value);
    1.12 +
    1.13 +				const char *name = "Console";
    1.14 +				if (*value)
    1.15 +				{
    1.16 +					CPlayer *player = g_Players.GetPlayerByIndex(*value);
    1.17 +					if (!player || !player->IsConnected())
    1.18 +					{
    1.19 +						return pCtx->ThrowNativeError("Client index %d is invalid", *value);
    1.20 +					}
    1.21 +					name = player->GetName();
    1.22 +				}
    1.23 +				AddString(&buf_p, llen, name, width, prec);
    1.24 +				arg++;
    1.25 +				break;
    1.26 +			}
    1.27  		case 's':
    1.28  			{
    1.29  				CHECK_ARGS(0);