diff options
| author | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
| commit | 5e2eb7d67ae933b7566f1944d0bb7744da03d586 (patch) | |
| tree | 054acff1113270a9cd07933df760f3768c1b6853 /sourcemod/scripting/gokz-localranks/db/print_js.sp | |
| parent | 341db13a008dc12bb22ceb50452d93d01476308c (diff) | |
move source stuff to its own folder
Diffstat (limited to 'sourcemod/scripting/gokz-localranks/db/print_js.sp')
| -rw-r--r-- | sourcemod/scripting/gokz-localranks/db/print_js.sp | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/sourcemod/scripting/gokz-localranks/db/print_js.sp b/sourcemod/scripting/gokz-localranks/db/print_js.sp deleted file mode 100644 index e694a95..0000000 --- a/sourcemod/scripting/gokz-localranks/db/print_js.sp +++ /dev/null @@ -1,108 +0,0 @@ -/* - Prints the player's personal best jumps. -*/ - - - -void DisplayJumpstatRecord(int client, int jumpType, char[] jumper = "") -{ - int mode = GOKZ_GetCoreOption(client, Option_Mode); - - int steamid; - char alias[33]; - if (StrEqual(jumper, "")) - { - steamid = GetSteamAccountID(client); - FormatEx(alias, sizeof(alias), "%N", client); - - DB_JS_OpenPlayerRecord(client, steamid, alias, jumpType, mode, 0); - DB_JS_OpenPlayerRecord(client, steamid, alias, jumpType, mode, 1); - } - else - { - DataPack data = new DataPack(); - data.WriteCell(client); - data.WriteCell(jumpType); - data.WriteCell(mode); - data.WriteString(jumper); - - DB_FindPlayer(jumper, DB_JS_TxnSuccess_LookupPlayer, data); - } -} - -public void DB_JS_TxnSuccess_LookupPlayer(Handle db, DataPack data, int numQueries, Handle[] results, any[] queryData) -{ - char jumper[MAX_NAME_LENGTH]; - - data.Reset(); - int client = data.ReadCell(); - int jumpType = data.ReadCell(); - int mode = data.ReadCell(); - data.ReadString(jumper, sizeof(jumper)); - delete data; - - if (SQL_GetRowCount(results[0]) == 0) - { - GOKZ_PrintToChat(client, true, "%t", "Player Not Found", jumper); - return; - } - - char alias[33]; - SQL_FetchRow(results[0]); - int steamid = SQL_FetchInt(results[0], JumpstatDB_FindPlayer_SteamID32); - SQL_FetchString(results[0], JumpstatDB_FindPlayer_Alias, alias, sizeof(alias)); - - DB_JS_OpenPlayerRecord(client, steamid, alias, jumpType, mode, 0); - DB_JS_OpenPlayerRecord(client, steamid, alias, jumpType, mode, 1); -} - -void DB_JS_OpenPlayerRecord(int client, int steamid, char[] alias, int jumpType, int mode, int block) -{ - char query[1024]; - - DataPack data = new DataPack(); - data.WriteCell(client); - data.WriteString(alias); - data.WriteCell(jumpType); - data.WriteCell(mode); - - Transaction txn = SQL_CreateTransaction(); - FormatEx(query, sizeof(query), sql_jumpstats_getrecord, steamid, jumpType, mode, block); - txn.AddQuery(query); - SQL_ExecuteTransaction(gH_DB, txn, DB_JS_TxnSuccess_OpenPlayerRecord, DB_TxnFailure_Generic_DataPack, data, DBPrio_Low); -} - -public void DB_JS_TxnSuccess_OpenPlayerRecord(Handle db, DataPack data, int numQueries, Handle[] results, any[] queryData) -{ - char alias[33]; - data.Reset(); - int client = data.ReadCell(); - data.ReadString(alias, sizeof(alias)); - int jumpType = data.ReadCell(); - int mode = data.ReadCell(); - delete data; - - if (!IsValidClient(client)) - { - return; - } - - if (SQL_GetRowCount(results[0]) == 0) - { - GOKZ_PrintToChat(client, true, "%t", "No Jumpstats Found"); - return; - } - - SQL_FetchRow(results[0]); - float distance = float(SQL_FetchInt(results[0], JumpstatDB_Lookup_Distance)) / 10000; - int block = SQL_FetchInt(results[0], JumpstatDB_Lookup_Block); - - if (block == 0) - { - GOKZ_PrintToChat(client, true, "%t", "Jump Record", gC_ModeNamesShort[mode], gC_JumpTypes[jumpType], alias, distance); - } - else - { - GOKZ_PrintToChat(client, true, "%t", "Block Jump Record", gC_ModeNamesShort[mode], gC_JumpTypes[jumpType], alias, block, distance); - } -} |
