Raised This Month: $32 Target: $400
 8% 

Played Time: Extended (Last Update: 7th June 2016)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-27-2012 , 13:16   Played Time: Extended (Last Update: 7th June 2016)
Reply With Quote #1

.: Played Time: Extended :.
** Info **
Everyone knows Alka's Played Time plugin. It doesn't really have many features, doesn't support SQL saving, and it only shows the top motd for online players only.
After seeing many requests about the motd, I decided to make a new plugin, which people will be able to switch between MySQL or nvault SQLite saving. Also I added new features which are described as I continue.

** New features **
  • Ability to switch easily between MySQL and nVault SQLite to save players times. (Changed from .sma file)
  • Top MOTD can show all saved players.
  • New command amx_show_player_times.
  • Added donate menu (separate plugin that uses the API). Players will be able to donate time to each other by just a chat command.
  • Added API for sub-plugins.
  • Ability to switch between colored chats or normals. Removed in lastest version. Only colored chat.
  • Added connect messages. (Can be disabled by a cvar)
  • Names and times are now saved by SteamIDs (or names in new version).
  • Name is updated on each name change.
  • Every second counts! Player won't lose any second of playing.
  • More features coming soon as I update the plugin. This is probably the last update.
** Admin commands **
Only one:
amx_show_player_time <name/@T/@CT/@TERR>
IF the command was written by it self, it will show all players played time, else it will show the written argument time
Example:
Code:
] amx_show_player_time
Showing players times of all connected players
1. Khalid            2510
2. Brandon            271
3. Solo[Pro]            41
....
 
] amx_show_player_time Khalid
Khalid's total played time is 592 minutes
 
] amx_show_player_time @T
Showing players times for team Terrorist
1. Khalid            251
2. BOT* NiceOne            243
...
** Client commands **
say\say_team * - Shows player time
say /top**_time - Shows top15 motd
say /top**time - same as above

* Can be one of these:
/mt, mt, mytime, /mytime, /my_time, my_time
** 1-∞ (maximized by the total entries)

** Cvars **
PHP Code:
pte_allow_donate "1" // Allow donating
pte_show_connect_messages "1" // Show messages upon connect
// These two cvars are only in the sub plugin "pte_donate_connect" 
** Requirments **
To be able to use sqlite, you must enable it from modules.ini that is located in the configs folder.
This plugin supports AMXX versions 1.8.3 and 1.8.2; however, for 1.8.2 you will need a color chat include located HERE

** Editing **
Everything that can be edited easily is located on top of the plugin.
Spoiler

** Notes **
If you would like to reset all the saved data in the server (if you're using SQLite of course), follow the following steps:[LIST][*] Close your server[*] Go to cstrike/addons/amxmodx/data/sqlite3[*] Delete played_time_database.sq3[*] Re-open your server. The new empty database will be created again.

** Credits **
Alka - Original plugin idea.
Exolent[jNr] - For showing how to make a top motd with nvault_util Here - No longer used, but still thanks
Bugsy - For the nvault_util include - No longer used, but still thanks.

** Changelog **
Code:
v1.0b | 7th June 2016
* Fixed a situation where time time was reset because it was not retrieved and saved as 0.
* Added GET_TIME_INSTANT_QUERY
* Added DO_NOT_LOG

v1.0a | 5th June 2016
* Fixed compiling error for AMXX 1.8.2 compiler.
* A few fixes in the donate plugin

v1.0 | 2nd June 2016
* Rewritten plugin. Code should be better now and time resets should be fixed.
* Separated donation functionality and connect messages into other plugins.
* Changed natives names. Older plugins will still be able to run.
* Added two new forwards.

v0.1 | 27th Nov 2012    - Initial release.
PS: This code has nothing to do to Alka's plugin, I wrote this code from scratch, not just added new features to his plugin.

The sub-plugins require you to compile locally, if you don't know how, please, look here.
If there are any suggestions, improvments, bug fixes, etc, please post here.
Attached Files
File Type: inc played_time.inc (1.7 KB, 892 views)
File Type: sma Get Plugin or Get Source (played_time_extended.sma - 2325 views - 25.9 KB)

Last edited by pokemonmaster; 06-07-2016 at 04:56. Reason: Update 1.0b
pokemonmaster is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-27-2012 , 13:16   Re: Played Time: Extended v0.1
Reply With Quote #2

** Sub-Plugins **
  • ** Set/Add/Take user times **
This plugin is meant to show you an example on how to use plugin natives for creating other plugins that will be compatible with this.

Commands:
amx_set_time <name/@team/@all/*> <+/-/ or time to set> <time to add or take in minutes> - Sets time

Examples:
Code:
] amx_set_time
Usage:  amx_set_time <name/@team/@all/*> <+/-/ or time to set> <time to add or take> - Sets time

] amx_set_time @T 100
ADMIN Khalid :): Set TERRORIST team players total time to 100

] amx_set_time @CT + 100
ADMIN Khalid :): Add to CT team players total time 100

] amx_set_time @ALL - 100000000
(IN CHAT) ADMIN Khalid :): Take from Everyone's total 2000
PS: To use this, you will need PlayedTime_Extended plugin from the first post and played_time.inc file

** Old plugins **
Old (unsupported plugins) are in the attachments, also.
Attached Files
File Type: sma Get Plugin or Get Source (PlayedTime_Extended_Old_0_1.sma - 1407 views - 19.4 KB)
File Type: sma Get Plugin or Get Source (PlayedTime_Extended_v0.1b.sma - 1357 views - 24.7 KB)
File Type: sma Get Plugin or Get Source (pte_set_time.sma - 1354 views - 3.5 KB)
File Type: sma Get Plugin or Get Source (pte_donate_connect.sma - 911 views - 4.7 KB)
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 06-07-2016 at 00:39. Reason: update
pokemonmaster is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 11-27-2012 , 14:05   Re: Played Time: Extended v0.1
Reply With Quote #3

Nice! Testing it right away...

Some in-game screenshots would be really helpful.
bLacK-bLooD is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-27-2012 , 14:10   Re: Played Time: Extended v0.1
Reply With Quote #4

Quote:
Originally Posted by bLacK-bLooD View Post
Nice! Testing it right away...

Some in-game screenshots would be really helpful.
I am going to do some later as I have an exam tommorow.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-27-2012 at 15:32.
pokemonmaster is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 11-27-2012 , 16:47   Re: Played Time: Extended v0.1
Reply With Quote #5

Really thanks x). And good job.
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-28-2012 , 08:52   Re: Played Time: Extended v0.1
Reply With Quote #6

Quote:
Originally Posted by quilhos View Post
Really thanks x). And good job.
Thanks


ADDED sub-plugin example.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Haider99xD
BANNED
Join Date: Aug 2012
Location: Dubai
Old 11-28-2012 , 09:28   Re: Played Time: Extended v0.1
Reply With Quote #7

Keep the good work up , impressive
Haider99xD is offline
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 11-28-2012 , 11:23   Re: Played Time: Extended v0.1
Reply With Quote #8

nice plugin
sami_spt is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 11-29-2012 , 08:48   Re: Played Time: Extended v0.1
Reply With Quote #9

Good job!, keep the good work up.
Moody92 is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-29-2012 , 09:41   Re: Played Time: Extended v0.1
Reply With Quote #10

Quote:
Originally Posted by Haider99xD View Post
Keep the good work up , impressive
Quote:
Originally Posted by sami_spt View Post
nice plugin
Quote:
Originally Posted by Moody92 View Post
Good job!, keep the good work up.
Thank you all.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster 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 03:07.


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