I'm new to eXpansion and i would have to learn a lot of things to create a new Plugin...
Perhaps someone of you feels boring enough to help me...
All i want is a Chat Command if the User use it he will get a reply but it has to be a private message .
Search someone helping me write a new Plugin
Moderators: reaby, oliverde8, NADEO
Re: Search someone helping me write a new Plugin
Hi,
there is a few tutorials written here for plugin making : https://github.com/eXpansionPluginPack/ ... developers
I do recommend you to use an ide such as netbeans/phpstorm you should have auto completion nearly everywhere which should make your task easier.
You can also use Manialive tutorials to understand a few things. Our tutorials where written but I never tested the code in them. Feel free to ask any question and good look with the devs
there is a few tutorials written here for plugin making : https://github.com/eXpansionPluginPack/ ... developers
I do recommend you to use an ide such as netbeans/phpstorm you should have auto completion nearly everywhere which should make your task easier.
You can also use Manialive tutorials to understand a few things. Our tutorials where written but I never tested the code in them. Feel free to ask any question and good look with the devs
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
- w1lla
- Posts: 2396
- Joined: 15 Jun 2010, 11:09
- Manialink: maniaplanetblog
- Location: Netherlands
- Contact:
Re: Search someone helping me write a new Plugin
For manialive it can be done like this:
This can be done in ManiaLive, for eXpansion its a bit different but it might work in combination with both i believe.
In config.ini write following:
Code: Select all
<?php
namespace ManiaLivePlugins\UserTest\UserTest;
use ManiaLive\Data\Storage;
use ManiaLive\Utilities\Console;
class UserTest extends \ManiaLive\PluginHandler\Plugin {
function onInit() {
}
function onLoad() {
$cmd = $this->registerChatCommand('pmme', 'pmme', 0, false);
$cmd->help = 'PM Myself';
}
function pmme($login) {
$this->connection->chatSendServerMessage('$fff» $fa0Welcome, You got a PM Message!', $login);
}
}
?>
In config.ini write following:
Code: Select all
manialive.plugins[] = '\ManiaLivePlugins\UserTest\UserTest'
TM² Info
SM Info
QM Info
OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
SM Info
QM Info
OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
Re: Search someone helping me write a new Plugin
[quote="w1lla"][/quote]
This would work in eXpansion but without autoload and i18n and other eXpansion specific stuff.
Equivalent of this for eXpansion would be :
and plus you need to define and MetaData file as explained in the first tutorial
This would work in eXpansion but without autoload and i18n and other eXpansion specific stuff.
Equivalent of this for eXpansion would be :
Code: Select all
<?php
namespace ManiaLivePlugins\UserTest\UserTest;
use ManiaLive\Data\Storage;
use ManiaLive\Utilities\Console;
class UserTest extends ManiaLivePlugins\eXpansion\Core\types\BasicPlugin {
function exp_onInit() {
}
function exp_onLoad() {
$cmd = $this->registerChatCommand('pmme', 'pmme', 0, false);
$cmd->help = 'PM Myself';
}
function pmme($login) {
$this->exp_chatSendServerMessage('$fff» $fa0Welcome, You got a PM Message!', $login);
}
}
?>
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
- w1lla
- Posts: 2396
- Joined: 15 Jun 2010, 11:09
- Manialink: maniaplanetblog
- Location: Netherlands
- Contact:
Re: Search someone helping me write a new Plugin
Correct. But i did it only basic manialive way tutorial ^^.
TM² Info
SM Info
QM Info
OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
SM Info
QM Info
OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
Re: Search someone helping me write a new Plugin
This isn't working^^oliverde8 wrote:Code: Select all
function pmme($login) { $this->exp_chatSendServerMessage('$fff» $fa0Welcome, You got a PM Message!', $login); }
Do i not need to set this Part to true??? In all other Plugins it is -1 and true not 0 and false... 0 false isn't working. 0 ture is working
Code: Select all
function exp_onLoad() {
$cmd = $this->registerChatCommand('pmme', 'pmme', 0, true);
$cmd->help = 'PM Myself';
}
Re: Search someone helping me write a new Plugin
hi, can you post all your plugin as you test it. And have you activated the plugin?
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Re: Search someone helping me write a new Plugin
Code: Select all
<?php
namespace ManiaLivePlugins\eXpansion\Invite;
use ManiaLive\Data\Storage;
use ManiaLive\Utilities\Console;
class Invite extends \ManiaLivePlugins\eXpansion\Core\types\BasicPlugin {
function exp_onInit() {
}
public function exp_onLoad() {
$cmd = $this->registerChatCommand('invite', 'invite', 0, true);
$cmd->help = 'PM Myself';
}
function invite($login) {
$zahl = mt_rand();
$this->exp_chatSendServerMessage('$fff» $fa0Welcome your Login is your Accountname and your Password is, ' . $zahl . '' , $login);
}
}
?>
This was just a smal test and i just want to inform you that your "false" hint was make me crazy for a long time, but then i had have a look into other Plugins and all the registerChatCommands are true there for example your Quiz.php$cmd = $this->registerChatCommand('pmme', 'pmme', 0, false);
So i also do it and sinsce then my testplugin is working. But what means the 0 and -1? "ask" and "kysy" are -1 and all other 0....$command = $this->registerChatCommand("ask", "ask", -1, true);
$command = $this->registerChatCommand("kysy", "ask", -1, true);
$command = $this->registerChatCommand("points", "showPointsWindow", 0, true);
$command = $this->registerChatCommand("pisteet", "showPointsWindow", 0, true);
$command = $this->registerChatCommand("tilanne", "showPoints", 0, true);
$command = $this->registerChatCommand("point", "addPointsWindow", 0, true);
$command = $this->registerChatCommand("piste", "addPointsWindow", 0, true);
$command = $this->registerChatCommand("cancel", "cancel", 0, true);
$command = $this->registerChatCommand("peruuta", "cancel", 0, true);
$command = $this->registerChatCommand("answer", "showAnswer", 0, true);
$command = $this->registerChatCommand("vastaus", "showAnswer", 0, true);
$command = $this->registerChatCommand("question", "showQuestion", 0, true);
$command = $this->registerChatCommand("kysymys", "showQuestion", 0, true);
$command = $this->registerChatCommand("reset", "reset", 0, true);
$command = $this->registerChatCommand("nollaa", "reset", 0, true);
Re: Search someone helping me write a new Plugin
Well if you use an idea it will tell you which parameters is what,
For register chat Command :
1 name of the command
2 method to call
3 number of parameters required, 0 means none - 1 infinite
4 should the login of the user of the cmd be sent as a parameter to themethod
For register chat Command :
1 name of the command
2 method to call
3 number of parameters required, 0 means none - 1 infinite
4 should the login of the user of the cmd be sent as a parameter to themethod
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Who is online
Users browsing this forum: No registered users and 1 guest