Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function chat_cprecs($aseco, $command) {
- global $tab_sec_recs;
- $player = $command['author'];
- $login = $command['author']->login;
- if ($aseco->server->getGame() == 'TMF') {
- $aseco->client->query('GetCurrentChallengeInfo');
- $CurrentChallengeInfo = $aseco->client->getResponse();
- $challenge = $CurrentChallengeInfo['UId'];
- $challenge_name = $CurrentChallengeInfo['Name'];
- $query_check = "SELECT Sector FROM `cprecs` WHERE ChallengeID='".$challenge."' ORDER BY Sector DESC LIMIT 1;";
- $result_check = mysql_query($query_check);
- while($row_check = mysql_fetch_object($result_check)) {
- $test_check = $row_check->Sector;
- }
- if ($test_check) {
- $header = $aseco->formatColors("Best CP Records on: ".$challenge_name."");
- $msg = array();
- $lines = 0;
- $player->msgs = array();
- $player->msgs[0] = array(1, $header, array(1.2, 0.15, 0.2, 0.4, 0.15));
- $msg[] = array('CP', 'Time', 'Player');
- foreach($tab_sec_recs as $value) {
- $sec = $value->cp;
- $nickt = mysql_fetch_object(mysql_query("SELECT `NickName` FROM `players` WHERE `Login` = '".$value->login."';"));
- if(strlen($sec) == 1){$sec = $sec;}
- if ($sec === $test_check) {
- $check_name = '{#record}Finish{#highlite}';
- } else {
- $check_name = '{#highlite}'.$sec.'';
- }
- //Adding line to the ManiaLink window
- $msg[] = array(str_pad($check_name, 2, '0', STR_PAD_LEFT), SecToTime($value->time,false), $nickt->NickName);
- $lines++;
- if ($lines > 17) {
- $player->msgs[] = $msg;
- $lines = 0;
- $msg = array();
- }
- }
- // add if last batch exists
- if (!empty($msg))
- $player->msgs[] = $msg;
- // display ManiaLink message
- display_manialink_multi($player);
- } else {
- $message = '$z$s$f00Note: $z$s$fffCurrently no Checkpoint Records on: '.$challenge_name.'$z$s$fff!';
- $aseco->client->query('ChatSendServerMessageToLogin', $aseco->formatColors($message), $login);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement