OtaconEvil

[FS] Crear Lomas de Burro (InGame)]

Jul 18th, 2013
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.36 KB | None | 0 0
  1. // OTACON
  2. // www.pawnoscripting.com
  3. //==============================================================================//
  4. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  5.  
  6. /*
  7. Instalacion:
  8.  
  9. 1) Poner "LomasOtacon.amx y LomasOtacon.pwn" en la carpeta filterscripts.
  10. 2) Abrir server.cfg y añádase "LomasOtacon" a la línea filterscript.
  11. 3) Siga los pasos InGame.
  12.  
  13. Listo, A Crear Lomas!. ;)
  14. */
  15.  
  16. //===========================[INCLUDEs]========================//
  17. #include <a_samp>
  18. #include <core>
  19. #include <float>
  20. #include <gl_common>
  21.  
  22. #pragma tabsize 0
  23. //=============================[NEWs]===========================//
  24. new Text:TexLOMAS;
  25. new CreatedLomas[200];
  26. new CreatedLoma = 0;
  27.  
  28. new Text:RandomOtacon;
  29. new MensajesRandom[][] =
  30. {
  31.     "~w~- <CREAR LOMAS DE BURRO> - ~g~<InGame> - ~y~By Otacon -", //Maximo 50 Caracteres.
  32.     "~g~- <CREAR LOMAS DE BURRO> - ~w~<InGame> - ~y~By Otacon -",
  33.     "~w~- <CREAR LOMAS DE BURRO> - ~g~<InGame> - ~y~By Otacon -"
  34. };
  35. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  36.  
  37. public OnFilterScriptInit()
  38. {
  39.     TexLOMAS = TextDrawCreate(481.000000,171.000000,"~y~   - Crear Lomas de Burro ~y~In-Game - ~n~~n~~w~  Utiliza los Siguientes Comando:~n~~n~ ~g~/Loma ~w~ (Nombre del Archivo)~n~ ~g~/QuitarLomas ~w~ (Quitar las Lomas Colocadas.)~n~ ~g~/Borrar ~w~ (Borrar TextDraw)~n~ ~g~/Info ~w~ (Ver TextDraw)~n~~n~~n~ ~y~~]~ BY OTACON ~]~");
  40.     TextDrawUseBox(TexLOMAS,1);
  41.     TextDrawBoxColor(TexLOMAS,0x0000155);
  42.     TextDrawTextSize(TexLOMAS,630.000000,250.000000);
  43.     TextDrawAlignment(TexLOMAS,0);
  44.     TextDrawBackgroundColor(TexLOMAS,0x000000ff);
  45.     TextDrawFont(TexLOMAS,1);
  46.     TextDrawLetterSize(TexLOMAS,0.260000,1.200000);
  47.     TextDrawColor(TexLOMAS,0xffffffff);
  48.     TextDrawSetOutline(TexLOMAS,1);
  49.     TextDrawSetProportional(TexLOMAS,1);
  50.     TextDrawSetShadow(TexLOMAS,1);
  51.    
  52.     RandomOtacon = TextDrawCreate(38.000000, 428.000000,"-_-");
  53.     TextDrawAlignment(RandomOtacon,0);
  54.     TextDrawBackgroundColor(RandomOtacon,0x000000ff);
  55.     TextDrawFont(RandomOtacon,1);
  56.     TextDrawLetterSize(RandomOtacon,0.430000, 1.400000);
  57.     TextDrawColor(RandomOtacon,0xffffffff);
  58.     TextDrawSetOutline(RandomOtacon,1);
  59.     TextDrawSetProportional(RandomOtacon,1);
  60.     TextDrawSetShadow(RandomOtacon,1);
  61.     SetTimer("RandomMessageTimer",500,1);
  62.     return 1;
  63. }
  64.  
  65. public OnFilterScriptExit()
  66. {
  67.     return 1;
  68. }
  69.  
  70. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  71. main()
  72. {
  73.     print("                                ");
  74.     print("       |||||||                  ");
  75.     print("     \\  - -  //                ");
  76.     print("      (  @ @  )                 ");
  77.     print(" +--oOOo-(_)-------------------+");
  78.     print(" |  [FS] Crear Lomas de Burro  |");
  79.     print(" |         - (InGame) -        |");
  80.     print(" |      CREADO POR: OTACON     |");
  81.     print(" |    www.pawnoscripting.com   |");
  82.     print(" +--------------------oOOo-----+");
  83. }
  84. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  85.  
  86. public OnPlayerSpawn(playerid)
  87. {
  88.     TextDrawShowForPlayer(playerid, TexLOMAS);
  89.     TextDrawShowForPlayer(playerid, RandomOtacon);
  90.     return 1;
  91. }
  92.  
  93. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  94. public OnPlayerCommandText(playerid, cmdtext[])
  95. {
  96.    new string[256];
  97.    new cmd[256], idx;
  98.    new tmp[256];
  99.    cmd = strtok(cmdtext, idx);
  100.    tmp = strtok(cmdtext, idx);
  101.    
  102. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  103.  if(strcmp(cmd, "/Loma", true) == 0) {
  104.  
  105.    if(!strlen(tmp)) {
  106.       SendClientMessage(playerid, 0xFFFFFFFF, "[ ! ] Usa: /Loma {Nombre}");
  107.     return 1;
  108.    }
  109.         new Float:X, Float:Y, Float:Z;
  110.         new Float:rx, Float:ry, Float:rz;
  111.         GetPlayerPos(playerid, X, Y, Z);
  112.         GetPlayerFacingAngle(playerid, rz);
  113.         new Loma = CreateObject(13640, X, Y, Z-1.9, 0.0, 0.0, rz+180);
  114.         CreatedLomas[CreatedLoma] = Loma;
  115.         CreatedLoma++;
  116.  
  117.         if(!strlen(tmp)){SendClientMessage(playerid, 0xC6C6C8FF, "");return 1;}
  118.         new nombre[32]; strmid(nombre, tmp, 0, strlen(tmp), sizeof(nombre));
  119.         new File:file;
  120.         format(string,sizeof(string),"%s.txt",nombre);
  121.         file = fopen(string, io_append);
  122.         fwrite(file,"//=======================================================================\r\n");
  123.         fwrite(file, "              [FS] Crear Lomas de Burro (InGame). By Otacon             \r\n");
  124.         fwrite(file,"//=======================================================================\r\n");
  125.         fwrite(file,"   Agregar en OnGameModeInit() o en OnFilterScriptInit():                \r\n\r\n");
  126.         format(string, sizeof string, "   CreateObject(13640,%0.4f, %0.4f, %0.4f, %0.4f, %0.4f, %0.4f);\r\n\r\n",X, Y, Z-1.9, rx, ry, rz+180);
  127.         fwrite(file,string);
  128.         fwrite(file,"//=======================================================================\r\n//*\r\n");
  129.         fclose(file);
  130.         SendClientMessage(playerid, 0x009400FF, "[ ! ] Se Ha Creado y Guardado con Exito La Loma de Burro en /scriptfiles");
  131.    return 1;
  132. }
  133. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  134.     // Borrar TextDraw.
  135.     if (strcmp("/Borrar", cmdtext, true, 10) == 0)
  136.     {
  137.         TextDrawHideForPlayer(playerid, TexLOMAS);
  138.         TextDrawHideForPlayer(playerid, RandomOtacon);
  139.         return 1;
  140.     }
  141. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  142.     // Poner de Nuevo el TextDraw.
  143.     if (strcmp("/Info", cmdtext, true, 10) == 0)
  144.     {
  145.         TextDrawShowForPlayer(playerid, TexLOMAS);
  146.         TextDrawShowForPlayer(playerid, RandomOtacon);
  147.         return 1;
  148.     }
  149. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  150.     // Quitar Todas las Lomas Colocadas.
  151.     if (strcmp("/QuitarLomas", cmdtext, true, 10) == 0)
  152.     {
  153.         for(new i = 0; i <= CreatedLomas[i]; i++) DestroyObject(CreatedLomas[i]);
  154.         SendClientMessage(playerid, 0xC6C6C8FF, "[ ! ] Has Quitado Todas las Lomas de Burro.");
  155.         return 1;
  156.     }
  157.     return 0;
  158. }
  159. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  160. forward RandomMessageTimer();
  161. public RandomMessageTimer()
  162. {
  163.     TextDrawSetString(RandomOtacon, MensajesRandom[random(sizeof(MensajesRandom))]);
  164.     return 1;
  165. }
  166. //==============================================================//
  167.  
  168. // OTACON
  169. // www.pawnoscripting.com
  170. //============[[FS] Crear Lomas de Burro (InGame)]==============//
  171. //==============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment