Code: Select all
if (strtolower($smart->settings['plugin.adwords']->enabled) != 'true') {
Code: Select all
$smart->loadsettings('plugin.yourchat.xml','plugin.yourchat');
Code: Select all
if (strtolower($smart->settings['plugin.adwords']->enabled) != 'true') {
Code: Select all
$smart->loadsettings('plugin.yourchat.xml','plugin.yourchat');
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);
}
}
?>
Those are just notices, not errors, you do not have to pay attention at notices.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
Users browsing this forum: No registered users and 0 guests