Advertisement
deskoft

Untitled

Dec 29th, 2011
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.04 KB | None | 0 0
  1. [PAWN]
  2.  
  3.     /* ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * [url]http://www.mozilla.org/MPL/[/url]
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is the Lawedan Computers, Inc Achievements System.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Magnus Burton (Flyfishes), Zack Moshonas (Hal) and Matthew Striker (Deskoft).
  20.  * Portions created by the Initial Developer are Copyright (C) 2011
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *
  25.  * Adam Booth
  26.  * Jamie Morrison
  27.  * Robin Strumberg
  28.  * Loyd Rafolds
  29.  * All the Lawedan Team!
  30.  *
  31.  * Alternatively, the contents of this file may be used under the terms of
  32.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  33.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  34.  * in which case the provisions of the GPL or the LGPL are applicable instead
  35.  * of those above. If you wish to allow use of your version of this file only
  36.  * under the terms of either the GPL or the LGPL, and not to allow others to
  37.  * use your version of this file under the terms of the MPL, indicate your
  38.  * decision by deleting the provisions above and replace them with the notice
  39.  * and other provisions required by the GPL or the LGPL. If you do not delete
  40.  * the provisions above, a recipient may use your version of this file under
  41.  * the terms of any one of the MPL, the GPL or the LGPL.
  42.  *
  43.  * ***** END LICENSE BLOCK ***** */
  44.  
  45. #if defined _achievements_included
  46.     #endinput
  47. #endif
  48. #define _achievements_included
  49.  
  50. #include <a_samp>
  51. #include <YSI\y_ini>
  52.  
  53. /*
  54. native ShowPlayerAchievement(playerid, short[], title[], text[], fadeout);
  55. native SetAchievementColor(box, color);
  56. */
  57.  
  58. new Text:A_Textdraws[4];
  59.  
  60. public OnGameModeInit()
  61. {
  62.     A_Textdraws[0] = TextDrawCreate(190.000000, 155.000000, "                                                                            ");
  63.     TextDrawBackgroundColor(A_Textdraws[0], 255);
  64.     TextDrawFont(A_Textdraws[0], 1);
  65.     TextDrawLetterSize(A_Textdraws[0], 0.500000, 2.399999);
  66.     TextDrawColor(A_Textdraws[0], -1);
  67.     TextDrawSetOutline(A_Textdraws[0], 0);
  68.     TextDrawSetProportional(A_Textdraws[0], 1);
  69.     TextDrawSetShadow(A_Textdraws[0], 1);
  70.     TextDrawUseBox(A_Textdraws[0], 1);
  71.     TextDrawBoxColor(A_Textdraws[0], 7039829);
  72.     TextDrawTextSize(A_Textdraws[0], 448.000000, 113.000000);
  73.  
  74.     A_Textdraws[1] = TextDrawCreate(172.000000, 147.000000, "NEW ACHIEVEMENT");
  75.     TextDrawBackgroundColor(A_Textdraws[1], 255);
  76.     TextDrawFont(A_Textdraws[1], 1);
  77.     TextDrawLetterSize(A_Textdraws[1], 0.390000, 1.300003);
  78.     TextDrawColor(A_Textdraws[1], -1);
  79.     TextDrawSetOutline(A_Textdraws[1], 1);
  80.     TextDrawSetProportional(A_Textdraws[1], 1);
  81.     TextDrawUseBox(A_Textdraws[1], 1);
  82.     TextDrawBoxColor(A_Textdraws[1], 7027575);
  83.     TextDrawTextSize(A_Textdraws[1], 431.000000, 0.000000);
  84.  
  85.     A_Textdraws[2] = TextDrawCreate(191.000000, 162.000000, "TITLE");
  86.     TextDrawBackgroundColor(A_Textdraws[2], 255);
  87.     TextDrawFont(A_Textdraws[2], 1);
  88.     TextDrawLetterSize(A_Textdraws[2], 0.370000, 0.799999);
  89.     TextDrawColor(A_Textdraws[2], -1);
  90.     TextDrawSetOutline(A_Textdraws[2], 1);
  91.     TextDrawSetProportional(A_Textdraws[2], 1);
  92.  
  93.     A_Textdraws[3] = TextDrawCreate(192.000000, 169.000000, "description of the achievement");
  94.     TextDrawBackgroundColor(A_Textdraws[3], 255);
  95.     TextDrawFont(A_Textdraws[3], 1);
  96.     TextDrawLetterSize(A_Textdraws[3], 0.300000, 0.799999);
  97.     TextDrawColor(A_Textdraws[3], -1);
  98.     TextDrawSetOutline(A_Textdraws[3], 1);
  99.     TextDrawSetProportional(A_Textdraws[3], 1);
  100.     TextDrawUseBox(A_Textdraws[3], 1);
  101.     TextDrawBoxColor(A_Textdraws[3], 623191296);
  102.     TextDrawTextSize(A_Textdraws[3], 446.000000, 2.000000);
  103.     return CallLocalFunction("achievements_OnGameModeInit", "");
  104. }
  105. #if defined _ALS_OnGameModeInit
  106.     #undef OnGameModeInit
  107. #else
  108.     #define _ALS_OnGameModeInit
  109. #endif
  110. #define OnGameModeInit achievements_OnGameModeInit
  111. forward achievements_OnGameModeInit();
  112.  
  113. stock ShowPlayerAchievement(playerid, short[], title[], text[], fadeout)
  114. {
  115.     TextDrawSetString(A_Textdraws[2], title);
  116.     TextDrawSetString(A_Textdraws[3], text);
  117.    
  118.     printf("ACHIEVEMENTS: Gave playerid %d the achievement %s", playerid, short);
  119.  
  120.     for(new i = 0; i < 4; i++) TextDrawShowForPlayer(playerid, A_Textdraws[i]);
  121.    
  122.     SetTimerEx("A_FadeOut", fadeout, false, "i", playerid);
  123.     return 1;
  124. }
  125.  
  126. forward A_FadeOut(playerid);
  127. public A_FadeOut(playerid)
  128. {
  129.     for(new i = 0; i < 4; i++) TextDrawHideForPlayer(playerid, A_Textdraws[i]);
  130.     return 1;
  131. }
  132.  
  133. /*
  134. box types;
  135.     0 - Description box
  136.     1 - NEW ACHIEVEMENT box
  137. */
  138.  
  139. stock SetAchievementColor(box, color)
  140. {
  141.     TextDrawBoxColor(A_TextDraws[box], color);
  142.     return 1;
  143. }
  144. [/PAWN]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement