View Single Post
Author Message
Pfsm999
Senior Member
Join Date: Sep 2009
Old 11-16-2009 , 13:40   [STOPPED][TF2] Custom Achievement Manager With MYSQL (V1.1)
Reply With Quote #1

[STOPPED] Custom TF2 Achievement completely changes for your enjoyment.

Use Colors librairy by exvel !

This plugin is designed to create achievements on your custom TF2 server by SourceMod. For this, a web interface is proposed to manage achievements.
You can: Create success, place them in categories defined by you, modify and integrate them on your server.


The plugin has been completely redone by Mecha and me. Again thank these friends. Version 1 of the plugin provides a lot of novelty that I will now try to explain later.
The code of this plugin is based on several other plugins:
"Customs Achievement" by Gachl
"Kill-based Achievement Manager 1.1" by Jindo

I added this plugin interface further of the creation of successful integration and programming of these achievements on a database. The web interface was inspired by Mechaware and then made entirely by myself to make it more comfortable for the user and administrator who manages the plugin. It features a proud look and just lets you manage or find information easily.

The plugin brings a lot of things:
· New database to manage new achievement.
· An achievement is not one action but can have up to 5.
· Improved code and query optimization.
· Ability to make achievement achievable in a time T or a lifetime or in a round time.
· Possible to force the person to do a Taunt to achieving success
· New on the possibilities of achievement like Sticky jump, Rocket Jump …
· Possibility to add Custom Achievement ON GAME by an admin
· Possibility to add +X on a specific player on server by an admin

The achievements are now cut into blocks and success can contain a maximum of five block all types. The blocks can be a precise action that the player has made X times, or a condition to the completion of the previous block.

Consider a simple example.
I wish to make an achievement in which a person must kill one engineer, make 3 sentry destruction, completed or not, and capture a point in the one life. Possibly. Here's how it shook implemented in the plugin.

The success is divided into 3 blocks. (Max 5 blocks)
1. The first block is a type of "murder and destruction" where the winner's achievement is the attacker and kills a person of class "engineer". This block must realize once time !
2. The second block is of type "murder and destruction" where the winner destroyed a sentry completed or not. This block should be making 3 times.
3. The last block is of type "map" where the winner takes a point.
The combination of all these blocks must be done once and must start as soon as the player dies.


Is not it wonderful ?
Imagine what you can do as a achievement.
However, we recommend that you do not make success impossible to do for checking the consistency of success depends only on you!


RECOMMANDATION OF ME :


1 . Have a great idea of what do you want to create !

Some admins like to add custom achievement like : Kill me X time. But don’t forget, when you are not on the server : player can’t do this achievement and if you are on the server : all people want kill you !

2. Don’t create impossible achievement !

Don’t forget, 95 % of player come randomly on your server and they return OR NOT on your server ! An achievement like : Kill in one time 20 people with a specific weapons and capture a point on a specific map, … it’s not possible for a randomly player !

Rules of creation an achievement :

· In one life, no more 3 blocks !
· In one round, no more 4 blocks !
· In one life : No specific player, No specific map !


· /achievement : Show the achievement's menu on game
· /show_achievements : Show the achievement's page of the client with MOTD page.
· /admin_ach : Give +X on a specific achievement on a specific player
· /admin_ach XXXXXXXXXXX : Give an achievement call XXXXXXXXXXX on a specific player or all player present on the server !
· See Cvars !


