Is there any chain or formula to change the data in the "records" database and present it in the game panel in clock (time) format ?
regards.
Bern
convert clock time (database "records")
Re: convert clock time (database "records")
You mean you want to change the format how it is stored in the database? If true, there is no need (and no reason) to change that, because if you request data from the database you can get every format you want within the SQL request: https://www.w3schools.com/mysql/func_my ... format.asp
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: convert clock time (database "records")
I don't know if I have explained myself well, I never learned English ^^undef.de wrote: ↑23 Aug 2021, 12:44You mean you want to change the format how it is stored in the database? If true, there is no need (and no reason) to change that, because if you request data from the database you can get every format you want within the SQL request: https://www.w3schools.com/mysql/func_my ... format.asp
I put a photo of what I would like to appear in the game
Could this be the possible code? $formatTime
Code: Select all
$xml .='<label pos="59 '. $hauteur .'" z-index="0.005" size="30 7.5" textcolor="FFF" halign="right" style="TextSPScoreMedium" text="' . $formatTime. $row->Temps.'"></label>';
Re: convert clock time (database "records")
I found the correct code ......
a greeting
Code: Select all
$aseco->formatTime($row->Temps)
Re: convert clock time (database "records")
Is there any possibility to change the colors to the time format of each numbering (red minutes) (green seconds) (yellow milliseconds)?
Re: convert clock time (database "records")
bern wrote: ↑24 Aug 2021, 09:42 I found the correct code ......
Code: Select all
$aseco->formatTime($row->Temps)
Untested... but should do it.:
Paste the function formatTimeColored() into your plugin...
Code: Select all
private function formatTimeColored ($MwTime) {
if ($MwTime > 0) {
$tseconds = ((strlen($MwTime) > 3) ? substr($MwTime, strlen($MwTime)-3) : $MwTime);
$MwTime = floor($MwTime / 1000);
$hours = floor($MwTime / 3600);
$MwTime = $MwTime - ($hours * 3600);
$minutes = floor($MwTime / 60);
$MwTime = $MwTime - ($minutes * 60);
$seconds = floor($MwTime);
if ($tsec) {
if ($hours) {
return sprintf('$F00%d$FFF:$0C0%02d$FFF:$FF0%02d$FFF.$FF0%03d', $hours, $minutes, $seconds, $tseconds);
}
else {
return sprintf('$F00%d$FFF:$0C0%02d$FFF.$FF0%03d', $minutes, $seconds, $tseconds);
}
}
else {
if ($hours) {
return sprintf('$F00%d$FFF:$0C0%02d$FFF:$FF0%02d', $hours, $minutes, $seconds);
}
else {
return sprintf('$F00%d$FFF:$0C0%02d', $minutes, $seconds);
}
}
}
else {
return '0:00:000';
}
}
Code: Select all
$this->formatTimeColored($row->Temps)
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: convert clock time (database "records")
First of all thanks for the support and resolution of the problemundef.de wrote: ↑24 Aug 2021, 20:02bern wrote: ↑24 Aug 2021, 09:42 I found the correct code ......
Code: Select all
$aseco->formatTime($row->Temps)
Untested... but should do it.:
Paste the function formatTimeColored() into your plugin...... and call:Code: Select all
private function formatTimeColored ($MwTime) { if ($MwTime > 0) { $tseconds = ((strlen($MwTime) > 3) ? substr($MwTime, strlen($MwTime)-3) : $MwTime); $MwTime = floor($MwTime / 1000); $hours = floor($MwTime / 3600); $MwTime = $MwTime - ($hours * 3600); $minutes = floor($MwTime / 60); $MwTime = $MwTime - ($minutes * 60); $seconds = floor($MwTime); if ($tsec) { if ($hours) { return sprintf('$F00%d$FFF:$0C0%02d$FFF:$FF0%02d$FFF.$FF0%03d', $hours, $minutes, $seconds, $tseconds); } else { return sprintf('$F00%d$FFF:$0C0%02d$FFF.$FF0%03d', $minutes, $seconds, $tseconds); } } else { if ($hours) { return sprintf('$F00%d$FFF:$0C0%02d$FFF:$FF0%02d', $hours, $minutes, $seconds); } else { return sprintf('$F00%d$FFF:$0C0%02d', $minutes, $seconds); } } } else { return '0:00:000'; } }
Code: Select all
$this->formatTimeColored($row->Temps)
I have changed your code a bit to add "day" "hour" "minutes" "seconds" "milliseconds"
Because in the league of teams and nations enters the format "day"
Code: Select all
private function formatTimeColored ($MwTime) {
if ($MwTime > 0) {
$tseconds = ((strlen($MwTime) > 3) ? substr($MwTime, strlen($MwTime)-3) : $MwTime);
$MwTime = floor($MwTime / 1000);
$days = floor($MwTime / 86400);
$MwTime = $MwTime - ($days * 86400);
$hours = floor($MwTime / 3600);
$MwTime = $MwTime - ($hours * 3600);
$minutes = floor($MwTime / 60);
$MwTime = $MwTime - ($minutes * 60);
$seconds = floor($MwTime);
if ($tseconds) {
if ($days) {
return sprintf('$FF9%d$FFF:$FFF%02d$FFF:$FF9%02d$FFF:$FFC%03d', $days, $hours, $minutes, $seconds, $tseconds);
}
else {
return sprintf('$FF9%d$FFF:$FFF%02d$FFF:$FF9%02d$FFF:$FFC%03d', $hours, $minutes, $seconds, $tseconds);
}
}
}
else {
return '0:00:00:000';
}
}
all perfect !!!
Just wait for some players who suffer with the colors !!!
Re: convert clock time (database "records")
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Who is online
Users browsing this forum: No registered users and 4 guests