Advertisement
OtaconEvil

[FS] Fàcil Datos del Tiempo By OTACON

Sep 21st, 2013
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.70 KB | None | 0 0
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *            Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *              Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                    FULLY spaces Theft Credit or
  33.     *             Publication of this FILTERSCRIPT without my permission.
  34. */
  35. #include <a_samp>
  36. #include <zcmd>
  37. #define CALLBACK:%0(%1) forward%0(%1); public%0(%1)
  38. #define ENGLISH true
  39. #define SPANISH false
  40. static Text:DateTD[MAX_PLAYERS],bool:TypeDate;
  41.  
  42. CALLBACK: OnFilterScriptInit() {
  43.     print("\n**************************************");
  44.     print("            Easy Time Data.             ");
  45.     print("           Date: 21/09/2013             ");
  46.     print("            Author: OTACON              ");
  47.     print("   --* Downloaded with Success!!. *--   ");
  48.     print("***************************************\n");
  49.     SendRconCommand("hostname Easy Time Data. ");
  50.     SendRconCommand("gamemodetext By OTACON");
  51.    
  52.     SetTimer("UpdateDate", 1*1000, true);
  53.     TypeDate=ENGLISH;
  54.     return true;
  55. }
  56. CALLBACK: OnFilterScriptExit() {
  57.     print("\n**************************************");
  58.     print("            Easy Time Data.             ");
  59.     print("           Date: 21/09/2013             ");
  60.     print("            Author: OTACON              ");
  61.     print("     --* Loaded with Success!!. *--     ");
  62.     print("***************************************\n");
  63.     SendRconCommand("hostname Easy Time Data. ");
  64.     SendRconCommand("gamemodetext By OTACON");
  65.     return true;
  66. }
  67. CALLBACK: OnPlayerConnect(playerid) {
  68.     DateTD[playerid] = TextDrawCreate(413.000000, 3.000000, "_");
  69.     TextDrawAlignment(DateTD[playerid], 2);
  70.     TextDrawBackgroundColor(DateTD[playerid], 255);
  71.     TextDrawFont(DateTD[playerid], 2);
  72.     TextDrawLetterSize(DateTD[playerid], 0.200000, 1.600000);
  73.     TextDrawColor(DateTD[playerid], -1);
  74.     TextDrawSetOutline(DateTD[playerid], 1);
  75.     TextDrawSetProportional(DateTD[playerid], 1);
  76.     TextDrawUseBox(DateTD[playerid], 1);
  77.     TextDrawBoxColor(DateTD[playerid], 0x00000055);
  78.     TextDrawTextSize(DateTD[playerid], 0.000000, 382.000000);
  79.     return true;
  80. }
  81. CALLBACK: OnPlayerDisconnect(playerid, reason) {
  82.     TextDrawHideForPlayer(playerid,DateTD[playerid]);
  83.     TextDrawDestroy(DateTD[playerid]);
  84.     return true;
  85. }
  86. CALLBACK: OnPlayerSpawn(playerid) {
  87.     TextDrawShowForPlayer(playerid,DateTD[playerid]);
  88.     return true;
  89. }
  90. CALLBACK: UpdateDate() {
  91.     for(new player, j = GetMaxPlayers(); player != j; player++) {
  92.         if(!IsPlayerConnected(player)) continue;
  93.         new data[100],text[3][20],date[6],weather[5];
  94.         gettime(date[0],date[1],date[2]);
  95.         getdate(date[3],date[4],date[5]);
  96.         SetWorldTime(date[0]);
  97.         if(!TypeDate) {
  98.         switch(date[4]) {
  99.             case 1: text[0]="Enero";
  100.             case 2: text[0]="Febrero";
  101.             case 3: text[0]="Marzo";
  102.             case 4: text[0]="Abril";
  103.             case 5: text[0]="Mayo";
  104.             case 6: text[0]="Junio";
  105.             case 7: text[0]="Julio";
  106.             case 8: text[0]="Agosto";
  107.             case 9: text[0]="Septiembre";
  108.             case 10: text[0]="Octubre";
  109.             case 11: text[0]="Noviembre";
  110.             case 12: text[0]="Diciembre"; }
  111.         switch(date[0]) {
  112.             case 0..12: text[1]="AM";
  113.             case 13..23: text[1]="PM"; }
  114.         GetServerVarAsString("weather", weather, sizeof(weather));
  115.         switch(strval(weather)) {
  116.             case 1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40: text[2]="Buen Tiempo";
  117.             case 9,19,20,31,32: text[2]="Nublado";
  118.             default: text[2]="Sin Datos"; }
  119.         format(data, sizeof(data), "~g~Hora: ~w~%02d:%02d~r~:%02d ~p~%s ~g~Fecha: ~w~%02d de %s del %02d ~g~Clima: ~w~%s",\
  120.         date[0],date[1],date[2],text[1],date[5],text[0],date[3],text[2]);
  121.         TextDrawSetString(DateTD[player], data);
  122.         } else {
  123.         switch(date[4]) {
  124.             case 1: text[0]="January";
  125.             case 2: text[0]="February";
  126.             case 3: text[0]="March";
  127.             case 4: text[0]="April";
  128.             case 5: text[0]="May";
  129.             case 6: text[0]="June";
  130.             case 7: text[0]="July";
  131.             case 8: text[0]="August";
  132.             case 9: text[0]="September";
  133.             case 10: text[0]="October";
  134.             case 11: text[0]="November";
  135.             case 12: text[0]="December"; }
  136.         switch(date[0]) {
  137.             case 0..12: text[1]="AM";
  138.             case 13..23: text[1]="PM"; }
  139.         GetServerVarAsString("weather", weather, sizeof(weather));
  140.         switch(strval(weather)) {
  141.             case 1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40: text[2]="Good Time";
  142.             case 9,19,20,31,32: text[2]="bad Weather";
  143.             default: text[2]="No Data"; }
  144.         format(data, sizeof(data), "~g~Time: ~w~%02d:%02d~r~:%02d ~p~%s ~g~Date: ~w~%02d of %s the %02d ~g~Weather: ~w~%s",\
  145.         date[0],date[1],date[2],text[1],date[5],text[0],date[3],text[2]);
  146.         TextDrawSetString(DateTD[player], data);
  147.         }
  148.     } return true;
  149. }
  150. /*
  151.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  152.     *
  153.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  154.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  155.     *
  156.     * Codigo Creado Por OTACON
  157.     *
  158.     * CREDITOS:
  159.     *     OTACON: Realizacion y Idea de creacion del code.
  160.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  161.     *
  162.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  163.     *
  164.     *            Prohibido TOTALMENTE el Robo de Créditos o la
  165.     *              Publicación de este FILTERSCRIPT sin Mi Permiso.
  166. */
  167. /*
  168.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  169.     *
  170.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  171.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  172.     *
  173.     * Code Created By OTACON
  174.     *
  175.     * CREDITS:
  176.     *     OTACON: Idea Making and code creation.
  177.     *     YOUR: Modification freely respecting the above ;).
  178.     *
  179.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  180.     *
  181.     *                    FULLY spaces Theft Credit or
  182.     *             Publication of this FILTERSCRIPT without my permission.
  183. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement