Raised This Month: $51 Target: $400
 12% 

Found Item Logger


Post New Thread Reply   
 
Thread Tools Display Modes
0verdose
Junior Member
Join Date: Feb 2008
Old 05-24-2009 , 18:06   Re: Found Item Logger
Reply With Quote #11

Hey I'm getting these errors when I try load the plug in. Could someone help me out.

Cheers.

Quote:
L 05/25/2009 - 09:55:23: SourceMod error session started
L 05/25/2009 - 09:55:23: Info (map "achievement_idle") (file "errors_20090525.log")
L 05/25/2009 - 09:55:23: [SM] Native "SQL_FastQuery" reported: Invalid database Handle 0 (error: 4)
L 05/25/2009 - 09:55:23: [SM] Displaying call stack trace for plugin "founditemlog.smx":
L 05/25/2009 - 09:55:23: [SM] [0] Line 76, /home/groups/alliedmodders/forums/files/2/7/9/5/2/42572.attach::createdb()
L 05/25/2009 - 09:55:23: [SM] [1] Line 39, /home/groups/alliedmodders/forums/files/2/7/9/5/2/42572.attach::OnPluginStart()
0verdose is offline
ratty
SourceMod Donor
Join Date: Jan 2006
Old 05-24-2009 , 19:22   Re: Found Item Logger
Reply With Quote #12

Did you do this?
Quote:
The only thing you've to do is add a database entry into the database.cfg with the name itemlogger
Regarding giving items, I tried givenameditem for "tf_weapon_compound_bow" and "tf_weapon_jar", but both just give no weapon, and you walk around looking like youre in civilian mode. All the normal weapons work for that still, you can be a scout with a flamethower, etc.. The other new weapons/items in this patch are attributes of other items and can't be given, like the ambassador is just a revolver with some attributes on it to make it behave and show a different model.

This is a cool plugin, I'd like to make a suggestion that there's a cvar that gives it a "server name" kind of tag, similar to the chat log plugin. Then you can put it on many servers, all logging to the same database, but so you can still seperate out the data between the different servers.

Anyway, thanks a lot for this plugin, I took the magic part of it (hookevent on item_found) which I didn't know about, and made my own.
I run 6 of achievement_idle servers with 30 slots (2 reserved), and over the past 10 hours, it consistantly is giving an item every 2 hours to each player. It is consitant with what I see for myself too, the last 2 nights I've been idling and its a new item per 2 hours. It has a big deviation so you might get a couple items sooner than that, but over a long period its 1 per 2 hours.
I compared this with my normal game server where people are actually playing, and its the same there too!

I'll post more stats soon, but I think that would be off topic for this thread, so I'll do it on my own forums.

If others are going to share stats, I'd love to see those too, as a sort of peer review. I'm not sure whats a good forum to discuss this on, the official forums are no good, they'll probably lock/delete the posts.
__________________
Visit the NOM NOM NOM community
http://www.nom-nom-nom.us

Last edited by ratty; 05-24-2009 at 20:17.
ratty is offline
Evil-Dragon
Junior Member
Join Date: Oct 2009
Old 10-05-2009 , 17:38   Re: Found Item Logger
Reply With Quote #13

Just added this to my server, but it's not working:

[founditemlog.smx] DatabaseInit (CONNECTED) with db config
[founditemlog.smx] Can't select character set (SET NAMES 'utf8')

and then afterwards i will get:
[founditemlog.smx] SQL Error: no such table: log
everytime someone receives an item.

Database in databases.cfg
Quote:
"itemlogger"
{
"driver" "sqlite"
"host" "localhost"
"database" "itemlogger"
//"user" "root"
//"pass" ""
}
}
I'm using the latest build of sourcemod and it is running on hlds on a windows xp box.

Any ideas?
Evil-Dragon is offline
Evil-Dragon
Junior Member
Join Date: Oct 2009
Old 10-12-2009 , 09:34   Re: Found Item Logger
Reply With Quote #14

