[Pawn] Rank Teams | TDM - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Rank Teams | TDM (/showthread.php?tid=1682) |
Rank Teams | TDM - Hitler - 2021-02-18 Espa?ol: ?Alguien sabe como hacer un rankings de teams?, me explico, una funcion para juntar los scores de los jugadores del team, uso MySQL English:?Does anyone know how to make a team ranking? Let me explain, a function to gather the scores of the team players, I use MySQL RE: Rank Teams | TDM - Kwarde - 2021-02-19 SELECT and ORDER BY. A basic query could be built as: Code: SELECT someData FROM someTable ORDER BY someColum; You can limit the results using "LIMIT" (in any select query): Code: SELECT * FROM someTable LIMIT 5; -- Would show no more than 5 results, even if there are more results For your situation, I'm assuming your table looks like this: Code: -- table "teams" -- So if you'd want to show a top 3 (top ranking) based on their score, showing the highest score first you'd have to order by (ascending) column score in this case: Code: SELECT name, score FROM teams ORDER BY score ASC LIMIT 3; Code: [name] [score] Note that queries may be more (way more) complex than this. However there's alot of documentation for that online. If you have any questions, use a search engine first now that you know the basics of that what you're looking for, enough information is already on the internet. |