[Include] (LCI) Achievements System
#1


What is this include?

This include is the LCI Achievements System, developed by the Lawedan Software Development Team for
Lawedan Roleplay, which was released for the San Andreas Multiplayer Community.
This simple, yet useful, project combines textdraws and stocks to create a Achievements System.

This include was originally developed by Magnus Burton (Flyfishes), one of the PAWN Developers for our project, Lawedan Roleplay, but later, we think it's a good contribution to release it. (Take time to read, he is our PAWN developer, therefore, yes, before you reply, we have permission to release this)

We believe this is a great way to contribute to beginner and advanced PAWN developers, as this is a great tool for any kind of server.

How can this be useful?

This simple include can be used in any kind of server.
We can use the example of a deathmatch server, you can recieve achievements like 'First Kill!', '100 Kills!', 'My first house', and several other cases. Roleplay servers, you can have achievements like 'Muderer!', 'Arrested', 'Bad Guy', and several other cases. And the list applies to a long list of different types of gamemodes.


Installation

Installing this include is very simple.
You can download it from pastebin. Place it at the pawno>includes folder.

Then, on your gamemode / filterscript, add this at the top:
pawn Код:
#include <achievements>
And OnGameModeInit:
pawn Код:
public OnGameModeInit()
{
        achievements_OnGameModeInit();
}
Then, you are ready to start adding achievements!

So how does this work?

We have made this as simple as possible, therefore, our current function(s) include:
pawn Код:
/*
ShowPlayerAchievement(playerid, short[], title[], text[], fadeout);
-playerid: The playerid to show the achievement to.
-short[]: Under construction
-title[]: The title of the achievement
-text[]: The content of the achievement
-fadeout: (milliseconds) how long will the timer stay on the screen?
*/

ShowPlayerAchievement(playerid, short[], title[], text[], fadeout);
/*
SetAchievementColor(box, color);
:Sets the achievement color - YOU NEED TO USE IT >AFTER< ShowPlayerAchievement!
-box: 0 Description Box and 1 New Achievement Box.
*/

native SetAchievementColor(box, color);
License

The current license we use is the Mozilla Public License...

pawn Код:
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Lawedan Computers, Inc Achievements System.
 *
 * The Initial Developer of the Original Code is
 * Magnus Burton (Flyfishes), Zack Moshonas (Hal) and Matthew Striker (Deskoft).
 * Portions created by the Initial Developer are Copyright © 2011
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Adam Booth
 * Jamie Morrison
 * Robin Strumberg
 * Loyd Rafolds
 * All the Lawedan Team!
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */
Our quick commands
When I'm about to use a include, the first thing I want to do is check how it works, I usually use a simple command to do this.
So here we have the quick commands, developed using ZCMD, by Hal (one of our developers).
(Thanks to Hal)

pawn Код:
CMD:ach1(playerid, params[])
{
    //ShowPlayerAchievement(playerid, title[], text[], fadeout)
    ShowPlayerAchievement(playerid, "Your first achievement!", "Congrats, you have just done your first achievement!", 5000);
    return 1;
}
   
CMD:ach2(playerid, params[])
{
    //ShowPlayerAchievement(playerid, title[], text[], fadeout)
    ShowPlayerAchievement(playerid, "You have killed someone!", "Congrats, you have just killed someone! Be proud!", 5000);
    return 1;
}
   
CMD:ach3(playerid, params[])
{
    //ShowPlayerAchievement(playerid, title[], text[], fadeout)
    ShowPlayerAchievement(playerid, "Your first house!", "You have just bought a house, congrats! Don't forget to clean your room!", 5000);
    return 1;
}
Screenshot

Here's the screenshot. (Yes, it's a blank script).


Upcoming Features

For the release 2 we have planned the following features:
  • Saving Achievements (and detecting if a player has the achievement)


Please donate to keep us up! Contact me for donation information...
Reply
#2

This is a great script, I hope many people will be able to use it!
Reply
#3

This is very similar to the system found in Raven's Role Play. Nice job though! I'm sure people will find this kind of nice...
Reply
#4

