Clickable Commands

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
david_jumper
happy cruiser
happy cruiser
Posts: 140
Joined: 21 Mar 2009 09:28
Owned TM-games: TMU, TMS
Manialink(s): djump
Location: Pforzheim (Germany)
Contact:

Clickable Commands

Post by david_jumper » 17 Nov 2009 16:04

Hi People!

I've got a question:
Is it possible to show clickable commands like /music list during the race at the screen? Maybe with a button or an image.
I don't want to show it in a menu or in /help. Just at the race-screen on the top... for example

Greetings from Germany!

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: Clickable Commands

Post by nouseforname » 17 Nov 2009 16:06

david_jumper wrote:Hi People!

I've got a question:
Is it possible to show clickable commands like /music list during the race at the screen? Maybe with a button or an image.
I don't want to show it in a menu or in /help. Just at the race-screen on the top... for example

Greetings from Germany!

all chat commands are able to be executed via a manialink button. see the menu^^

which one you want?
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
david_jumper
happy cruiser
happy cruiser
Posts: 140
Joined: 21 Mar 2009 09:28
Owned TM-games: TMU, TMS
Manialink(s): djump
Location: Pforzheim (Germany)
Contact:

Re: Clickable Commands

Post by david_jumper » 17 Nov 2009 17:37

I want to have /music list as a button on the screen. Maybe on the lower left side. A bit over the chat. How can I make it? Is it hard to do this?

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: Clickable Commands

Post by nouseforname » 17 Nov 2009 19:07

a short plugin for ya.

plugin.nouse.button.php:

Code: Select all

<?php

// Xaseco plugin to display single manialink button which execute one chatcommand
// by nouseforname

Aseco::registerEvent('onNewChallenge', 'nouseButtonOn');
Aseco::registerEvent('onPlayerConnect', 'nouseButtonOn');
Aseco::registerEvent('onEndRace', 'nouseButtonOff');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick');

global $chatcommand;
global $buttonmainposition;

// config
$chatcommand = '/music list';
$buttonmainposition = '-60 -30 1';



