Page 2 of 3

Re: [Plugin] Checkpoint Records

Posted: 02 Apr 2018, 06:53
by iziboi
Awesome plugin, thanks for sharing!

But, how to setup it for "Rounds" to do not rester checkpoint stats every round?

EDIT:

Fixed by removing:

Code: Select all

    /**
     * Called when a round ends
     * @param $aseco
     * @param $count
     */
    public function onEndRound($aseco, $count)
    {
        $this->initialize($aseco);
    }
Now would be nice warm up ignore.

Re: [Plugin] Checkpoint Records

Posted: 17 Nov 2018, 20:55
by undef.de
If a player is driving the checkpoint time of e.g. 7.146 and an other player drives the exact time a little bit later, then the player who was driving the time earlier should be still displayed.

Currently that's not the case, now the second player is shown. To change that you have to change the function from

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

        if (!array_key_exists($cpId, $this->checkpoints)) {
            $this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() >= $time) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }
    
to

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

	$force_update = false;
        if (!array_key_exists($cpId, $this->checkpoints)) {
		$this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
		$force_update = true;
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() > $time || $force_update === true ) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }


Also the file "plugin.checkpoint_records.ext.php" isn't required to be external, you could include the content into "plugin.checkpoint_records.php" after the end of the class "PluginCheckpointRecords".

Example structure:

Code: Select all

<?php
$_PLUGIN = new PluginCheckpointRecords();

class PluginCheckpointRecords extends Plugin {
	// Code here
}

class RecordsCheckpoint extends Checkpoint {
	// Code here
}

?>
That makes the handling/install much easier.


EDIT: I changed the plugin by myself, you can download the changed plugin at UASECO plugin repository: https://www.uaseco.org/plugins/details.php?id=2

Re: [Plugin] Checkpoint Records

Posted: 08 Dec 2018, 13:03
by braker
Thank you for updating the plugin.
Just wanted to do it, I'm really stressed because of university and didn't have the time.

Re: [Plugin] Checkpoint Records

Posted: 02 Apr 2019, 22:57
by oldkami
Hi
This plugin (latest version) stopped working after uaseco 0.9.6 upgrade. I cant get it to work again. The configs looks ok and no errors in uaseco log.
Any idea?

Re: [Plugin] Checkpoint Records

Posted: 03 Apr 2019, 18:04
by undef.de
Just checked plugin.checkpoint_records.php/1.12.1 build 2018-11-17 with 0.9.6 and it's working for me as it should. Maybe you have placed the position outside the viewport? Try to use the default values from the checkpoint_records.xml.

Re: [Plugin] Checkpoint Records

Posted: 03 Apr 2019, 19:12
by oldkami
Hi Undef
yes, Plugin v.1.12.1 build 2018-11-17
I'm using default values i xml:

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<settings>
	<scale>0.32</scale>
	<pos_x>120</pos_x>
	<pos_y>81</pos_y>
	<columns>5</columns>
	<spacing>1</spacing>
</settings>
plugin.checkpoint_records.php = default
plugins.xml = ok

Hmm..investigating...

Re: [Plugin] Checkpoint Records

Posted: 03 Apr 2019, 20:12
by undef.de
Which gamemode do you use? I have tested only Rounds.Script.txt and TimeAttack.Script.txt.

Re: [Plugin] Checkpoint Records

Posted: 03 Apr 2019, 21:40
by oldkami
I use TimeAttack.
Thx for helping. Havent figured it out yet...

Re: [Plugin] Checkpoint Records

Posted: 08 Apr 2019, 13:23
by oldkami
Finally solved missing plugin(s).
When some of the other plugins also disapeared (Vote, Donate), i replaced the plugins.xml with a old backup. Everything looked fine in file before, so i don't know what caused the problem (corruption?).
Anyway, everything is running fine now :)

Re: [Plugin] Checkpoint Records

Posted: 19 Mar 2020, 14:58
by RelaxedRacer
I found a little problem today in the plugin (and maybe more plugins have this not shure)
When a player has a " in the nickname i got errors and it didnt displayed correctly.

I changed this in the code that solved it:

Code: Select all

    public function getPlayerNick()
    {
       // return $this->player->nickname;
		$nicknrpl = str_ireplace('"', '', $this->player->nickname);
		return $nicknrpl;
    }
Maybe this " can be added to stripstyles, or i donno, i'm no expert on this :roflol: