make !mapsdone/!mapsleft steamid work

This commit is contained in:
rtldg 2021-09-21 03:53:56 +00:00
parent b94caead91
commit 0698a9d77e

View File

@ -547,26 +547,38 @@ public Action Command_MapsDoneLeft(int client, int args)
} }
int target = client; int target = client;
int iSteamID = 0;
if(args > 0) if(args > 0)
{ {
char sArgs[64]; char sArgs[64];
GetCmdArgString(sArgs, 64); GetCmdArgString(sArgs, 64);
iSteamID = SteamIDToAuth(sArgs);
if (iSteamID < 1)
{
target = FindTarget(client, sArgs, true, false); target = FindTarget(client, sArgs, true, false);
if (target == -1) if (target == -1)
{ {
return Plugin_Handled; return Plugin_Handled;
} }
GetClientName(target, gS_TargetName[client], sizeof(gS_TargetName[]));
iSteamID = GetSteamAccountID(target);
}
else
{
FormatEx(gS_TargetName[client], sizeof(gS_TargetName[]), "[U:1:%d]", iSteamID);
}
} }
gI_TargetSteamID[client] = GetSteamAccountID(target); gI_TargetSteamID[client] = iSteamID;
char sCommand[16]; char sCommand[16];
GetCmdArg(0, sCommand, 16); GetCmdArg(0, sCommand, 16);
GetClientName(target, gS_TargetName[client], MAX_NAME_LENGTH);
ReplaceString(gS_TargetName[client], MAX_NAME_LENGTH, "#", "?"); ReplaceString(gS_TargetName[client], MAX_NAME_LENGTH, "#", "?");
Menu menu = new Menu(MenuHandler_MapsDoneLeft); Menu menu = new Menu(MenuHandler_MapsDoneLeft);
@ -680,10 +692,12 @@ public Action Command_Profile(int client, int args)
{ {
return Plugin_Handled; return Plugin_Handled;
} }
iSteamID = GetSteamAccountID(target);
} }
} }
gI_TargetSteamID[client] = iSteamID ? iSteamID : GetSteamAccountID(target); gI_TargetSteamID[client] = iSteamID;
return OpenStatsMenu(client, gI_TargetSteamID[client]); return OpenStatsMenu(client, gI_TargetSteamID[client]);
} }