Skip to content

Commit

Permalink
Update ranking system
Browse files Browse the repository at this point in the history
  • Loading branch information
altair-sossai committed Jul 5, 2024
1 parent b14a467 commit 73e58a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Binary file modified addons/sourcemod/plugins/optional/l4d2_playstats_sync.smx
Binary file not shown.
15 changes: 2 additions & 13 deletions addons/sourcemod/scripting/l4d2_playstats_sync.sp
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,11 @@ void ShowRankingResponse(HTTPResponse httpResponse, int client)
void PrintPlayerInfo(JSONObject player, int client)
{
int position = player.GetInt("position");
int points = player.GetInt("points");
int lastMatchPoints = player.GetInt("lastMatchPoints");

char name[256];
player.GetString("name", name, sizeof(name));

if (lastMatchPoints == 0)
PrintToChat(client, "\x04%dº \x01%s: \x03%d \x01pts", position, name, points);
else if (lastMatchPoints > 0)
PrintToChat(client, "\x04%dº \x01%s: \x03%d \x01pts \x03(+%d)", position, name, points, lastMatchPoints);
else
PrintToChat(client, "\x04%dº \x01%s: \x03%d \x01pts \x04(%d)", position, name, points, lastMatchPoints);
PrintToChat(client, "\x04%dº \x01%s", position, name);
}

public void LastMatch(int client)
Expand Down Expand Up @@ -300,15 +293,11 @@ void LastMatchResponse(HTTPResponse httpResponse, int client)
JSONObject player = view_as<JSONObject>(players.Get(i));

int position = player.GetInt("position");
int lastMatchPoints = player.GetInt("lastMatchPoints");

char name[256];
player.GetString("name", name, sizeof(name));

if (lastMatchPoints >= 0)
PrintToChat(client, "\x04%dº \x01%s: \x03+%d pts", position, name, lastMatchPoints);
else
PrintToChat(client, "\x04%dº \x01%s: \x04%d pts", position, name, lastMatchPoints);
PrintToChat(client, "\x04%dº \x01%s", position, name);
}
}

Expand Down

0 comments on commit 73e58a2

Please sign in to comment.