Quote:
Originally Posted by Hal
Посмотреть сообщение
This is a great script, I hope many people will be able to use it!
Thanks, Hal!

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
This is very similar to the system found in Raven's Role Play. Nice job though! I'm sure people will find this kind of nice...
Thank you RealCop228, and yes, I must agree.
I like how this one is dynamic, we plan to be able to change the design colors (that's very simple, and yes, it's coming on the next release).
Reply
#5

For the textdraw, I think it could be improved by making it look nicer. Would be even better if it can be saved.
Reply
#6

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
For the textdraw, I think it could be improved by making it look nicer. Would be even better if it can be saved.
Thank you for your review. I still don't understand what you mean about being 'saved', the idea is to make it fit with any system.
Reply
#7

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
For the textdraw, I think it could be improved by making it look nicer. Would be even better if it can be saved.
True.

Pretty big licence to make for such a small thing, and I'd advise your whole group to hook that function 'achievements_OnGameModeInit()' instead of having to hassle about putting codes.

Its pretty simple to make and takes only 15 minutes, how ever

79 code lines; most textdraw creating

Cool script
Reply
#8

Omg.. I was thinking to add achievements in my new freeroam, i thought it would be more unique, but now it won't :/ But nice include
Reply
#9

Oh, its very nice :P I'll use this
Reply
#10

Lorenc_, hooking will also be included in the next version. Stay tuned!
Reply
#11

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
True.

Pretty big licence to make for such a small thing, and I'd advise your whole group to hook that function 'achievements_OnGameModeInit()' instead of having to hassle about putting codes.

Its pretty simple to make and takes only 15 minutes, how ever

79 code lines; most textdraw creating

Cool script
The length of the license has no relation with the size of the script, that's the Mozilla Public License (found at mozilla.org).

Thank you for your suggestion too!

(I think I mentioned this on the topic) But we are also using this on our script, therefore, we didn't make it too dynamic. Although it's very simple to make, we plan on modyfing the colors and maybe improving the design.

Glad you liked this include.

And thanks everyone else for your comments!
Reply
#12

oh damn ! Epic work ! im gonna use this for sure
Reply
#13

Simple& very nice!
I won't forgot the license.
Reply
#14

Just my POV, but you should either place that message at the top or the bottom of the screen. Also, you might think of saving which achievements a specific user has got so that he won't get it multiple times.
Reply
#15

Thanks everyone for your comments! We really appreciate it!

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Just my POV, but you should either place that message at the top or the bottom of the screen. Also, you might think of saving which achievements a specific user has got so that he won't get it multiple times.
Thank you for giving an honest review, yes, we will include positions for the next release, most likely.
The main idea is to provide an easy and fast textdraw system for this, that was the main idea.
Some users just want the base system, therefore, if we ever save the user statistics, we may use another include, instead of this one, which can be combined, otherwise, I guess it's not a good idea, as the main idea is to provide the base system.
Reply
#16

Nice, I might use it. Still thinking :P
Great job.

The only thing thats annoying is
Quote:

The following errors occurred with your submission:
This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.

Reply
#17

I don't know about the others, but I wouldn't call this a "system". It's just the base ( Textdraws, and a function ).

A system would consist of already be ready to create the achievements on the fly ( Ex: CreateAchievement("Killer", 5000); // Achievement name: Killer, kill 5000 players. ). With this, you still have to create the achievements and all the main structure to run it.

Well, just my thought
Reply
#18

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
I don't know about the others, but I wouldn't call this a "system". It's just the base ( Textdraws, and a function ).

A system would consist of already be ready to create the achievements on the fly ( Ex: CreateAchievement("Killer", 5000); // Achievement name: Killer, kill 5000 players. ). With this, you still have to create the achievements and all the main structure to run it.

Well, just my thought
I accept your suggestion, although I'm afraid your definition of a system is wrong. A system is 'A set of connected things or parts forming a complex whole, in particular.'
With this you can create a textdraw on the fly, although, I have already explained on the post above why we are not saving the achievements.
Reply
#19

Awesome script! useful for Stunt servers
Reply
#20

Update 0.2
We have just updated the achievements system! This is version 0.2, and now you can change the color of the textdraw (check the main topic for more information).
Please note we are updating the information on the main topic!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)