• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction (6.1) Cyber's REPSystem w/Opinion Points for 0.4 && mAAC

Is this the best reputation system?

  • Yes.

    Votes: 131 66.2%
  • No.

    Votes: 30 15.2%
  • It's good but can be improved.

    Votes: 37 18.7%

  • Total voters
    198
  • Poll closed .
Status
Not open for further replies.
cus then i have to update all the scripts and sometimes the server doesnt work =/
 
new version, without modernacc :(~~

Incoming 5.1 Update
-Fix of rep.formatNum, since it has a small bug.
-C++ customization for the OnLook Script
-Translation of the system in spanish and portuguese.
-No more longer support or update for LUA version, all future updates will be for MOD.
-A player who kills another in his same IP(account) won't receive/lose rep for killing.
-Changes in the way the players can rep via command. Now players will have "Opinion Points" to repute other players, they gain them the time they stay online, which is 3 hours each point(if they logout it won't reset, will continue when they log in again). When a player gets 5 or more Opinion Points, he will be able to rep and will lose 5 opinion points. So, a player can store many Opinion Points to repute many times(takes a lot of time online though).
-New Feature: Rep Cooldown, to avoid a player from being reputed many times a day.
-Support for ModernAAC. Finally the PHP code will be compatible with the new and best AAC.
-Other fixes or updates I might include.
you guys must read recent posts^_^
thanks for the twenty thousand views^_^
 
Last edited:
opinion feature:
prevf.jpg


new config preview:
Lua:
        --[[ CONFIG ]]--
        interval = 180, --This is [3] hours, in minutes. Time to be online to gain [1] Opinion Point.
        minLevel = 20, --From this level onwards player can use commands
        pvpLevel = 30, --Minimum level for PVP Rep'ing
        counts = 10, --Limit for players for getting reputation "X" times a day
        required = 5, --Points required to add or remove reputation
        --[[ STORAGES ]]--
        update = 9235, --Global Storage used to verify database at server startup
        lastTime = 5035, --Used to store the player's last Rep Timestamp
        lastName = 5036, --Used to store the last repped's GUID
        lastKilled = 5037, --Used to store the last killed's GUID
        opinion = 5038, --Used to store the opinion points
        online = 5039, --Used to store online minutes
        limit = 5040, --Used for Rep Cooldown
 
Well just when I finish those wide rep stripes for ModernAAC I release, it's the last thing to do
Both PHP and MOD scripts are really better ;)
98074765.jpg
 
Last edited:
new sshoot
aviarylocalhostpicture1.png
 
Last edited:
That looks really nice ;) Maybe when I will include LUA scripts into Modern AAC, I will put it by default ;)
 
when I release I do
they're made by Diviinoo
 
hmm nice ;D tanks ..
hey man .. i got one problem when i start server using mod ..
u using mod and when start server= crash ..
how i can fix it ? please post here tanks again .!
 
maybe you copypasted it badly
so far it has worked fine to me at 0.3.6
 
.....

nf1zpf.jpg


Here is me rep.php
PHP:
<?PHP
//Cyber's REPutation System
$main_content .= '
<style type="text/css">tr.over:hover {background-color: '.$config['site']['darkborder'].';;}</style>
<style type="text/css"><White{color:white}}></style>';

$main_content .= '
<center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% style="background-color: #9C084A">
<TR align="center">
   <TD bgcolor="#632423"><img src="images/rep/po.gif"/></TD>
   <TD bgcolor="#943634"><img src="images/rep/evil.gif"/></TD>
   <TD bgcolor="#c0504d"><img src="images/rep/slayer.gif"/></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#f2eff5"></TD>
   <TD bgcolor="#4bacc6"><img src="images/rep/acclaimed.gif"/></TD>
   <TD bgcolor="#31849b"><img src="images/rep/hero.gif"/></TD>
   <TD bgcolor="#215868"><img src="images/rep/legend.gif"/></TD>
