MadMakz
/
Misc-Tools
Archived
1
0
Fork 0

Initial commit. Contains Old and New stuff.

master
MadMakz 10 years ago
commit cc84f74228

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@ -0,0 +1,199 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
//------------------------------------------------------------------------------------------------------------+
// Server Image Status addon for HLstatsX:CE v1.6+ by MadMakz (http://madmakz.com)(http://sourcepowered.net/)
// v1.0
// Based on the code from the "Basic Dynamic Server Image Status addon for LGSL by MadMakz (http://madmakz.com)
// for The Source Powered Network (http://sourcepowered.net/)"
// Thanks to Perry (from LGSL), bonzo, psychonic
//------------------------------------------------------------------------------------------------------------+
// FIRST TELL THE STUPID BROWSER THAT IT IS AN IMAGE & TURN OFF ERROR REPORTING BECAUSE WE CAN
error_reporting("0");
Header("Content-type: image/png");
//------------------------------------------------------------------------------------------------------------+
// GET THE REQUIRED INFOS FROM HLX
define('IN_HLSTATS', true);
require('config.php');
require(INCLUDE_PATH . "/class_db.php");
require(INCLUDE_PATH . "/functions.php");
$db_classname = 'DB_' . DB_TYPE;
if ( class_exists($db_classname) )
{
$db = new $db_classname(DB_ADDR, DB_USER, DB_PASS, DB_NAME, DB_PCONNECT);
}
else
{
die;
}
$server_id = '1';
if ((isset($_GET['server_id'])) && (is_numeric($_GET['server_id'])))
$server_id = valid_request($_GET['server_id'], 1);
$result = $db->query("
SELECT
IF(publicaddress != '', publicaddress, concat(address, ':', port)) AS addr,
name,
publicaddress,
act_map,
kills,
act_players,
max_players,
ct_wins,
ts_wins,
country,
game
FROM
hlstats_Servers
WHERE
serverId='$server_id'");
$server_data = $db->fetch_array($result);
//------------------------------------------------------------------------------------------------------------+
// THE MAGIC STARTS HERE
// OUR BASIC BACKGROUND (YUP, WE SUPPORT GAMETYPE BASED IMAGES^^)
$bgimg = IMAGE_PATH."/games/{$server_data['game']}/serverimage.png";
if (!file_exists($bgimg)){
$bgimg = IMAGE_PATH."/serverimage.png"; // If we have no gamebased background we use always the default
}
$im = imagecreatefrompng($bgimg);
// MAP
$mapimg = getImage("/games/{$server_data['game']}/maps/{$server_data['act_map']}");
if (!file_exists($mapimg['path'])) {
$mapimg['path'] = IMAGE_PATH."/unknown.jpg";
}
$im_map_info = getimagesize($mapimg['path']);
if ($im_map_info[2] == 1) { $im_map = imagecreatefromgif($mapimg['path']); }
if ($im_map_info[2] == 2) { $im_map = imagecreatefromjpeg($mapimg['path']); }
if ($im_map_info[2] == 3) { $im_map = imagecreatefrompng($mapimg['path']); }
// GAMEICON
$gico = getImage("/games/{$server_data['game']}/game");
if (!file_exists($gico['path'])) {
$gico['path'] = IMAGE_PATH."/server.gif";
}
$im_icon_info = getimagesize($gico['path']);
if ($im_icon_info[2] == 1) { $im_icon = imagecreatefromgif($gico['path']); }
if ($im_icon_info[2] == 2) { $im_icon = imagecreatefromjpeg($gico['path']); }
if ($im_icon_info[2] == 3) { $im_icon = imagecreatefrompng($gico['path']); }
// COUNTRY FLAG
$country = $server_data['country'];
// Workarround to get the 2 digit Country code.
$result = $db->query("
SELECT
name,
flag
FROM
hlstats_Countries
WHERE
name='$country'");
$country_data = $db->fetch_array($result);
//
$cimg = getImage("/flags/".strtolower($country_data['flag'])."");
$cimage_info = getimagesize($cimg['path']);
if ($cimage_info[2] == 1) { $cimage = imagecreatefromgif($cimg['path']); }
if ($cimage_info[2] == 2) { $cimage = imagecreatefromjpeg($cimg['path']); }
if ($cimage_info[2] == 3) { $cimage = imagecreatefrompng($cimg['path']); }
// FONT COLOR
$text_color0 = ImageColorAllocate($im,255,255,255);
// GET TEXT
$string0 = $server_data['name'];
$string1 = $server_data['publicaddress'];
$string2 = $server_data['act_map'];
$string3 = "{$server_data['act_players']}/{$server_data['max_players']}";
$string4 = $server_data['kills'];
$string5 = "{$server_data['ct_wins']}/{$server_data['ts_wins']}";
// MAP/GAMEIMAGE LOCATION ON BASE BACKGROUND
$im_map_width = 130;
$im_map_height = 120;
$im_map_posx = 25;
$im_map_posy = 112;
$im_icon_width = 20;
$im_icon_height = 20;
$im_icon_posx = 26;
$im_icon_posy = 113;
// SPRINT TO THE FINISH LINE
// Mapimage, Gameicon
imagecopyresampled($im, $im_map, $im_map_posx, $im_map_posy, 0, 0, $im_map_width, $im_map_height, $im_map_info[0], $im_map_info[1]);
imagecopyresampled($im, $im_icon, $im_icon_posx, $im_icon_posy, 0, 0, $im_icon_width, $im_icon_height, $im_icon_info[0], $im_icon_info[1]);
imagecopyresampled($im, $cimage, $im_icon_posx + 111, $im_icon_posy + 3, 0, 0, 16, 11, $cimage_info[0], $cimage_info[1]);
// Servername
imagestring($im, 1, 6, 11, substr($string0,0,34), $text_color0);
// IP:Port
imagestring($im, 1, 6, 28, " IP:Port: {$string1}",$text_color0);
// Map
imagestring($im, 1, 6, 45, " Map: {$string2}",$text_color0);
// Players
imagestring($im, 1, 6, 60, " Players: {$string3}",$text_color0);
// Kills
imagestring($im, 1, 6, 76, " Kills: {$string4} (Total)",$text_color0);
// CT/T Wins
imagestring($im, 1, 6, 92, " CT/T Wins: {$string5} (Total)",$text_color0);
// NOW LET THE MAGIC HAPPEN AND PULL ALL THAT SHIT INTO AN IMAGE
imagepng($im);
imagedestroy($im);
//------------------------------------------------------------------------------------------------------------+
?>

@ -0,0 +1,60 @@
<?php
/*
* SteamGroupStatus
* Copyright (C) 2012 Maximilian "MadMakz" Lotz
*
* http://madmakz.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Foundation.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$gruppe = "valve"; // Der Gruppenname hinter http://steamcommunity.com/groups/
echo stgrp_status($gruppe);
function stgrp_status($group = false){
if(!$group){ return false; }
$error_reporting = error_reporting();
error_reporting(0);
$url = file_get_contents('http://steamcommunity.com/groups/'.$group);
$default_socket_timeout = ini_get("default_socket_timeout");
ini_set("default_socket_timeout", 0);
if($http_response_header[0] != "HTTP/1.1 200 OK"){
error_reporting($error_reporting);
ini_set("default_socket_timeout", $default_socket_timeout);
return "<div class=\"blockrow\"><b>Steamcommunity appears to be down.</b></div>";
}
error_reporting($error_reporting);
ini_set("default_socket_timeout", $default_socket_timeout);
$return .= "<div class=\"blockrow\">\n";
preg_match("#<h1>(.+)</h1>#sU", $url, $aTitle);
$return .= "<a class=\"clanname\" href='http://steamcommunity.com/groups/$group' target='_blank'>".$aTitle[1]."</a>\n";
$return .= "<br>\n";
preg_match("#<span class=\"count \">(.+)</span>#sU", $url, $aMembers);
$return .= "<span class=\"resultsb\">".$aMembers[1]." Members</span>\n";
$return .= "<br>\n";
preg_match_all("#<div class=\"count \">(.+)</div>#sU", $url, $aActive);
$return .= "<span class=\"membersInGame\"><font color=#8bc53f>".$aActive[1][0]." In-Game</font></span>\n";
$return .= "<br>";
$return .= "<span class=\"membersOnline\"><font color=#62a7e3>".$aActive[1][1]." Online</font></span>\n";
$return .= "</div>";
return $return;
}
?>

@ -0,0 +1,46 @@
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0.0"
#define PLUGIN_BUILD ""
#define PLUGIN_BUILD_DATE "01052009"
public Plugin:myinfo =
{
name = "16k - RoundMoney",
author = "MadMakz (Cyber Games X24)",
description = "Set the players money amount for each round/spawn",
version = PLUGIN_VERSION,
url = "http://cgx24.com"
};
new Handle:OnOff;
new Handle:DoAmount;
new g_iAccount = -1;
public OnPluginStart()
{
g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
CreateConVar("16k_version", PLUGIN_VERSION, "16k - RoundMoney version", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
OnOff = CreateConVar("16k_enable","1","1 on 0 off");
DoAmount = CreateConVar("16k_amount","16000","How much money to set on player_spawn?");
HookEvent("player_spawn", Spawn);
}
public Spawn(Handle: event , const String: name[] , bool: dontBroadcast)
{
new clientID = GetEventInt(event,"userid");
new client = GetClientOfUserId(clientID);
if(GetConVarInt(OnOff))
{
SetMoney(client,GetConVarInt(DoAmount));
}
}
public SetMoney(client, amount)
{
if (g_iAccount != -1)
{
SetEntData(client, g_iAccount, amount);
}
}