mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 07:13:21 +00:00
Flip order and limit # of shown entries
This commit is contained in:
parent
565a23f797
commit
a740bdf733
2 changed files with 5 additions and 4 deletions
Binary file not shown.
|
@ -341,7 +341,7 @@ public Action Command_ListNotes(int client, int args) {
|
||||||
char auth[32];
|
char auth[32];
|
||||||
GetClientAuthId(target_list[0], AuthId_Steam2, auth, sizeof(auth));
|
GetClientAuthId(target_list[0], AuthId_Steam2, auth, sizeof(auth));
|
||||||
|
|
||||||
DB.Format(query, sizeof(query), "SELECT notes.content, stats_users.last_alias FROM `notes` JOIN stats_users ON markedBy = stats_users.steamid WHERE notes.`steamid` = '%s'", auth);
|
DB.Format(query, sizeof(query), "SELECT notes.content, stats_users.last_alias FROM `notes` JOIN stats_users ON markedBy = stats_users.steamid WHERE notes.`steamid` = '%s' ORDER BY id DESC", auth);
|
||||||
ReplyToCommand(client, "Fetching notes...");
|
ReplyToCommand(client, "Fetching notes...");
|
||||||
DataPack pack = new DataPack();
|
DataPack pack = new DataPack();
|
||||||
pack.WriteCell(GetClientUserId(client));
|
pack.WriteCell(GetClientUserId(client));
|
||||||
|
@ -374,7 +374,7 @@ public void Event_FirstSpawn(Event event, const char[] name, bool dontBroadcast)
|
||||||
if(client > 0 && client <= MaxClients && !IsFakeClient(client)) {
|
if(client > 0 && client <= MaxClients && !IsFakeClient(client)) {
|
||||||
static char auth[32];
|
static char auth[32];
|
||||||
GetClientAuthId(client, AuthId_Steam2, auth, sizeof(auth));
|
GetClientAuthId(client, AuthId_Steam2, auth, sizeof(auth));
|
||||||
DB.Format(query, sizeof(query), "SELECT notes.content, stats_users.last_alias, markedBy FROM `notes` JOIN stats_users ON markedBy = stats_users.steamid WHERE notes.`steamid` = '%s' ORDER BY id ASC", auth);
|
DB.Format(query, sizeof(query), "SELECT notes.content, stats_users.last_alias, markedBy FROM `notes` JOIN stats_users ON markedBy = stats_users.steamid WHERE notes.`steamid` = '%s' ORDER BY id DESC", auth);
|
||||||
DB.Query(DB_FindNotes, query, GetClientUserId(client));
|
DB.Query(DB_FindNotes, query, GetClientUserId(client));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,8 +438,9 @@ public void DB_FindNotes(Database db, DBResultSet results, const char[] error, a
|
||||||
CPrintChatToAdmins(" {olive}%s: {default}%s", noteCreator, reason);
|
CPrintChatToAdmins(" {olive}%s: {default}%s", noteCreator, reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(count >= MAX_NOTES_TO_SHOW) {
|
int remainingNotes = count - MAX_NOTES_TO_SHOW;
|
||||||
CPrintChatToAdmins(" ... and {olive}%d {default}more", MAX_NOTES_COUNT - count);
|
if(remainingNotes >= MAX_NOTES_TO_SHOW) {
|
||||||
|
CPrintChatToAdmins(" ... and {olive}%d more", remainingNotes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(actions > 0) {
|
if(actions > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue