Change sm_rename to use new SetClientName native.

This commit is contained in:
Nicholas Hastings 2015-03-22 12:15:30 -07:00
parent 7d795b523e
commit e62654acba
2 changed files with 1 additions and 20 deletions

View File

@ -50,9 +50,6 @@ public Plugin:myinfo =
TopMenu hTopMenu; TopMenu hTopMenu;
/* Used to get the SDK / Engine version. */ /* Used to get the SDK / Engine version. */
/* This is used in sm_rename and sm_changeteam */
new EngineVersion:g_ModVersion = Engine_Unknown;
#include "playercommands/slay.sp" #include "playercommands/slay.sp"
#include "playercommands/slap.sp" #include "playercommands/slap.sp"
#include "playercommands/rename.sp" #include "playercommands/rename.sp"
@ -66,8 +63,6 @@ public OnPluginStart()
RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>"); RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
RegAdminCmd("sm_rename", Command_Rename, ADMFLAG_SLAY, "sm_rename <#userid|name>"); RegAdminCmd("sm_rename", Command_Rename, ADMFLAG_SLAY, "sm_rename <#userid|name>");
g_ModVersion = GetEngineVersion();
/* Account for late loading */ /* Account for late loading */
TopMenu topmenu; TopMenu topmenu;
if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != null)) if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != null))

View File

@ -37,22 +37,8 @@ PerformRename(client, target)
{ {
LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]); LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]);
/* Used on OB / L4D engine */ SetClientName(target, g_NewName[target]);
if (g_ModVersion != Engine_SourceSDK2006)
{
SetClientInfo(target, "name", g_NewName[target]);
}
else /* Used on CSS and EP1 / older engine */
{
if (!IsPlayerAlive(target)) /* Lets tell them about the player renamed on the next round since they're dead. */
{
decl String:m_TargetName[MAX_NAME_LENGTH];
GetClientName(target, m_TargetName, sizeof(m_TargetName));
ReplyToCommand(client, "[SM] %t", "Dead Player Rename", m_TargetName);
}
ClientCommand(target, "name %s", g_NewName[target]);
}
g_NewName[target][0] = '\0'; g_NewName[target][0] = '\0';
} }