· ach_db : MySQL Database to use (Default : "achievement”);
· ach_prefix : MySQL Database Table Prefix (Default : "achmw_")
· ach_url : Url to php file showing achievements (Default
http://mechaware.net/tf2/achievements/index.php)
· ach_info : Show Achievement Info to Player or All on Unlocked ? (0 = none, 1 = all, 2 = Player) - (Default : 1)
· ach_menu : Show SourceMod menu to Player? (0 = no, 1 = yes) - (Default : 1)
· ach_announce : Announce the plugin and possibility (0 = no, 1 = yes) - (Default : 1)
· ach_chatmotd to choose your text to show the motd with player informations (Default : /show_ach)
· ach_chatmenu to choose your text to show the sourcemod menu with player informations (Default : /ach)

· ach_refresh : Refresh plug.


Plugin : Upload the .smx file to your /sourcemod/plugins/ folder
  1. Modify your /sourcemod/config/database.cfg to add a configuration for this plugin
PHP Code:
   "achievement"
{        "driver"   "mysql"
          "host"   "127.0.0.1"        
          "database"   "YOURDATABASE"    
          "user"   "YOURUSERNAME"      
          "pass"   "YOURDBNAME"      
         
//"timeout"   "0"       
          
"port"   "3306"   

  1. Modify ach_db Cvar
  2. Upload customach.phrases.txt to your /sourcemod/translations/
  3. Restart you server !

·Edit config.inc.php and enter correct informations
o Replace all **** by correct information.
PHP Code:
$CONFIG = Array(
  
// EDIT THE FOLLOWING VALUES
  /* admins
   * Admins (username / pw) to log in (NOT USED, just skip this section)
   */
  
'admins'                                  =>                    Array(
              
/* For each admin: */
              
'****'                          =>                    '****'
  
),
   
  
/* db_*
   * Database settings (self-explanatory)
   */
  
'db_host'                                 =>                    'localhost',
  
'db_user'                                 =>                    '*****',
  
'db_pass'                                 =>                    '*****',
  
'db_name'                               =>                    '*****',
  
/* server who was pluggin*
   * IP adress with port=> rcon password
   */
  
'server'                        =>                   Array
  (
              
'****'                          =>                    '****'
  
),
  
'timeout'                                 =>                   1,
  
'retries'                                    =>                    0,
  
'pathofapplication' => '********',
  
'phpself' => '********',
  
'titleofwebsite' => 'TF2 - ******* Custom Achievements',
  
'titleofdesign' => '********',
  
'titleofdesign2' => '********',
  
'titleofdesign3' => '*********',
  
'nbrperpage' => 20//Number of name per page
  
'funPage' => // If you want to show fun information on the list !
); 
· pathofapplication is you folder web adress like : http://*********/********/
· For phpself : Go on your browser and view phpself.php on admin folder : Don’t forget to delete this file.
· Upload web interface to desired location.
· Insert SQL Request (on database.sql) in your database

If you want to add personal panel on the web-interface : You can !

Goto presentation.html and edit it : Enter your text and put it on your web server !



If you already have version 0.6 interface and plug or version 0.7 : You must recreate all your achievement : The beta was close and I work on a terminate plug ! Sorry if you create some some achievement but all now change ! And do not forget that :
· Test your web interface and create false achievements
· Restart your game server.
· The server needs to be restarted for the database.cfg to be reloaded
· Make sure you allow your game server mysql access to your web server.
· If you have : ach_ktm.smx on your game server : Disabled it !
· If you have : customachievements.smx on your game server : Disabled it !
· If you have : ach_ktm_bd.smx on your game server : Disabled it !
· If you have : mechaware_achievements.smx on your game server : Disabled it !


It's a huge plugin but it use constansly the database and if you haven't got a local database : You will have small problems in plugin because the communication between your plugin and the database take a time, very short but a time ...


All of you !
Mecha
Gachl
Jindo
Tester of version 0.7
Tester of version 0.6

ADDONS : See on the second post !
Update part :

Code:
Update 1.1 : 
Correct some code.
Add possibility to a player to show an achievement not done on HUD with "/ach" menu (Option 5).

Update 1.05 : 
Correct some identification code.
And add remove achievement done on one life when a client connect on the server.

Update 1.041 : 
Remove a line who perturb correct function of the plug.
(WTF ... i do that ?)

Update 1.04 : 
Fix engineer error and medic, sniper, spy error.
Thanks NovaDenizen !

Update 1.03 : 
Fix some error
in medic.inc file and a small error in AddOnAchievement in main page

Update 1.02 : 
Fix some error
Optimise the code
Rewrite a small part of menu.

Update 1.01 : 
Correct bad code !
Fix some issue
And remove all warning
Attached Files
File Type: zip database.zip (1.5 KB, 601 views)
File Type: rar website.rar (6.03 MB, 743 views)
File Type: zip plugin1_1.zip (108.1 KB, 641 views)
File Type: smx customs_achievements.smx (63.9 KB, 600 views)
File Type: txt customach.phrases.txt (4.5 KB, 522 views)
__________________

Last edited by Pfsm999; 07-16-2010 at 18:37.
Pfsm999 is offline