</TR>
<TR align="center">
   <TD BGCOLOR="#632423"><span class="White" style="font-weight:bold;">P.O.</span></TD>
   <TD BGCOLOR="#943634"><span class="White" style="font-weight:bold;">Evil</span></TD>
   <TD BGCOLOR="#c0504d"><span class="White" style="font-weight:bold;">Slayer</span></TD>
   <TD BGCOLOR="#d99594"><span style="font-weight:bold;">Killer</span></TD>
   <TD BGCOLOR="#e5b8b7"><span style="font-weight:bold;">Villain</span></TD>
   <TD BGCOLOR="#f2dbdb"><span style="font-weight:bold;">Creeping</span></TD>
   <TD BGCOLOR="#f2eff5"><span style="font-weight:bold;">Unknown</span></TD>
   <TD BGCOLOR="#daeef3"><span style="font-weight:bold;">Avowed</span></TD>
   <TD BGCOLOR="#b6dde8"><span style="font-weight:bold;">Popular</span></TD>
   <TD BGCOLOR="#92cddc"><span style="font-weight:bold;">Hailed</span></TD>
   <TD BGCOLOR="#4bacc6"><span class="White" style="font-weight:bold;">Acclaimed</span></TD>
   <TD BGCOLOR="#31849b"><span class="White" style="font-weight:bold;">Hero</span></TD>
   <TD BGCOLOR="#215868"><span class="White" style="font-weight:bold;">Legend</span></TD>
</TR>
<TR align="center">
   <TD BGCOLOR="#632423"><span class="White">-5000</span></TD>
   <TD BGCOLOR="#943634"><span class="White">-2000</span></TD>
   <TD BGCOLOR="#c0504d"><span class="White">-1500</span></TD>
   <TD BGCOLOR="#d99594">-1000</TD>
   <TD BGCOLOR="#e5b8b7">-500</TD>
   <TD BGCOLOR="#f2dbdb">-300</TD>
   <TD BGCOLOR="#f2eff5">0</TD>
   <TD BGCOLOR="#daeef3">300</TD>
   <TD BGCOLOR="#b6dde8">500</TD>
   <TD BGCOLOR="#92cddc">1000</TD>
   <TD BGCOLOR="#4bacc6"><span class="White">1500</span></TD>
   <TD BGCOLOR="#31849b"><span class="White">2000</span></TD>
   <TD BGCOLOR="#215868"><span class="White">5000</span></TD>
</TR>
<TR align="center">
   <TD BGCOLOR="#632423"><span class="White">10</span></TD>
   <TD BGCOLOR="#943634"><span class="White">8</span></TD>
   <TD BGCOLOR="#c0504d"><span class="White">6</span></TD>
   <TD BGCOLOR="#d99594">5</TD>
   <TD BGCOLOR="#e5b8b7">4</TD>
   <TD BGCOLOR="#f2dbdb">3</TD>
   <TD BGCOLOR="#f2eff5">2</TD>
   <TD BGCOLOR="#daeef3">3</TD>
   <TD BGCOLOR="#b6dde8">4</TD>
   <TD BGCOLOR="#92cddc">5</TD>
   <TD BGCOLOR="#4bacc6"><span class="White">6</span></TD>
   <TD BGCOLOR="#31849b"><span class="White">8</span></TD>
   <TD BGCOLOR="#215868"><span class="White">10</span></TD>
