Skip to content

Commit

Permalink
make !mapsdone/!mapsleft steamid work
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Sep 21, 2021
1 parent b94caea commit 0698a9d
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions addons/sourcemod/scripting/shavit-stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -547,26 +547,38 @@ public Action Command_MapsDoneLeft(int client, int args)
}

int target = client;
int iSteamID = 0;

if(args > 0)
{
char sArgs[64];
GetCmdArgString(sArgs, 64);

target = FindTarget(client, sArgs, true, false);
iSteamID = SteamIDToAuth(sArgs);

if (iSteamID < 1)
{
target = FindTarget(client, sArgs, true, false);

if (target == -1)
{
return Plugin_Handled;
}

if(target == -1)
GetClientName(target, gS_TargetName[client], sizeof(gS_TargetName[]));
iSteamID = GetSteamAccountID(target);
}
else
{
return Plugin_Handled;
FormatEx(gS_TargetName[client], sizeof(gS_TargetName[]), "[U:1:%d]", iSteamID);
}
}

gI_TargetSteamID[client] = GetSteamAccountID(target);
gI_TargetSteamID[client] = iSteamID;

char sCommand[16];
GetCmdArg(0, sCommand, 16);

GetClientName(target, gS_TargetName[client], MAX_NAME_LENGTH);
ReplaceString(gS_TargetName[client], MAX_NAME_LENGTH, "#", "?");

Menu menu = new Menu(MenuHandler_MapsDoneLeft);
Expand Down Expand Up @@ -680,10 +692,12 @@ public Action Command_Profile(int client, int args)
{
return Plugin_Handled;
}

iSteamID = GetSteamAccountID(target);
}
}

gI_TargetSteamID[client] = iSteamID ? iSteamID : GetSteamAccountID(target);
gI_TargetSteamID[client] = iSteamID;

return OpenStatsMenu(client, gI_TargetSteamID[client]);
}
Expand Down

0 comments on commit 0698a9d

Please sign in to comment.