Page 1 of 4

ASECO2.x Plugin | Player join/leave message on chat

Posted: 05 May 2008 19:19
by daemon
For: ASECO2.x
Description: Reports on chat when a player joins or leaves the server; it also displays the player's nation(zone), ladder rank, and local rank.
New Features: It now displays if the player is an admin, and also incorporated J-S's ranks fix.

Thanks to Assembler Maniac, Mistral and Xymph, I took bits and pieces of RASP, Mistral ASECO and XASECO to create this monster. :lol: I hope they don't mind.

Some examples of what it should display on chat:

Code: Select all

daemon[Admin] from Mexico connected [WR: 30 123 | Local Rank: 13/37]

daemon from Mexico connected [WR: 30 123 | Local Rank: 13/37]

daemon from Germany|Bavaria|Munich connected [WR: 30 123 | Local Rank: 13/37]

daemon from Mexico connected [WR: NA | Local Rank: NA]

daemon disconnected
Download (rar contains 2 versions, display country/display full zone):
http://www.fileden.com/files/2008/4/22/ ... lugins.rar

:thumbsup:

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 19:30
by xOr
I'll give it a try right away....

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 20:41
by oliverde8
Works Great :thumbsup:

Thanks a lot

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 21:55
by k4nm4n
I get thsi error:

Fatal error: Class 'Plugin' not found in C:\Documents and Settings\P
p\usbTMN_v1.91\Tmn\aseco1\plugins\plugin.joinleavemod.php on line 3

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 22:41
by cdrw700
Thanks a lot, it works great !!

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 22:51
by f*ckfish
k4nm4n wrote:I get thsi error:

Fatal error: Class 'Plugin' not found in C:\Documents and Settings\P
p\usbTMN_v1.91\Tmn\aseco1\plugins\plugin.joinleavemod.php on line 3
Do you maybe use XASECO or Mistral or something else? This plugin is ASECO 2.x only I guess.

Re: ASECO Plugin | Player join/leave message on chat

Posted: 05 May 2008 23:13
by k4nm4n
I tested on Mistral Aseco, but I changed my mind and I'm runing XASECO without fansy buttons and popup windows and you'r widgets. :( But it have more functions like add operator and so on. :thumbsup:
You will adjust widgets for Xaseco?

Re: ASECO Plugin | Player join/leave message on chat

Posted: 06 May 2008 08:27
by f*ckfish
nah, no offtopic here ;-) look there: viewtopic.php?f=28&t=14464&st=0&sk=t&sd ... 60#p112338
Btw. you don't need this plugin for XASECO since it has something similar already integrated (I think it's in JFreu lite plugin)

Re: ASECO Plugin | Player join/leave message on chat

Posted: 06 May 2008 08:50
by Xymph
f*ckfish wrote:Btw. you don't need this plugin for XASECO since it has something similar already integrated (I think it's in JFreu lite plugin)
Correct, both lite and full Jfreu plugins in XASECO already provide player join/leave messages.

Re: ASECO Plugin | Player join/leave message on chat

Posted: 06 May 2008 16:10
by cow
can we somehow get people to start putting the version of aseco their plugins are for in the title.
aseco2
xaseco
mistral

Re: ASECO2 Plugin | Player join/leave message on chat

Posted: 06 May 2008 16:55
by daemon
ASECO was the only one missing this feat, also the title said ASECO, not XASECO or anything, but its changed now. :thumbsup:

Re: ASECO2 Plugin | Player join/leave message on chat

Posted: 06 May 2008 20:50
by xis101
thanks for this plugin. is it possible to get a more detailed info about the zone?

I mean, can you display for example "from country/region/city"? :)

Re: ASECO2 Plugin | Player join/leave message on chat

Posted: 06 May 2008 21:05
by w1lla

Code: Select all

<?php
/*
orginal code by daemon
edited by w1lla for xaseco.
*/
Aseco::registerEvent('onPlayerConnect', 'pconnect');
Aseco::registerEvent('onPlayerDisconnect', 'pdisconnect');


	function pconnect($aseco, $player)
	{
	global $rasp, $feature_ranks;
	
		$aseco->client->query('GetDetailedPlayerInfo', $target->login);
		$info = $aseco->client->getResponse();
		$rank = $info['LadderStats']['PlayerRankings'][0]['Ranking'];
		$score = $info['LadderStats']['PlayerRankings'][0]['Score'];
		$path = $GetPlayerInfo['Path'];
		$country=$player->nation;
		$pos = strpos($zone, '|');
		if ($pos == false) {
			$zone = $zone; 
		}
		else {
			$zone = substr($zone, 0, $pos);	
		}
		$srank = $GetPlayerInfo['LadderStats']['PlayerRankings']['0']['Ranking'];
		$rank = str_replace(' ', '$n $m', number_format($player->ladderrank, 0, ' ', ' '));
		$message = stripColors($player->nickname).$player.' $39ffrom $fff'.$country.' $39fconnected [World Rank: $fff'.$rank.' $39f| '.$rasp.''.$rasp.'';
		if ($feature_ranks) {
		$message .= $white.'Local Rank: $fff'.$rasp->getRank($player->login);
	}
		$aseco->client->query('ChatSendServerMessage', $message);
		
	}  

	function pdisconnect($aseco, $player)
	{
	global $rasp, $feature_ranks;
		$message = stripColors($player->nickname).' $39fdisconnected';
		$aseco->client->query('ChatSendServerMessage', $message);
	}  

	function showRank($login) {
		global $minrank;

		$pid = $aseco->getPlayerId($login);
		$query = 'SELECT avg FROM rs_rank
		          WHERE playerID=' . $pid;
		$res = mysql_query($query);
		if (mysql_num_rows($res) > 0) {
			$row = mysql_fetch_array($res);
			$query2 = 'SELECT playerid FROM rs_rank ORDER BY avg ASC';
			$res2 = mysql_query($query2);
			$rank = 1;
			while ($row2 = mysql_fetch_array($res2)) {
				if ($row2['playerid'] == $pid) break;
				$rank++;
			}
			$message = formatText($aseco->messages['RANK'][0],
			                      $rank, mysql_num_rows($res2),
			                      sprintf("%4.1F", $row['avg'] / 10000));
			$message = $aseco->formatColors($message);
			$aseco->client->query('ChatSendServerMessageToLogin', $message, $login);
			mysql_free_result($res2);
		} else {
			$message = formatText($aseco->messages['RANK_NONE'][0], $minrank);
			$message = $aseco->formatColors($message);
			$aseco->client->query('ChatSendServerMessageToLogin', $message, $login);
		}
		mysql_free_result($res);
		}
?>
this piece of code is only for xaseco.

edited by yours truly,

Re: ASECO2 Plugin | Player join/leave message on chat

Posted: 06 May 2008 21:36
by Xymph
w1lla wrote:this piece of code is only for xaseco.
Uhm, why? :roll: XAseco already has this included in the lite and full Jfreu plugins. It's the other Aseco variants that didn't have this feature yet.

Re: ASECO2 Plugin | Player join/leave message on chat

Posted: 06 May 2008 21:38
by w1lla
well i just wanted to help but i do miss 1 thing in your plugin a zone feature