</TR>
</TABLE></center>';

	$rep_pos = $SQL->query('SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep >= 0 AND id > 6 AND group_id < 2 ORDER BY rep DESC LIMIT 15;');
	$rep_neg = $SQL->query('SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep < 0 AND id > 6 AND group_id < 2 ORDER BY rep ASC LIMIT 15;');
	$rep_pos2 = $SQL->query('SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep >= 0 AND id > 6 AND group_id < 2 AND id> 6 ORDER BY rep DESC LIMIT 15;');
	$rep_neg2 = $SQL->query('SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep < 0 AND id > 6 AND group_id < 2 ORDER BY rep ASC LIMIT 15;');
	
	$players_pos = 0;
	$players_neg = 0;
	
	foreach($rep_pos2 as $posplayer)
	{
		$players_pos++;
	}
	
	foreach($rep_neg2 as $negplayer)
	{
		$players_neg++;
	}
	
	$i = 0;
	foreach($rep_pos as $player) {
		$i++;
		$bgcolor = $config['site']['darkborder'];
		$bgcolor = $config['site']['lightborder'];
		$rank = reputation($player['rep']);
		
		$players_rows .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% STYLE="border: 1px solid #000;'.($i != $players_pos ? 'border-bottom: none;' : null).'"><TR BGCOLOR='.$bgcolor.' CLASS="over">
		<TD WIDTH="44%"><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">&nbsp;'.$player['name'].$rs.$bs.'</A></TD>
		<TD WIDTH="20%" STYLE="border-left: 1px solid #000; border-right: 1px solid #000;">&nbsp;'.$player['rep'].'</TD>
		<TD WIDTH="36%">&nbsp;'.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>'; 
	}
	
	$o = 0;
	foreach($rep_neg as $player) {
		$o++;
		$bgcolor = $config['site']['darkborder'];
		$bgcolor = $config['site']['lightborder'];
		$rank = reputation($player['rep']);

		$players_rows2 .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% STYLE="border: 1px solid #000;'.($o != $players_neg ? 'border-bottom: none;' : null).'"><TR BGCOLOR='.$bgcolor.' CLASS="over">
		<TD WIDTH="44%"><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">&nbsp;'.$player['name'].$rs.$bs.'</A></TD>
		<TD WIDTH="20%" STYLE="border-left: 1px solid #000; border-right: 1px solid #000;">&nbsp;'.$player['rep'].'</TD>
		<TD WIDTH="36%">&nbsp;'.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>'; 
	}
	
 $main_content .= '<center><img src="rep/bestrepped.jpg" type="1"/> <img src="rep/worstrepped.jpg" type="2"/><TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=100%></center>
	<TR BGCOLOR="'.$config['site']['vdarkborder'].'">
	<TD WIDTH="22%"><strong>&nbsp;<span class="white">NAME</span></strong></TD>
	<TD WIDTH="10%"><strong>&nbsp;<span class="white">POINTS</span></strong></TD>
	<TD WIDTH="18%"><strong>&nbsp;<span class="white">RANK</span></strong></TD>
	<TD WIDTH="22%"><strong>&nbsp;<span class="white">NAME</span></strong></TD>
	<TD WIDTH="10%"><strong>&nbsp;<span class="white">POINTS</span></strong></TD>
	<TD WIDTH="18%"><strong>&nbsp;<span class="white">RANK</span></strong></TD></TR><TR>
	<TD WIDTH="50%" COLSPAN="3" VALIGN="TOP">'.$players_rows.'</TD>
	<TD COLSPAN="3" VALIGN="TOP">'.$players_rows2.'</TD>
	<