function nouseButtonOn($aseco) {
	global $buttonmainposition;
	$xml = '<manialink id="0815470000122">
		<format style="TextCardInfoSmall" textsize="1" />
		<frame posn="'.$buttonmainposition.'">
			<quad posn="0 0 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />
		<label posn="0 0.2 1" sizen="8 2" halign="center" valign="center" text="$i$s$fffGet List" action="27008505"/>
		</frame>
	</manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonOff($aseco) {
	$xml = '<manialink id="0815470000122">
	<frame posn="0 0 0">
		<quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008505" /> 
	</frame>
	</manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonHandleClick($aseco, $command) {
	global $chatcommand;
	$playerid = $command[0];
	$login = $command[1];
	$action = $command[2].'';
	
	if ($action == '27008505'){
		$chat = array();
		$chat[0] = $playerid;
		$chat[1] = $login;
		$chat[2] = $chatcommand;
		$chat[3] = true;
		$aseco->playerChat($chat);
	}
}

?>
that should do the job, if not try to read it




ps: the forum seems quite slowly since yesterday.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
david_jumper
happy cruiser
happy cruiser
Posts: 140
Joined: 21 Mar 2009 09:28
Owned TM-games: TMU, TMS
Manialink(s): djump
Location: Pforzheim (Germany)
Contact:

Re: Clickable Commands

Post by david_jumper » 17 Nov 2009 19:34

Thanks!! I will test it tomorrow... I can give feedback :D

User avatar
AR | MadMax
wheelbarrow operator
wheelbarrow operator
Posts: 23
Joined: 20 Sep 2009 03:04
Owned TM-games: TMUF/TMNF
Location: Texas,USA
Contact:

Re: Clickable Commands

Post by AR | MadMax » 17 Nov 2009 23:26

Tested it out and it works Great! :thumbsup: :thumbsup:

ok i was wondering how to get another manialink, so that i can use the same set up for tracks /list. i change the /music list to just /list and it work good too but it wont work together with the music one cause of the manialink. im a bit of a noob when it comes to the manialink. thanks bro. great work by the way. your the greatest! :1
Image
Image
Image
λμяैσяα»WarZone..0K-50K
λμяैσяα»ςρєєď..50K-80K
λμяैσяα»τєҫҥ-мΐηΐ..40K-80K

User avatar
Clinton
smooth traffic navigator
smooth traffic navigator
Posts: 241
Joined: 26 Jan 2008 20:56
Owned TM-games: TMU, TMN, TMO
Location: Dripping Springs, Texas
Contact:

Re: Clickable Commands

Post by Clinton » 18 Nov 2009 01:15

Without looking at the code really, I'd assume you just need to change the coordinates of the button location.
Image

http://allgamer.net cheapest Trackmania server hosting with the best support. We also do VPS hosting, Dedicated Servers, and Web Hosting! Request a free 3 day trial for a VPS

clinton@teameo.net for more information.

User avatar
AR | MadMax
wheelbarrow operator
wheelbarrow operator
Posts: 23
Joined: 20 Sep 2009 03:04
Owned TM-games: TMUF/TMNF
Location: Texas,USA
Contact:

Re: Clickable Commands

Post by AR | MadMax » 18 Nov 2009 04:16

yeah i have done that already, but it only works one or the other not both at the same time. thats why i thought it had something to do with the manialink.
Image
Image
Image
λμяैσяα»WarZone..0K-50K
λμяैσяα»ςρєєď..50K-80K
λμяैσяα»τєҫҥ-мΐηΐ..40K-80K

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: Clickable Commands

Post by nouseforname » 18 Nov 2009 05:00

if you want 2 buttons with different commands, you'll have to extend this plugin. it only works with one button and one command.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Clickable Commands

Post by Ant » 08 Jan 2010 23:00

Very nice, I use it for the /helpall command and named the button Server Help :thumbsup:
Last edited by Ant on 10 Jan 2010 01:08, edited 1 time in total.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Clickable Commands

Post by Ant » 10 Jan 2010 01:07

AR | MadMax wrote:Tested it out and it works Great! :thumbsup: :thumbsup:

ok i was wondering how to get another manialink, so that i can use the same set up for tracks /list. i change the /music list to just /list and it work good too but it wont work together with the music one cause of the manialink. im a bit of a noob when it comes to the manialink. thanks bro. great work by the way. your the greatest! :1
you can use fufi menu for /list by the way mate

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Clickable Commands

Post by Ant » 14 Jan 2010 03:40

Heres the plugin.nouse.button.php for what I use it for (Server Help) - anyone who doesn't know what to change so they can extend the plugin, please refer to This post and the others after it :thumbsup:

Code: Select all

<?php

// Xaseco plugin to display single manialink button which execute one chatcommand
// by nouseforname

Aseco::registerEvent('onNewChallenge', 'nouseButtonOn');
Aseco::registerEvent('onPlayerConnect', 'nouseButtonOn');
Aseco::registerEvent('onEndRace', 'nouseButtonOff');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick');

global $chatcommand;
global $buttonmainposition;

// config
$chatcommand = '/helpall';
$buttonmainposition = '58 -30 1';



function nouseButtonOn($aseco) {
   global $buttonmainposition;
   $xml = '<manialink id="0815470000122">
      <format style="TextCardInfoSmall" textsize="1" />
      <frame posn="'.$buttonmainposition.'">
         <quad posn="0 0 0" sizen="10 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />         
         <label posn="0 0.2 1" sizen="8 2" halign="center" valign="center" text="$fffServer Help" action="27008505"/>
      </frame>
   </manialink>';
   $aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonOff($aseco) {
   $xml = '<manialink id="0815470000122">
   <frame posn="0 0 0">
      <quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008505" />
   </frame>
   </manialink>';
   $aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonHandleClick($aseco, $command) {
   global $chatcommand;
   $playerid = $command[0];
   $login = $command[1];
   $action = $command[2].'';
   
   if ($action == '27008505'){
      $chat = array();
      $chat[0] = $playerid;
      $chat[1] = $login;
      $chat[2] = $chatcommand;
      $chat[3] = true;
      $aseco->playerChat($chat);
   }
}

?>
AR | MadMax wrote:Tested it out and it works Great! :thumbsup: :thumbsup:

ok i was wondering how to get another manialink, so that i can use the same set up for tracks /list. i change the /music list to just /list and it work good too but it wont work together with the music one cause of the manialink. im a bit of a noob when it comes to the manialink. thanks bro. great work by the way. your the greatest! :1
And here's a button for the track list that could go above that one (both plugins running at the same time) and could be called plugin.nouse.button1.php or something like that.

Code: Select all

<?php

// Xaseco plugin to display single manialink button which execute one chatcommand
// by nouseforname

Aseco::registerEvent('onNewChallenge', 'nouseButtonOn2');
Aseco::registerEvent('onPlayerConnect', 'nouseButtonOn2');
Aseco::registerEvent('onEndRace', 'nouseButtonOff2');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick2');

global $chatcommand2;
global $buttonmainposition2;

// config
$chatcommand2 = '/list';
$buttonmainposition2 = '58 -27.5 1';



function nouseButtonOn2($aseco2) {
   global $buttonmainposition2;
   $xml2 = '<manialink id="08154700001222">
      <format style="TextCardInfoSmall" textsize="1" />
      <frame posn="'.$buttonmainposition2.'">
         <quad posn="0 0 0" sizen="10 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />         
         <label posn="0 0.2 1" sizen="8 2" halign="center" valign="center" text="$fffTrack List" action="270085052"/>
      </frame>
   </manialink>';
   $aseco2->client->addCall('SendDisplayManialinkPage', array($xml2, 0, false));
}

function nouseButtonOff2($aseco2) {
   $xml2 = '<manialink id="08154700001222">
   <frame posn="0 0 0">
      <quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="270085052" />
   </frame>
   </manialink>';
   $aseco2->client->addCall('SendDisplayManialinkPage', array($xml2, 0, false));
}

function nouseButtonHandleClick2($aseco2, $command2) {
   global $chatcommand2;
   $playerid2 = $command2[0];
   $login2 = $command2[1];
   $action2 = $command2[2].'';
   
   if ($action2 == '270085052'){
      $chat2 = array();
      $chat2[0] = $playerid2;
      $chat2[1] = $login2;
      $chat2[2] = $chatcommand2;
      $chat2[3] = true;
      $aseco2->playerChat($chat2);
   }
}

?>
Both of these buttons are bottom right of the screen just above the chat window, 1 button above the other. With the code I have posted for both, the buttons will disappear on the score screen. If you want to change this, edit line 8 in both from

Code: Select all

Aseco::registerEvent('onEndRace', 'nouseButtonOff');
to

Code: Select all

Aseco::registerEvent('onEndRace', 'nouseButtonOn');
Hope this is of any use - Nice work nouseforname :1

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Re: Clickable Commands

Post by jouko100 » 31 Jan 2010 14:52

nouseforname wrote:a short plugin for ya.

plugin.nouse.button.php:

Code: Select all

<?php

// Xaseco plugin to display single manialink button which execute one chatcommand
// by nouseforname

Aseco::registerEvent('onNewChallenge', 'nouseButtonOn');
Aseco::registerEvent('onPlayerConnect', 'nouseButtonOn');
Aseco::registerEvent('onEndRace', 'nouseButtonOff');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'nouseButtonHandleClick');

global $chatcommand;
global $buttonmainposition;

// config
$chatcommand = '/music list';
$buttonmainposition = '-60 -30 1';


function nouseButtonOn($aseco) {
	global $buttonmainposition;
	$xml = '<manialink id="0815470000122">
		<format style="TextCardInfoSmall" textsize="1" />
		<frame posn="'.$buttonmainposition.'">
			<quad posn="0 0 0" sizen="8 2.5"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButton"  />
		<label posn="0 0.2 1" sizen="8 2" halign="center" valign="center" text="$i$s$fffGet List" action="27008505"/>
		</frame>
	</manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonOff($aseco) {
	$xml = '<manialink id="0815470000122">
	<frame posn="0 0 0">
		<quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="27008505" /> 
	</frame>
	</manialink>';
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml, 0, false));
}

function nouseButtonHandleClick($aseco, $command) {
	global $chatcommand;
	$playerid = $command[0];
	$login = $command[1];
	$action = $command[2].'';
	
	if ($action == '27008505'){
		$chat = array();
		$chat[0] = $playerid;
		$chat[1] = $login;
		$chat[2] = $chatcommand;
		$chat[3] = true;
		$aseco->playerChat($chat);
	}
}

?>
that should do the job, if not try to read it

ps: the forum seems quite slowly since yesterday.
if i like to make another button.What i have to change.Maybe manialink id number and action number but where to get rights ones.And maybe something more.

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Clickable Commands

Post by nocturne » 31 Jan 2010 16:36

There's no reason to create a second plugin... just edit the xml to add a new button with a different action number, and edit the onPlayerManialinkPageAnswer function to handle both events.

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Re: Clickable Commands

Post by jouko100 » 01 Feb 2010 03:22

nocturne wrote:There's no reason to create a second plugin... just edit the xml to add a new button with a different action number, and edit the onPlayerManialinkPageAnswer function to handle both events.
Thx it works .i am now making user panel plugin.(panel beside admin panel for all users)People can see it in my server Vhserver in FIN

Post Reply