Removed the alive check from sm_rename. Added in additional support for CSS / OB engines.

This commit is contained in:
Liam
2009-03-07 16:58:14 -05:00
parent a299533508
commit 134cb68396
3 changed files with 31 additions and 2 deletions
+19 -2
View File
@@ -36,7 +36,24 @@ new String:g_NewName[MAXPLAYERS+1][MAX_NAME_LENGTH];
PerformRename(client, target)
{
LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]);
SetClientInfo(target, "name", g_NewName[target]);
/* Used on OB / L4D engine */
if (g_ModVersion > SOURCE_SDK_EPISODE1)
{
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';
}
public AdminMenu_Rename(Handle:topmenu,
@@ -156,7 +173,7 @@ public Action:Command_Rename(client, args)
client,
target_list,
MAXPLAYERS,
COMMAND_FILTER_ALIVE,
COMMAND_TARGET_NONE,
target_name,
sizeof(target_name),
tn_is_ml)) > 0)