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

[ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014


Post New Thread Reply   
 
Thread Tools Display Modes
Author
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Plugin ID:
4443
Plugin Version:
1.0
Plugin Category:
Statistical
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows you to allow players to !praise or !smite each other once per X seconds. !karma to view other players karma via a menu.
    Old 12-07-2014 , 15:59   [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #1

    *** Currently Karma only supports MySQL

    Karma is a system that I'm developing to allow players give each other praise or smite.

    Roadmap:

    - add translations
    - add a addon that will smite players every time they get muted, gaged, silenced, kicked, etc.


    For those whom want it, The MySQL Creation Script:
    Code:
    delimiter $$
    
    CREATE DATABASE `servers` /*!40100 DEFAULT CHARACTER SET latin1 */$$
     
    delimiter $$
    
    CREATE TABLE `karma` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `accountid` int(11) NOT NULL,
      `recent_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      `positive_karma` int(11) NOT NULL DEFAULT '0',
      `negative_karma` int(11) NOT NULL DEFAULT '0',
      `positive_karma_expiry` bigint(20) NOT NULL DEFAULT '0',
      `negative_karma_expiry` bigint(20) NOT NULL DEFAULT '0',
      `last_seen` bigint(20) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`,`accountid`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci$$
    I have not tested the creation script inside the plugin which should automatically create your database. You are probably best to use the creation script above to create the database.


    You should go into karma.sp and change some variables to suit yourself.

    Stuff in BOLD that you may want to change in karma.sp / karma_addon_handler.sp:

    #define DATABASENAME "servers"
    #define DATABASENAME_TABLE "karma"

    if your running CSGO, then change:
    #define GGAME_CSGO 0
    to
    #define GGAME_CSGO 1

    CSGO server owners should use our version of colors.inc included in our zip file



    Convars in your servers.cfg:

    // based on number of seconds
    // 3600 = 1 hour
    // 300 = 5 minutes
    karma_wait_time 3600

    karma_wait_time is applied to a player after they !smite or !praise someone, and make them wait that long before they can do it again.

    NOTE: You will need to compile this yourself.
    Attached Files
    File Type: zip Karma.zip (29.3 KB, 274 views)
    __________________

    Last edited by El Diablo War3Evo; 12-07-2014 at 17:08. Reason: special note
    El Diablo War3Evo is offline
    TUSK3N1337
    SourceMod Donor
    Join Date: Dec 2013
    Location: Sweden
    Old 12-07-2014 , 17:22   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #2

    Great idea want to see how this plugin turns out!
    __________________

    Last edited by TUSK3N1337; 12-07-2014 at 17:22.
    TUSK3N1337 is offline
    Send a message via Skype™ to TUSK3N1337
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 12-08-2014 , 12:51   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #3

    I don't have much time to fix up the zip file, here is a bug fix for karma.sp

    Sorry about it.. I'll fix the zip file later tonight when i get home.

    You will still need to download the karma.zip file in order to get the other files it needs.
    Attached Files
    File Type: sp Get Plugin or Get Source (karma.sp - 373 views - 19.7 KB)
    __________________

    Last edited by El Diablo War3Evo; 12-08-2014 at 15:18.
    El Diablo War3Evo is offline
    Robin955
    Veteran Member
    Join Date: Jun 2013
    Old 12-09-2014 , 18:14   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #4

    this works in css?

    and how much you get for being gagged / muted etc

    would love a plugin that only worked like that so i can see how often admins has been using admin powers over a player

    and that bug fix? why not attach it to the original post attatchments. and does roadmap mean to do or whats included?

    Last edited by Robin955; 12-09-2014 at 18:16.
    Robin955 is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 12-09-2014 , 21:58   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #5

    Quote:
    Originally Posted by Robin955 View Post
    this works in css?

    and how much you get for being gagged / muted etc

    would love a plugin that only worked like that so i can see how often admins has been using admin powers over a player

    and that bug fix? why not attach it to the original post attatchments. and does roadmap mean to do or whats included?
    If you want to see what your admins are doing with any admin command, or if they are accessing commands that you thought they wasn't suppose to access.. I recommend you get my
    [ANY] Admin RegAdminCmd Logging (version 1.3) 10 Nov 2014


    __________________
    El Diablo War3Evo is offline
    Robin955
    Veteran Member
    Join Date: Jun 2013
    Old 12-14-2014 , 19:11   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #6

    no i got admin watch

    would been fun to limit an admins power based on karma

    admin with 1000 karma points, lose 1 karma per command used or specify how much for what commands and when it hits 0 their admin is up. a different way of giving away admin and will limit down the ones using their admin 2 much for fun knowing if they abuse annyway when no people is on its gonna dissapear.
    Robin955 is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 12-15-2014 , 02:51   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #7

    karma includes a karma.inc file for which you can interact with karma and create new addon plugins for it.

    Natives:

    /*
    *
    *
    * GET INFORMATION
    *
    *
    */

    /** GetPosKarma
    * Positive Karma
    * @param client: The client's index.
    * @return: returns the positive karma of a player.
    */
    native GetPosKarma(client);

    /** GetNegKarma
    * Negative Karma
    * @param client: The client's index.
    * @return: returns the negative karma of a player.
    */
    native GetNegKarma(client);

    /** GetPosKarmaTime
    * Positive Karma Time is based on 32bit timestamp (number of seconds since unix epoch).
    * @param client: The client's index.
    * @return: returns Positive Karma Time.
    */
    native GetPosKarmaTime(client);

    /** GetNegKarmaTime
    * Negative Karma Time is based on 32bit timestamp (number of seconds since unix epoch).
    * @param client: The client's index.
    * @return: returns Negative Karma Time.
    */
    native GetNegKarmaTime(client);

    /*
    *
    *
    * ADD / SUBTRACT INFORMATION
    *
    *
    */

    /** AddPosKarma
    * Positive Karma
    * @param client: The client's index.
    * @karma: adds the player's positive karma. (number can be negative to subtract instead)
    * @noreturn
    */
    native AddPosKarma(client,karma);

    /** AddNegKarma
    * Negative Karma
    * @param client: The client's index.
    * @karma: adds the player's negative karma. (number can be negative to subtract instead)
    * @noreturn
    */
    native AddNegKarma(client,karma);

    /*
    *
    *
    * SET INFORMATION
    *
    *
    */

    /** SetPosKarma
    * Positive Karma
    * @param client: The client's index.
    * @karma: sets the player's positive karma.
    * @noreturn
    */
    native SetPosKarma(client,karma);

    /** SetNegKarma
    * Negative Karma
    * @param client: The client's index.
    * @karma: sets the player's negative karma.
    * @noreturn
    */
    native SetNegKarma(client,karma);

    /** SetPosKarmaTime
    * Positive Karma Time is based on 32bit timestamp (number of seconds since unix epoch).
    * @param client: The client's index.
    * @param KaramTime: 32bit timestamp (number of seconds since unix epoch).
    * @noreturn
    *
    * GetTime()+86400.0 =
    * They'll have to wait 1 day before they can apply positive karma to someone.
    *
    * days=RoundToFloor(time/86400.0);
    * hours=RoundToFloor((time % 86400 )/3600.0) ;
    * minutes=RoundToFloor((time % 86400 % 3600) / 60.0);
    * seconds=time % 86400 % 3600 % 60;
    */
    native SetPosKarmaTime(client,KaramTime);

    /** SetNegKarmaTime
    * Negative Karma Time is based on 32bit timestamp (number of seconds since unix epoch).
    * @param client: The client's index.
    * @noreturn
    *
    * GetTime()+86400.0 =
    * They'll have to wait 1 day before they can apply negative karma to someone.
    *
    * days=RoundToFloor(time/86400.0);
    * hours=RoundToFloor((time % 86400 )/3600.0) ;
    * minutes=RoundToFloor((time % 86400 % 3600) / 60.0);
    * seconds=time % 86400 % 3600 % 60;
    */
    native SetNegKarmaTime(client,KaramTime);


    /*
    *
    *
    * FORWARDS
    *
    *
    */

    /** OnKarmaUpdate
    * When Karma is updated, this is called.
    * @param client: The client's index.
    */
    forward OnKarmaUpdate(client);

    /** OnKarmaTimeUpdate
    * When Karma Time is updated, this is called.
    * Karma Time is based on 32bit timestamp (number of seconds since unix epoch).
    * @param client: The client's index.
    */
    forward OnKarmaTimeUpdate(client);
    __________________

    Last edited by El Diablo War3Evo; 12-15-2014 at 02:53.
    El Diablo War3Evo is offline
    M. Silva
    Member
    Join Date: Dec 2014
    Location: My house
    Old 12-15-2014 , 22:36   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #8

    Haha, awesome! I can see some projects working along this! Thanks.
    __________________
    M. Silva is offline
    yusufali
    Member
    Join Date: Feb 2014
    Old 12-16-2014 , 11:01   Re: [ANY] KARMA (Currently MySQL only) v1.0 - 7 DEC 2014
    Reply With Quote #9

    do you have a repo where people can contribute to it? I see many areas (for example the SQL structure) I think can be greatly improved
    __________________
    yusufali 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 13:35.


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