[sloved]player best time in time attack mode

This forum is dedicated to the Aseco/Rasp 2 server records and control script by Flo and Assembler Maniac. Announcements and issues can be discussed in this forum.

Moderators: Flo, Assembler Maniac, f*ckfish, TM-Patrol

Post Reply
nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

[sloved]player best time in time attack mode

Post by nikolans » 11 Nov 2008 15:45

hello,

lets say that is mode of race time attack mode. how can i get best time for all players that are on server?

i do not need soulution, i need help where to start. (solution would be great to)!!!!

best regards
Nikola
Last edited by nikolans on 12 Nov 2008 17:05, edited 1 time in total.

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: player best time in time attack mode

Post by nikolans » 11 Nov 2008 16:28

Ok I made some research. In rs_times table I can get player time for the race, date when player is finished the race and the player id.

How to show best race time for current race? I can play race 1000 times and only want to show best time in current session for the race.

Anyone?

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: player best time in time attack mode

Post by w1lla » 11 Nov 2008 17:04

Read this topic:

viewtopic.php?f=124&t=14464
The Live Rankings Widget

This widget displays the current scoreboard in the same style like the local records widget.

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: player best time in time attack mode

Post by nocturne » 11 Nov 2008 18:51

Use the 'records' table instead, unless you want to display times that are past the record limit.

Depending on what you plan on using it for... I'd imagine you'd want a foreach loop on the playerlist, do a quick query to get the playerid from the 'players' table, and then a query on the records table where playerid=## and challengeid=##. If you want to store what place the rec is, then do another query on the 'records' table where challengeid=## sorted ascending by time, and then pull out the row number where playerid=## and add one to it and you got the track rank. Then, just pop the info for each player into a multidimensional array ($array['login']['nickname']['rank']['rec']) and parse it into whatever you want..

Should be a lot of code to 'pilfer' from the localdb or rasp plugins, or at least use as a good example. Good luck.

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: player best time in time attack mode

Post by nikolans » 12 Nov 2008 10:51

This is great answer. Thanks.
I need flowing thing:

I have 100 players on server. I want to Extract 50 top times if the game mode is time attack. Not best time ever, but best time in this challenge. Where do I start?

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: player best time in time attack mode

Post by nocturne » 12 Nov 2008 14:57

Well, to check if in timeattack mode, use...

Code: Select all

   if ( $this->Aseco->server->gameinfo->getMode() == 'TimeAttack' ) {
   }
As far as the rest goes, I don't quite understand... You want to extract the top 50 times for a challenge? Or the top scores of whose connected?

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: player best time in time attack mode

Post by nikolans » 12 Nov 2008 16:48

Code: Select all

GetCurrentRanking
array GetCurrentRanking(int, int)!!!!!!

What to put in GetCurrentRanking(' ',' ')?

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: player best time in time attack mode

Post by nikolans » 12 Nov 2008 17:05

Solved with GetCurrentRanking('1,'0'); getresponse for that asecoquery and the just $infos[0][BestTime']

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: [sloved]player best time in time attack mode

Post by nocturne » 12 Nov 2008 18:46

TMF Methods -- good reference for tmf dedserver methods

You can use the CustomCMD plugin for remotecp4 to test server queries, and check the format of the output. There's also an rpc utility around here somewhere... but can't seem to find it atm.

Xymph
Pit Crew
Pit Crew
Posts: 5704
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [sloved]player best time in time attack mode

Post by Xymph » 12 Nov 2008 23:04

nocturne wrote:You can use the CustomCMD plugin for remotecp4 to test server queries, and check the format of the output. There's also an rpc utility around here somewhere... but can't seem to find it atm.
http://www.gamers.org/tmn/#scripts
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Post Reply