Page 1 of 1

[XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 31 Aug 2016 12:45
by realh
The code is unchanged in this release, but the plugin has a new home on github.

Flexitime plugin for TrackMania Forever xaseco

This plugin provides the /timeleft chat command, allowing players with the appropriate privilege level to change the time left on the fly. It also optionally provides functionality similar to the customtime (providing a /timeset command) and authortime plugins.


To install
Copy plugin.flexitime.php to xaseco's plugins directory and flexitime.xml to the parent of that directory. Edit flexitime.xml (using a decent editor with syntax highlighting is strongly recommended) to customise the plugin for your server. The plugin runs its own timer in place of the standard timer so disable the latter by setting <timeattack_limit> or whatever to 0 in the server's MatchSettings config.

If you want to use the custom_time (/timeset) feature you will need to make sure your database has the appropriate table. See <>.

Example usage:

Query the time remaining:

Set the remaining time to 10 minutes:
/timeleft 10

Add 10 minutes to the remaining time:
/timeleft +10

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 18 Nov 2016 17:16
by realh
Just bumping this to make sure the thread is newer than the one for 1.1.3.

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 28 Jan 2017 20:28
by ccx
Hello Realh !

I discovered your plugin on a server (Where I typed "/plugins" ;)) and I loved it. So I downloaded the last version (1.3.3), and have some questions.

- I used "plugin.autotime.php" to set time of the next map depending on its author time. I commented it to use you author time mode, is it what to do, or both can work together ? How ?

- It looks to work, but the original Timer still displays under your one. How to remove, or hide it please ?

- When I press Tab key at start of a map, I always see 07:00 minutes. While yours start for example to 06:00, depending on author time. How can I fix it ?

- If I type /timeleft pause, then your timer disappeared, and Nadeo original one then display better. The problem is that when it comes to 0, the map changes :(

- The vote time is 20 seconds, is it possible to make it shorter ?

- IMHO you shoud add in the installation guide to add the line <plugin>plugin.flexitime.php</plugin> in the plugins.xml, I forgot it because not in the guide. Could be helpful for newbies.
Where to add it ? At the end ?

- If that works like that, ok, but I don't undestand why variables are twice declared : once in the xml, and once in the php.
E.g. in .xml :
and in .php :
private $ADMIN_LEVEL = 1;
Hmm, maybe better to have same values in both files ?

Thanks a lot for that plugin, to you and all people that helped you to fix it. :lovetm


PS : Is it possible to update that page to have the freshest link ? I began with first version, and I were about to cry :roflol:

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 28 Jan 2017 22:36
by Xymph
ccx wrote:- The vote time is 20 seconds, is it possible to make it shorter ?
ccx wrote:PS : Is it possible to update that page to have the freshest link ?
Thanks for the reminder.

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 18 Feb 2017 01:36
by L3cKy
If a player pause the timer and forget to resume it before he leave the server the timer won't start alone ... would be nice to add an function that the time automatically resume when the player who stopped it leaves the server

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 15 Mar 2017 12:13
by L3cKy
NOTE: This works only if you set the admin level to "2" (<admin_level>2</admin_level>) in the flexitime.xml file.

This little addon will automatically resume the timer if an admin used the command "/timeleft pause" and forgot to resume it after he left the server and no other admin is on the server.

Add following code into plugin.flexitime.php

1. add after Line 31

Code: Select all

Aseco::registerEvent("onPlayerDisconnect", "realh_flexitime_disco");
2. add after Line 447 and before 448

Code: Select all

	public function disco() {
		if ($this->aseco->server->getGame() == "TMF") {
			$status = $this->aseco->client->getResponse();
		$adm = 0;
		foreach ($this->aseco->server->players->player_list as $player) {
			if ($this->aseco->isAdmin($player) != 0) {
				$adm ++;
		if ($status["Code"] == 4 && $this->paused == true && !$adm) {
			$this->paused = false;
			$this->showChatMsg("Server unpaused the timer.");
3. add at the end

Code: Select all

function realh_flexitime_disco($aseco, $command) {
    global $realh_flexitime;

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 27 May 2017 14:29
by L3cKy
Just found another little "issue" at command "/timeset" if custom_tracktime is enabled.
If you set a new time with "/timeset 05:30" it just accept and writes fully minutes in the database like 5 and NOT 05:30.

I changed following code in function "public function commandTimeSet($command) {"

Code: Select all

 $param = intval(trim($command["params"]));

Code: Select all

$param = $command["params"];

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Posted: 01 Jun 2017 17:23
by L3cKy
With this Plugin Ladder Servers wont handle Ladder Points anymore because of the "<timeattack_limit>" is set to "0" at the matchsettings.
Maybe this should stand also in the Readme ... just in case. ;)