Gamemodes in XAseco1 and XAseco2

Sometimes you need to know which Gamemode the dedicated server currently runs. The significant different Gamemode is Stunts in which the Player didn´t have to drive as fast as he can to get the best time at the finish line, here the Player have to make stunts like Straight Alley Oop 180! for which the Player get a score.

So if you want to display the time or score, then you need to know which Gamemode is currently on, because the time need to be formated into something like 1:47.157 and the score into 4.570. To sort the time or score you need the Gamemode too, because in Gamemode Stunts is higher better and in all other Gamemodes is lower better!

The current Gamemode is accessible with $aseco->server->gameinfo->mode. If you want to use $aseco in one of your own function, then you have to include this object into your own scope:

Include $aseco into your own scope
global $aseco;

Write this direct after your declaration of your own function, then you are able to use $aseco in your own function.

Example to find out the current Gamemode

Introduced with XAseco2/1.00 and XAseco/1.15 you are able to use constants (Gameinfo::RNDS) instead of Ids for the Gamemodes. This is very helpful, because you may not need know which Id is the Gamemode Rounds (for both, XAseco1 and XAseco2, see the differences).

To find out if the current Gamemode is Rounds, you can do it like this example:

if ($aseco->server->gameinfo->mode == Gameinfo::RNDS) {
	// Do something
Last modified: Sat, 23 Feb 2013 18:40:10 +0100
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
XAseco is maintained by Frans P. de Vries.
MPAseco is maintained by Kremsy, ManiacTwister & TheM

Reordered Navigation

Maybe you have already noticed, that i have changed the order in the Navigation. Since now XAseco2 is in front of all others content.

Donate Planets

Donate Coppers

Donate via PayPal

ATOM release feeds

RSS release feeds