SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 16/08/2011, 03:29 AM   #1
Deskoft
Guest
 
Posts: n/a
Default (LCI) Achievements System


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 Code:
#include <achievements>

And OnGameModeInit:
pawn Code:
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 Code:
/*
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 Code:
/* ***** 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
 * [url]http://www.mozilla.org/MPL/[/url]
 *
 * 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 (C) 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 Code:
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...

Last edited by Deskoft; 24/01/2012 at 06:04 PM.
  Reply With Quote
Old 16/08/2011, 03:32 AM   #2
Hal
High-roller
 
Hal's Avatar
 
Join Date: May 2010
Location: Toronto, Canada
Posts: 1,190
Reputation: 43
Default Re: (LCI) Achievements System

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

Wanna start a project thats NOT sa-mp with me? I have a bunch of server space, PM me.
Hal is offline   Reply With Quote
Old 16/08/2011, 03:41 AM   #3
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 8,103
Reputation: 701
Default Re: (LCI) Achievements System

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...
Scenario is offline   Reply With Quote
Old 16/08/2011, 03:49 AM   #4
Deskoft
Guest
 
Posts: n/a
Default Re: (LCI) Achievements System

Quote:
Originally Posted by Hal View Post
This is a great script, I hope many people will be able to use it!
Thanks, Hal!

Quote:
Originally Posted by RealCop228 View Post
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 With Quote
Old 16/08/2011, 04:14 AM   #5
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,558
Reputation: 60
Default Re: (LCI) Achievements System

For the textdraw, I think it could be improved by making it look nicer. Would be even better if it can be saved.
Retardedwolf is offline   Reply With Quote
Old 16/08/2011, 04:20 AM   #6
Deskoft
Guest
 
Posts: n/a
Default Re: (LCI) Achievements System

Quote:
Originally Posted by Retardedwolf View Post
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 With Quote
Old 16/08/2011, 06:39 AM   #7
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,248
Reputation: 1139
Default Re: (LCI) Achievements System

Quote:
Originally Posted by Retardedwolf View Post
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
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 16/08/2011, 07:39 AM   #8
BuLLeT[LTU]
Huge Clucker
 
BuLLeT[LTU]'s Avatar
 
Join Date: May 2008
Location: Lithuania
Posts: 185
Reputation: 7
Default Re: (LCI) Achievements System

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
__________________

BuLLeT[LTU] is offline   Reply With Quote
Old 16/08/2011, 08:58 AM   #10
Flyfishes
Huge Clucker
 
Flyfishes's Avatar
 
Join Date: Jul 2010
Location: Stockholm, Sweden
Posts: 352
Reputation: 4
Default Re: (LCI) Achievements System

Lorenc_, hooking will also be included in the next version. Stay tuned!
__________________
Flyfishes is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Achievements by Joe Staff (Uses SQLite) Joe Staff Includes 17 08/02/2012 11:58 AM
Achievements Haydz Help Archive 1 17/11/2010 07:09 AM
[HELP] Robbery system, tax system, houseing system Commander_Shaw Help Archive 3 15/09/2010 05:18 AM
[FilterScript] [FS] Achievements 0.9 bogeymanEST Filterscripts 15 08/07/2010 09:13 PM


All times are GMT. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.