16.08.2011, 02:29
(
Последний раз редактировалось Deskoft; 24.01.2012 в 17:04.
)
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>
pawn Код:
public OnGameModeInit()
{
achievements_OnGameModeInit();
}
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);
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 ***** */
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;
}
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...