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

[CS:GO] AchievementsGO 2.0 - create your own achievements!


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MAGNET12
Member
Join Date: Dec 2017
Plugin ID:
7114
Plugin Version:
2.0
Plugin Category:
All
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Create achievements/missions in easy way
    Old 05-17-2020 , 08:17   [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #1

    I present second release of a plugin, that allows creating your own achievements/missions on the server in easy way. The previous version has had a lot of flaws and it was written in a very poor way. I hope the plugin will come in handy for people, who plan to create its own missions system and look for a comfortable solution

    How does it work?
    Plugin gives access to native functions and forwards, that allows for creating your achievements/missions and managing them from any plugin. Thanks to its diversity, it's possible to expand plugins, that already exist (such as Zombie or JailBreak for instance), but also to create standalone plugins - it's up to you.

    Commands
    Code:
    sm_ac
    sm_achievements
    sm_mission
    sm_missions
    Configuration
    1. Put package content onto your server (except ago_sample_missions if you don't wish to),
    2. Decide where you want informations to be stored - MySQL or SQLite. Depending on your answer, paste the following config in addons/sourcemod/configs/databases.cfg:

    For SQLite:
    Code:
    "AchievementsGO"
    {
      "driver"    "sqlite"
      "database"  "AchievementsGO"
    }
    For MySQL:
    Code:
    "AchievementsGO"
    {
      "driver"			"mysql"
      "host"				"HOST" // edit
      "database"			"AchievementsGO" // edit (optional)
      "user"				"USER" // edit
      "pass"				"HASLO" // edit
      //"timeout"			"0"
      "port"			"PORT" // edit, 3306 by default
    }
    3. Start creating

    How to create achievement/mission?
    Here's a sample plugin:
    Code:
    #include <AchievementsGO>
    
    int missionOne;
    int missionTwo;
    int missionThree;
    int missionFour;
    int missionFive;
    
    public void OnPluginStart() {
        RegConsoleCmd("sm_pkt", FreePoint);
    }
    
    public Action FreePoint(int client, int args) {
        AGO_AddPoint(client, missionOne);
    }
    
    public void AGO_OnRegisterAchievements() {
        AGO_AddAchievement("Keyboard master", "Type !pkt 5 times", "", 5, 1, OnIdGranted);
        AGO_AddAchievement("Mission two", "Mission two desc\nPrice: XXX", "", 60, 2, OnIdGranted);
        AGO_AddAchievement("Mission three", "Mission three desc\nPrice: XXX", "Catalog 1", 50, 3, OnIdGranted);
        AGO_AddAchievement("Mission four", "Mission four desc\nPrice: XXX", "Catalog 1", 11, 8, OnIdGranted);
        AGO_AddAchievement("Mission five", "Mission five desc\nPrice: +10 HP", "Catalog 2", 48, 1027, OnIdGranted);
    }
    
    public void AGO_OnPlayerAchievementsLoaded(int client) {
      if (AGO_IsAchievementCompleted(client, missionFive)) {
        // here the code, that assigns extra 10HP (some flag for instance)
      }
    }
    
    public void OnIdGranted(int achievementID, int temporaryID) {
        switch(temporaryID) {
            case 1: {
                missionOne = achievementID;
            }
            case 2: {
                missionTwo = achievementID;
            }
            case 3: {
                missionThree = achievementID;
            }
            case 8: {
                missionFour = achievementID;
            }
            case 1027: {
                missionFive = achievementID;
            }
        }
    }
    The place, where achievements are being registered, is function AGO_OnRegisterAchievements(). Inside we use AGO_AddAchievement, that contains a couple arguments:
    Code:
    native bool AGO_AddAchievement(char[] Name, char[] Description, char[] Category, int Value, int temporaryID, Function functionCallback);
    Name - achievement/mission name,
    Category - folder, the achievements will be assigned to. It allows easy groupping and organising according to your needs. When leaving this field blank (""), the achievement will remain without any category,
    Value - amount of points, that needs to be met to consider achievement finished. It can represent anything (ex. amount of required kills, amount of footsteps etc.),
    TemporaryID - auxiliary identifier, that helps to identify achievement, which will be registered by the engine and its ID will return to the callback. It has to be unique only within the single plugin range, where achievements are being implemented,
    functionCallback - independent ID is assigned to each mission. This parameter is just a function, where this information will go to.

    In the previous version, mission's ID was assigned via return (int mission = AGO_AddAchievement...), but it required synchronous and asynchronous queries to be mixed - this solution eliminates the issue.

    When ID is retrieved (assigned to some variable), we can start adding points to it. Most of the time, AGO_AddPoints will be used (as shown in the example above, where "keyboard master" can be finished by typing 5x !pkt command in the chat), but there are couple of native/forwards, that are available here

    AchievementsGO.cfg:
    Code:
    // Show chat notification to all players when player finishes achievement?
    // -
    // Default: "1"
    ago_achievement_notification_all "1"
    
    // Show chat notification when finishing achievement?
    // -
    // Default: "1"
    ago_achievement_notification_chat "1"
    
    // Show HintText notification when finishing achievement?
    // -
    // Default: "1"
    ago_achievement_notification_hint "1"
    
    // After how many days of inactivity player's records will be deleted? (0 - off, not recommended)
    // -
    // Default: "30"
    ago_database_time_kick "30"
    
    // Minimal amount of players for the achievements to work
    // -
    // Default: "3"
    ago_players_amount "3"
    Important note
    Bare in mind, that every time you make a change (ie add new mission or modify existing one), you should restart your server. Reloading plugin is not enough

    Available translations:
    - English,
    - Polish,
    - Swedish (by LaGgLs),
    - French (by Cripix)

    Updates:
    2.0 - first release
    2.1 - added "enforce" parameter in functions that add points. It allows to grant points even if there's not enough players on the server

    Screens (sorry for being lazy and not changing lang to eng. Plugin supports multilang though):
    https://imgur.com/a/9nxGL7W
    https://imgur.com/a/F3wTG4n
    https://imgur.com/a/XLaKtKM

    GitHub Repo

    Repository contains AGO engine and sample achievements, that give zephyrus store credits. Feel free to edit it according to your needs
    __________________

    Last edited by MAGNET12; 06-03-2020 at 17:43.
    MAGNET12 is offline
    eliteroyal
    AlliedModders Donor
    Join Date: Dec 2016
    Location: Moldova
    Old 05-17-2020 , 09:18   Re: AchievementsGO 2.0
    Reply With Quote #2

    Hi, how to use with tibarification shop?
    Attached Files
    File Type: zip shop.zip (507.0 KB, 200 views)
    __________________
    PEACE FROM MOLDOVA
    eliteroyal is offline
    MAGNET12
    Member
    Join Date: Dec 2017
    Old 05-17-2020 , 09:25   Re: AchievementsGO 2.0
    Reply With Quote #3

    This plugin doesn't seem to have any natives that can set the currency. You'd need to modify the plugin and add some
    __________________
    MAGNET12 is offline
    Agent Wesker
    Senior Member
    Join Date: Apr 2012
    Old 05-18-2020 , 12:12   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #4

    Could you add a feature to view a sorted list of top players (most accumulated achievements) and specific players?

    Example:
    /ac magnet12 -> for specific player
    /top_ac ->for list
    Agent Wesker is offline
    LaGgLs
    Senior Member
    Join Date: Apr 2015
    Location: sweden
    Old 05-18-2020 , 13:23   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #5

    Dont know if you want to add it but heres a swedish translations
    Attached Files
    File Type: zip translations.zip (1.0 KB, 148 views)

    Last edited by LaGgLs; 05-18-2020 at 16:06.
    LaGgLs is offline
    MAGNET12
    Member
    Join Date: Dec 2017
    Old 05-19-2020 , 11:40   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #6

    Quote:
    Originally Posted by Agent Wesker View Post
    Could you add a feature to view a sorted list of top players (most accumulated achievements) and specific players?

    Example:
    /ac magnet12 -> for specific player
    /top_ac ->for list
    This feature was available in the old version, however i decided to remove it, since i didn't find it useful
    __________________
    MAGNET12 is offline
    MAGNET12
    Member
    Join Date: Dec 2017
    Old 05-19-2020 , 11:41   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #7

    Quote:
    Originally Posted by LaGgLs View Post
    Dont know if you want to add it but heres a swedish translations
    tack sa mycket!
    __________________
    MAGNET12 is offline
    MAGNET12
    Member
    Join Date: Dec 2017
    Old 05-29-2020 , 18:20   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #8

    @UPDATE

    2.1 - added "enforce" parameter in functions that add points. It allows to grant points even if there's not enough players on the server
    __________________
    MAGNET12 is offline
    XHUNTERX
    Senior Member
    Join Date: Aug 2019
    Location: World
    Old 05-29-2020 , 19:53   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #9

    dude is a great add-on
    can you add them for me

    Code:
    [DEAGLE MASTER]
    [AK47 MASTER]
    thank you so much

    Last edited by XHUNTERX; 05-29-2020 at 20:07.
    XHUNTERX is offline
    alex123pavlov
    Member
    Join Date: Jun 2018
    Location: Moscow
    Old 05-31-2020 , 17:46   Re: [CS:GO] AchievementsGO 2.0 - create your own achievements!
    Reply With Quote #10

    How do I fix the error?
    [SM] Exception reported: Language phrase "MainMenuTitle" not found (arg 6)
    [SM] Blaming: AchievementsGO.smx
    [SM] Call stack trace:
    [SM] [0] Format
    [SM] [1] Line 13. E:\sourcemod\scripting\include\AchievementsGO/AchievementsGO_Menu.sp: ShowAchiewementsMenu
    alex123pavlov is offline
    Reply


    Thread Tools
    Display Modes

    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 08:47.


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