Anybody?
Evil-Dragon is offline
Evil-Dragon
Junior Member
Join Date: Oct 2009
Old 10-19-2009 , 18:26   Re: Found Item Logger
Reply With Quote #15

Got this working but only with a MYSQL database. Would not work with a sqlite db no matter what i tried.
Evil-Dragon is offline
Pfsm999
Senior Member
Join Date: Sep 2009
Old 10-20-2009 , 04:31   Re: Found Item Logger
Reply With Quote #16

I modified this plugin for add more information :

PHP Code:
CREATE TABLE IF NOT EXISTS `item_found` (`IDINT NOT NULL AUTO_INCREMENT PRIMARY KEY
`
PSEUDOVARCHAR50 NOT NULL DEFAULT '0',
`
STEAMIDVARCHAR25 NOT NULL DEFAULT '0',
`
ACTUALTIMEINT NOT NULL DEFAULT '0',
`
ONLINEPLAYERSINT NOT NULL DEFAULT '0',
`
ITEMVARCHAR50 NOT NULL DEFAULT '0'
`
TEAMINT NOT NULL DEFAULT '0'
ENGINE MYISAM 
In this news table, you have the color of the team. When a player win a item, you will have his team color and name of the player.

And i create a news PHP interface :

Function to connect MYSQL (File: Mysql.php) - (YOU MUST MODIF HOST, USER, PASS and DATABASE)
PHP Code:
<?php
@mysql_connect(HOSTUSERPASS) or die("Can not establish database connection: " mysql_error());
@
mysql_select_db(DATABASE) or die("Can not use database: " mysql_error());
mysql_query("SET CHARACTER SET 'utf8'");
?>
Class for all Items (File : itemsfound.class.php)
PHP Code:
<?php
class ItemsFound {
 var 
$Loaded false;
 var 
$steam_id = array();
 var 
$date = array();
 var 
$pseudo = array();
 var 
$onlineplayer = array();
 var 
$item = array();
 var 
$team = array();
 var 
$nbr 0;
 function 
ItemsFound($steamid) {
  
$sqlItem mysql_query("SELECT * FROM `item_found` ");
  while (
$row mysql_fetch_assoc($sqlItem)) 
  {
   
$this->pseudo[] = $row['PSEUDO'];
   
$this->steam_id[] = $row['STEAMID'];
   
$this->item[] = $row['ITEM'];
   
$this->onlineplayer[] = $row['ONLINEPLAYERS'];
   
$this->date[] = $row['ACTUALTIME'];
   
$this->team[] = $row['TEAM'];
   
$this->nbr $this->nbr 1;
  }
  
$this->Loaded true;
 }
}
?>
Function to get an object (File : function.class.php)
PHP Code:
<?php
function GetItem($steamId) {
 require_once(
"itemsfound.class.php");
 
$items = new ItemsFound($steamId);
 if (
$items->Loaded)
  return 
$items;
 return 
null;
}
?>
Interface page (File : items.php) - (FRENCH PAGE)

PHP Code:
<?php
require_once("mysql.php");
require_once(
"function.php");
$item GetItem(null);
function 
lesItemsDebloquer($string)
{
$items = array();
//medic
$items[] = "#TF_Unique_Achievement_Medigun1";
$items[] = "#TF_Unique_Achievement_Syringegun1";
$items[] = "#TF_Unique_Achievement_Bonesaw1";
//pyro
$items[] = "#TF_Unique_Achievement_FireAxe1";
$items[] = "#TF_Unique_Achievement_FlareGun";
$items[] = "#TF_Unique_Achievement_Flamethrower";
//heavy
$items[] = "#TF_Unique_Achievement_LunchBox";
$items[] = "#TF_Unique_Achievement_Minigun";
$items[] = "#TF_Unique_Achievement_Fists";
//scout
$items[] = "#TF_Unique_Achievement_Bat";
$items[] = "#TF_Unique_Achievement_Scattergun_Double";
$items[] = "#TF_Unique_Achievement_EnergyDrink";
//spy
$items[] = "#TF_Unique_Achievement_Revolver";
$items[] = "#TF_Unique_Achievement_CloakWatch";
$items[] = "#TF_Unique_Achievement_FeignWatch";
//sniper
$items[] = "#TF_Unique_Backstab_Shield";
$items[] = "#TF_Unique_Achievement_Jar";
$items[] = "#TF_Unique_Achievement_CompoundBow";
//hats
$items[] = "#TF_Wearable_Headgear";
$items[] = "#TF_Unique_Headgear_Sniper";
$items[] = "#TF_Unique_Headgear_Soldier";
$items[] = "#TF_Unique_Headgear_Demoman";
$items[] = "#TF_Unique_Headgear_Medic";
$items[] = "#TF_Unique_Headgear_Pyro";
$items[] = "#TF_Unique_Headgear_Heavy";
$items[] = "#TF_Unique_Headgear_Engineer";
$items[] = "#TF_Unique_Headgear_Spy";
$realname = array();
$realname[] = "Le Kritzkrieg";
$realname[] = "Le Blutsauger";
$realname[] = "L'Ubersaw";
$realname[] = "L'Axtinguisher";
$realname[] = "Le Flare Gun";
$realname[] = "Le Backburner";
$realname[] = "Le Sandvich";
$realname[] = "Natascha";
$realname[] = "The Killing Gloves of Boxing";
$realname[] = "La Sandman";
$realname[] = "L' Eradicateur";
$realname[] = "Bonk! Atomic Punch";
$realname[] = "L'Ambassador";
$realname[] = "La Cloak and Dagger";
$realname[] = "La Dead Ringer";
$realname[] = "Le Razorback";
$realname[] = "Jarate";
$realname[] = "L'Arc";
$i=0;
foreach(
$items as $item)
{
 if (
$item==$string)
 {
  return 
$realname[$i];
 }
 
$i=$i+1;
}
return 
$string;
}
?>
<html>
<head>
<title>YOUR TITLE</title>
</head>
<body>
<table style="text-align: left; width: 648px;" border="0"
 cellpadding="2" cellspacing="2">
  <tbody>
    <?PHP
        
if ($item->nbr==0)
        {
         echo 
"<br/><font color=\"#FFFFFF\">Aucune personne n'a debloquer d'item.</font>";
        }
        else
        {
         if (
$_GET['find']=="")
         {
          
$i=0;
         }
         else
         {
          
$find = (int) $_GET['find'];
          
$i=50*$find;
         }
         for(
$i;$i<$item->nbr;$i++)
         {
          if (
$item->team[$i]==3)
          {
           
$colorforplayer="#5B95C2";
          }
          else
          {
           if(
$item->team[$i]==2)
           {
            
$colorforplayer="#CA5452";
           }
           else
           {
            
$colorforplayer="#B6C5D8";
           }
          }
          echo 
'<tr><td style="width: 200px;"><i>'.date('d/m/Y ŕ H\h i\m\i\n s\s'$item->date[$i]).'</i></td><td style="text-align: left; width: 428px;"><b><font color="'.$colorforplayer.'">'.$item->pseudo[$i].'</font><font color="#FFFFFF"> a trouvé: </font><font color="#A1BD68">'.lesItemsDebloquer($item->item[$i]).'</font></b></td></tr>';
         }
?>
  </tbody>
</table>
<?PHP
         
echo '<br/><br/><br/>';
         
$find = (int) $_GET['find'];
         if(
$find 0)
         {
          
$find $find 1;
          echo 
'<a href="items.php?find='.$find.'">&lt;&lt;Page précedente </a>';
          
$find $find 1;
         }
         if(
$item->nbr>($find*50) AND $find != 0)
         {
          
$find $find 1;
          echo 
'<a href="items.php?find='.$find.'"> Page Suivante >></a>';
          
$find $find 1;
         }
        }
?>
</body>
</html>
And the news plugins modified by me !
  • Add player name
  • Add player team color
Don't hesitate to PM me !And for see the result : http://ns304110.ovh.net/achievements/items.php
MODIFICATION : Correction of bug (Index 0) :
Attached Files
File Type: sp Get Plugin or Get Source (founditemlog.sp - 274 views - 2.5 KB)
__________________

Last edited by Pfsm999; 11-19-2009 at 11:54.
Pfsm999 is offline
Evil-Dragon
Junior Member
Join Date: Oct 2009
Old 10-20-2009 , 14:27   Re: Found Item Logger
Reply With Quote #17

You might need to have a look at this:
Code:
L 10/20/2009 - 19:24:04: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/20/2009 - 19:24:04: [SM] Displaying call stack trace for plugin "founditemlog_revised.smx":
L 10/20/2009 - 19:24:04: [SM]   [0]  Line 50, /home/groups/alliedmodders/forums/files/6/0/3/8/4/52030.attach::Event_item_found()
L 10/20/2009 - 19:24:23: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/20/2009 - 19:24:23: [SM] Displaying call stack trace for plugin "founditemlog_revised.smx":
L 10/20/2009 - 19:24:23: [SM]   [0]  Line 50, /home/groups/alliedmodders/forums/files/6/0/3/8/4/52030.attach::Event_item_found()
L 10/20/2009 - 19:24:25: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/20/2009 - 19:24:25: [SM] Displaying call stack trace for plugin "founditemlog_revised.smx":
L 10/20/2009 - 19:24:25: [SM]   [0]  Line 50, /home/groups/alliedmodders/forums/files/6/0/3/8/4/52030.attach::Event_item_found()
Evil-Dragon is offline
Pfsm999
Senior Member
Join Date: Sep 2009
Old 10-21-2009 , 04:05   Re: Found Item Logger
Reply With Quote #18

Oh god, i get you an old version !
I have detected this bug, 2 days ago
Attached Files
File Type: sp Get Plugin or Get Source (founditemlog.sp - 307 views - 2.8 KB)
__________________

Last edited by Pfsm999; 10-21-2009 at 06:18.
Pfsm999 is offline
Evil-Dragon
Junior Member
Join Date: Oct 2009
Old 10-21-2009 , 04:55   Re: Found Item Logger
Reply With Quote #19

Are you sure that's your latest version?

Code:
L 10/21/2009 - 09:52:08: [SM] Native "IsClientConnected" reported: Client index 0 is invalid
L 10/21/2009 - 09:52:08: [SM] Displaying call stack trace for plugin "founditemlog.smx":
L 10/21/2009 - 09:52:08: [SM]   [0]  Line 50, /home/groups/alliedmodders/forums/files/6/0/3/8/4/52075.attach::Event_item_found()
L 10/21/2009 - 09:52:50: [SM] Native "IsClientConnected" reported: Client index 0 is invalid
L 10/21/2009 - 09:52:50: [SM] Displaying call stack trace for plugin "founditemlog.smx":
L 10/21/2009 - 09:52:50: [SM]   [0]  Line 50, /home/groups/alliedmodders/forums/files/6/0/3/8/4/52075.attach::Event_item_found()
L 10/21/2009 - 09:52:50: [SM] Native "IsClientConnected" reported: Client index 0 is invalid
Evil-Dragon is offline
Pfsm999
Senior Member
Join Date: Sep 2009
Old 10-21-2009 , 06:17   Re: Found Item Logger
Reply With Quote #20

Ah that's strange ! I will rewrite this section !

And a new version here (Thanks for testing)
Attached Files
File Type: sp Get Plugin or Get Source (founditemlog.sp - 409 views - 2.8 KB)
__________________
Pfsm999 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode