[PLUGIN] YourChat 1.3

Moderators: vni, NADEO

User avatar
askuri
Posts: 285
Joined: 18 Oct 2011, 15:01
Location: Germany

Re: [PLUGIN] YourChat 1.0

Post by askuri »

Uploaded. Just changed line 25:

Code: Select all

if (strtolower($smart->settings['plugin.adwords']->enabled) != 'true') {
into

Code: Select all

$smart->loadsettings('plugin.yourchat.xml','plugin.yourchat');
Note that Vni has to review the update
Bladinium
Posts: 110
Joined: 07 Sep 2012, 14:35

Re: [PLUGIN] YourChat 1.0

Post by Bladinium »

Code: Select all

<?php
/******************************************************************
* YOURCHAT PLUGIN                                                  *
* by Askuri                                                       *
* enwi2@t-online.de                                               *
*                                                                 *
* LICENSE:                                                        *
* Creative Commons License                                        *
* - Attribution                                                   *
* - No commercial use without explicit permission                 *
* - Share alike                                                   *
* - For more information read on below                            *
*                                                                 *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of  *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.            *
******************************************************************/

$this->register_plugin('YOURCHAT', 'YourChat', '1.0');
$this->register_event('onInit','plugin_yourchat_init');

function plugin_yourchat_init($smart, $data) {
	$smart->loadsettings('plugin.yourchat.xml','plugin.yourchat');
	
	$smart->loadsettings('plugin.yourchat.xml','plugin.yourchat'); {
		$smart->connection->client->query('ChatEnableManualRouting', false, false);
		return;
	}
	$smart->connection->client->query('ChatEnableManualRouting', true, false);	
	$smart->register_event('PlayerChat','plugin_yourchat_player_chat');
}

function plugin_yourchat_player_chat($smart, $data) {
	if ($smart->serverdetails['Login'] != $data[1]) {
		if(in_array($data[1], $smart->connected_superadmins))	$permissions = 'SuperAdmin';
		if(in_array($data[1], $smart->connected_admins))		$permissions = 'Admin';
		if(in_array($data[1], $smart->connected_operators))		$permissions = 'Operator';
		
		$message = strval($smart->settings['plugin.yourchat']->custom_format);
		
		$message = str_replace('{time_24_s}', date("H:i.s"), $message);
		$message = str_replace('{time_24}', date("H:i"), $message);
		$message = str_replace('{time_12_s}', date("h:i.s"), $message);
		$message = str_replace('{time_12}', date("h:i"), $message);
		$message = str_replace('{a}', date("a"), $message);
		$message = str_replace('{A}', date("A"), $message);
		$message = str_replace('{nick}', $smart->players[$data[1]]['data']['nickname'], $message);
		$message = str_replace('{message}', $data[2], $message);
		$message = str_replace('{permissions}', $data[2], $permissions);
		
		$smart->chat($message, false, true);
		
	}
}

?>
I have no errors in the log, however it still does not work.

Thank you for your support :)
User avatar
insomnia-yamyam
Posts: 324
Joined: 05 Sep 2011, 04:59
Contact:

Re: [PLUGIN] YourChat 1.0

Post by insomnia-yamyam »

Bladinium wrote:

Code: Select all

[10:17] Parsing Configuration File plugin.yourchat.xml
PHP Notice:  Undefined index: plugin.adwords in /TMSTUNTTEST/smart/smart/plugins/plugin.yourchat.php on line 25
PHP Notice:  Trying to get property of non-object in /TMSTUNTTEST/smart/smart/plugins/plugin.yourchat.php on line 25
Those are just notices, not errors, you do not have to pay attention at notices. :D
GermanINSOMNIAClan!
Multigaming Fun-Clan since 1998!
» www.I-N-S-O-M-N-I-A.de «

Visit our TM2 and SM Clanserver or download the INSOMNIA TM2-Trackpack or SM-Mappack !
You also find us at both Mania-Exchanges - search "German INSOMNIA Clan"
Bladinium
Posts: 110
Joined: 07 Sep 2012, 14:35

Re: [PLUGIN] YourChat 1.0

Post by Bladinium »

!Yes I know, it's just the information I log in about plugins.

Unfortunately it does not work :'(

I try somehow modify it to suit Smart to my needs, unfortunately it is not obvious ^ ^
User avatar
askuri
Posts: 285
Joined: 18 Oct 2011, 15:01
Location: Germany

Re: [PLUGIN] YourChat 1.0

Post by askuri »

Which notices you get now? The same? They first should be away with the update. Thanks for reporting this, it loaded the config into the wrong Namespace :D
Bladinium
Posts: 110
Joined: 07 Sep 2012, 14:35

Re: [PLUGIN] YourChat 1.1

Post by Bladinium »

I have no notes in the log :/
User avatar
askuri
Posts: 285
Joined: 18 Oct 2011, 15:01
Location: Germany

Re: [PLUGIN] YourChat 1.1

Post by askuri »

What happens when writing something in the chat and what when writing an AdWord in the chat?
More informations please
User avatar
askuri
Posts: 285
Joined: 18 Oct 2011, 15:01
Location: Germany

Re: [PLUGIN] YourChat 1.2

Post by askuri »

Update 1.2 uploaded, waiting for review by vni
Downloadand changelog in startpost
User avatar
vni
Posts: 221
Joined: 02 Oct 2011, 09:56

Re: [PLUGIN] YourChat 1.2

Post by vni »

/repo updated
SMART - The smarter Servertool for Shootmania
Download SMART at http://smarttool.org
Changelog: here
Frequently Asked Questions: here

IRC: #smart @ QuakeNet (WebChat)
Bladinium
Posts: 110
Joined: 07 Sep 2012, 14:35

Re: [PLUGIN] YourChat 1.2

Post by Bladinium »

Yop, very thx, problem fixed ;)
Post Reply

Return to “SMART Servercontroller”

Who is online

Users browsing this forum: No registered users and 0 guests