Aseco/rasp 0.8 simple plugin request

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

Moderators: Xymph, TM-Patrol

Post Reply
User avatar
blooper
happy cruiser
happy cruiser
Posts: 144
Joined: 11 Oct 2007 23:47
Owned TM-games: TMUF
Location: Minnesota, USA

Aseco/rasp 0.8 simple plugin request

Post by blooper » 11 Oct 2007 23:59

Hello,
Can someone make a plugin that makes a message box pop up with information on how to join my team when someone enters the command /joinbt? I tried to but I can't figure out how to do it. All i need is the window to appear and I can fill in the text from there.

Thanks

Xymph
Pit Crew
Pit Crew
Posts: 5701
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Aseco/rasp 0.8 simple plugin request

Post by Xymph » 12 Oct 2007 10:45

Try something like this:

Code: Select all

<?php
/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */

/**
 * Chat plugin.
 * Displays join team info
 * Created by Xymph
 */

Aseco::addChatCommand('jointeam', 'Displays info about joining a team');

function chat_jointeam(&$aseco, &$command) {

        $player = $command['author'];

        // showing info for TMN
        if ($aseco->server->getGame() == 'TMN') {
                $msg = 'bla bla about joining this team' . LF;
                $msg .= 'more bla bla';
                $aseco->addCall('SendDisplayServerMessageToLogin', array($player->login, $aseco->formatColors($msg), 'OK', '', 0));
        } else {
                $msg = '{#server}> bla bla about joining this team' . LF;
                $msg .= 'more bla bla';
                $aseco->addCall('ChatSendServerMessageToLogin', array($aseco->formatColors($msg), $player->login));
        }
}
?>
Xymph
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

m&o
happy cruiser
happy cruiser
Posts: 188
Joined: 19 Apr 2007 17:53
Owned TM-games: TMN, TMU, TMF

Re: Aseco/rasp 0.8 simple plugin request

Post by m&o » 12 Oct 2007 14:09

why are u using the long way its easyr to just use this becase he is gone use it for tmn u don't have to check again if it is for tmn

Code: Select all

<?php
/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */

Aseco::addChatCommand('jointeam', 'Displays info about joining a team');

function chat_jointeam(&$aseco, &$command) {

        $player = $command['author'];

                $msg = '{#server}> bla bla about joining this team' . LF;
                $msg .= 'more bla bla';
                $aseco->addCall('ChatSendServerMessageToLogin', array($aseco->formatColors($msg), $player->login));
        }
}
?>
Image

Xymph
Pit Crew
Pit Crew
Posts: 5701
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Aseco/rasp 0.8 simple plugin request

Post by Xymph » 12 Oct 2007 15:06

m&o wrote:why are u using the long way its easyr to just use this becase he is gone use it for tmn u don't have to check again if it is for tmn
Just because he might use it only for TMN doesn't mean anyone else reading this wouldn't want to use it on TMO/TMS. That's too narrow-minded. :roll: :wink: It was easy to write it as a general plugin that works for all of them, just like many other commands in v0.8, so that's what I did.

Besides, blooper asked for a pop-up, and you deleted the wrong part of my code (and forgot to delete one '}' so there's a syntax error too), so he would get a chat message instead if he uses your version. :P

Xymph
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

m&o
happy cruiser
happy cruiser
Posts: 188
Joined: 19 Apr 2007 17:53
Owned TM-games: TMN, TMU, TMF

Re: Aseco/rasp 0.8 simple plugin request

Post by m&o » 12 Oct 2007 15:27

Xymph wrote:
m&o wrote:why are u using the long way its easyr to just use this becase he is gone use it for tmn u don't have to check again if it is for tmn
Just because he might use it only for TMN doesn't mean anyone else reading this wouldn't want to use it on TMO/TMS. That's too narrow-minded. :roll: :wink: It was easy to write it as a general plugin that works for all of them, just like many other commands in v0.8, so that's what I did.

Besides, blooper asked for a pop-up, and you deleted the wrong part of my code (and forgot to delete one '}' so there's a syntax error too), so he would get a chat message instead if he uses your version. :P

Xymph

lol yhe litle mistake din't look to good at the code I did just did fast deleting parts of your code in this window and its prety hard becase window is to smal for long sentences and now we are talking about it why u use this sentence:

Code: Select all

/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */
?
Image

Xymph
Pit Crew
Pit Crew
Posts: 5701
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Aseco/rasp 0.8 simple plugin request

Post by Xymph » 12 Oct 2007 16:06

m&o wrote:and now we are talking about it why u use this sentence:

Code: Select all

/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */
?
In the vi (vim) editor that causes all tabs to be displayed with an indent of 2 positions. It just makes formatting and reading the code easier for me. If you're not using that editor, you'll see the tabs displayed with 8 positions as usual.

Xymph
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
blooper
happy cruiser
happy cruiser
Posts: 144
Joined: 11 Oct 2007 23:47
Owned TM-games: TMUF
Location: Minnesota, USA

Re: Aseco/rasp 0.8 simple plugin request

Post by blooper » 13 Oct 2007 01:29

Ok, thanks Xymph. :D

cow
smooth traffic navigator
smooth traffic navigator
Posts: 216
Joined: 20 Mar 2007 02:53
Owned TM-games: TMU, TMS, TMO
Contact:

Re: Aseco/rasp 0.8 simple plugin request

Post by cow » 13 Oct 2007 19:46

what i do.. i use the chat bot to answer almost any noob question i can think of.. and team info and such

Code: Select all

} elseif (stristr($command[2], 'join')&& stristr($command[2], 'tet19')) {
$message = '$FF0[Andy$FF0]$9f0]$9f0 $9f0 If you want to join tet19 send an email to our dinh, dinh@.tet19com';
$aseco->addCall('ChatSendServerMessage', array($message));
not real email above ;)
but anyway when people say how do i join tet19 or can i join tet19 or i want to join tet19 or w/e
the bot tells them how. you can misun out "would you" and wanna, so the bot doesnt respond when you say "wanna join tet19?"

i may release my help section as a help bot as it is very staicfying watchign it answer the noobs and prevent 16 lines of can you see my car before someone answers that they cant.
join me at the music tower
Tet19's MusicTower

Post Reply