/TR></TABLE>';
?>
Here is me repPics.php
PHP:
<?PHP
//Cyber's REPutation System. Script by Absolute Mango

	// Define GD fonts.
	define('GDFONT_FIRST', 1);
	define('GDFONT_SECOND', 2);
	define('GDFONT_THIRD', 3);
	define('GDFONT_FOURTH', 4);
	define('GDFONT_FIFTH', 5);

	// Create a class to handle icons.
	class MadGDIcon
	{
		// Define private variables.
		private $object, $icon;

		// Create the constructor.
		public function __construct($object, $icon)
		{
			// Set the private variable values.
			$this->object = $object;
			$this->icon = $icon;
		}

		// Create a public function to set the positions.
		public function setPosition($x, $y)
		{
			// Set the private variable values.
			$this->position['x'] = $x;
			$this->position['y'] = $y;

			// Check if the icon exists.
			if(file_exists($this->icon))
			{
				// Get icon size.
				$size = getimagesize($this->icon);
				// Check for the file extension.
				$object = pathinfo($this->icon);

				// Run several checks of the extension until a match is found.
				switch(strtolower($object['extension']))
				{
					case 'png':
						// Set the GD type to PNG.
						$return = imagecreatefrompng($this->icon);
					break;
					case 'gif':
						// Set the GD type to GIF.
						$return = imagecreatefromgif($this->icon);
					break;
					default:
						// Set the GD type to JPG.
						$return = imagecreatefromjpeg($this->icon);
					break;
				}

				return imagecopy($this->object, $return, $this->position['x'], $this->position['y'], 0, 0, $size[0], $size[1]);
			}
			else
			{
				imagestring($this->object, GDFONT_SECOND, $this->position['x']+1, $this->position['y']+1, 'Icon: not found', imagecolorallocate($this->object, 0, 0, 0));
				imagestring($this->object, GDFONT_SECOND, $this->position['x'], $this->position['y'], 'Icon: not found', imagecolorallocate($this->object, 230, 0, 0));
			}
		}
	}

	// Create a class to handle text strings.
	class MadGDText
	{
		// Define private variables.
		private $object, $text, $font, $color, $size, $position = array('x', 'y');

		// Create the constructor.
		public function __construct($object, $text, $color, $font, $size)
		{
			// Check if the color is false.
			if($color == false)
			{
				$color = array(255, 255, 255);
			}

			// Set the private variable values.
			$this->object = $object;
			$this->text = $text;
			$this->font = $font;
			$this->color = $color;
			$this->size = $size;
		}

		// Create a public function to set the positions.
		public function setPosition($x, $y)
		{
			// Set the private variable values.
			$this->position['x'] = $x;
			$this->position['y'] = $y;

			// Return the text string.
			if(is_int($this->font))
			{
				return imagestring($this->object, $this->font, $this->position['x'], $this->position['y'], $this->text, imagecolorallocate($this->object, $this->color[0], $this->color[1], $this->color[2]));
			}
			else
			{
				return imagettftext($this->object, $this->size, 0, $this->position['x'], $this->position['y'], imagecolorallocate($this->object, $this->color[0], $this->color[1], $this->color[2]), $this->font, $this->text);
			}
		}
	}

	// Create a class to handle GD images.
	class MadGD
	{
		// Define private variables.
		protected $background, $object;
		// Define public variables.
		public $testMode = false;

		// Create a public function to set the background image.
		public function setBackground($background)
		{
			// Set the private variable values.
			$this->background = $background;
			// Check for the file extension.
			$object = pathinfo($this->background);

			// Run several checks of the extension until a match is found.
			switch(strtolower($object['extension']))
			{
				case 'png':
					// Set the GD type to PNG.
					if(!$this->testMode) header('Content-Type: image/png');
					$this->object = imagecreatefrompng($this->background);
				break;
				case 'gif':
					// Set the GD type to GIF.
					if(!$this->testMode) header('Content-Type: image/gif');
					$this->object = imagecreatefromgif($this->background);
				break;
				default:
					// Set the GD type to JPG.
					if(!$this->testMode) header('Content-Type: image/jpeg');
					$this->object = imagecreatefromjpeg($this->background);
				break;
			}
			// Return the GD object.
			return $this->object;
		}

		// Create a public function to add icons.
		public function addIcon($icon)
		{
			return new MadGDIcon($this->object, $icon);
		}

		// Create a public function to add text strings.
		public function addText($text, $color = array(255, 255, 255), $font = GDFONT_SECOND, $size = 10)
		{
			// Return a new GDTextString object.
			return new MadGDText($this->object, $text, $this->HexToRGB($color), $font, $size);
		}

		// Create a private function to transform any HEX values into RGB format.
		private function HexToRGB($hex)
		{
			// Check if it is HEX.
			if(!is_array($hex))
			{
				// Remove any # character.
				$hex = ereg_replace("#", "", $hex);
				$color = array();
				// Check whether it is 6 characters long.
				if(strlen($hex) == 6)
				{
					// Set the new values.
					$color[0] = hexdec(substr($hex, 0, 2));
					$color[1] = hexdec(substr($hex, 2, 2));
					$color[2] = hexdec(substr($hex, 4, 2));
				}
			}
			// Return the color.
			return (!is_array($hex) ? $color : $hex);
		}

		// Create a public function to display the image as PNG and unset/destroy it after it is completed.
		public function display()
		{
			imagepng($this->object);
			imagedestroy($this->object);
			unset($this);
		}
	}
	
	include('config-and-functions.php');
	
	if(isset($_GET['type']))
	{
		$type = $_GET['type'];
		if($type == 1)
		{
			$config = array(
				'rep/bestrepped.jpg',
				160,
				'SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep >= 0 AND id > 6 AND group_id < 2 ORDER BY rep DESC LIMIT 1;'
			);
		}
		else
		{
			$config = array(
				'rep/worstrepped.jpg',
				20,
				'SELECT name, rep FROM players WHERE players.deleted = 0 AND players.rep < 0 AND id > 6 AND group_id < 2 ORDER BY rep ASC LIMIT 1;'
			);
		}

		$query = $SQL->query($config[2]);
		foreach($query as $player)
		{
			$rank = reputation($player['rep']);
			
			$image = new MadGD;
			$image->setBackground($config[0]);
			$image->addText($player['name'], '#000000', GDFONT_THIRD)->setPosition($config[1]+1, 17); // shadow
			$image->addText($player['name'], '#FFFFFF', GDFONT_THIRD)->setPosition($config[1], 16);
			$image->addText($player['rep'])->setPosition($config[1], 48);
			$image->addText($rank[0])->setPosition($config[1], 80);
			$image->display();
		}
	}
?>
 
..wait for update it's almost finished:thumbup:
 
Status
Not open for further replies.
Back
Top