Advertisement
AleeFerreira

Checkpoint Creator - BY AleeFerreira

Jan 25th, 2012
1,012
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.31 KB | None | 0 0
  1. /*
  2.                             Checkpoint Creator v1.0
  3.                                 by AleeFerreira
  4.                                
  5.                                 * Como utilizar:
  6.  
  7. - Vá no local que você deseja adicionar o checkpoint
  8. - digite /criarcheckpoint e siga os dialogs
  9. - você também pode adicionar um 3DText em cima dele após criar o check *-*
  10.  
  11. OBS: O script foi feito para as pessoas que usam cpstream,
  12. caso você não use em seu gamemode, talvez esse creator não irá ajudá-lo muito!
  13. Na próxima versão estarei adicionando uma opção para quem usa cpstream ou SetPlayerCheckpoint!
  14. */
  15.  
  16. #include <a_samp>
  17. #include <zcmd>
  18. #include <cpstream>
  19.  
  20. new Float:PosX;
  21. new Float:PosY;
  22. new Float:PosZ;
  23. new textoinput[230];
  24. new File: Arquivo;
  25. new MSG[230];
  26.  
  27. public OnFilterScriptInit()
  28. {
  29.     print("\n***************************************");
  30.     print(" Checkpoint Creator by AleeFerreira");
  31.     print("             Carregando.. ");
  32.     print("***************************************\n");
  33.     return 1;
  34. }
  35.  
  36. public OnFilterScriptExit()
  37. {
  38.     print("\n***************************************");
  39.     print(" Checkpoint Creator by AleeFerreira");
  40.     print("             Descarregando.. ");
  41.     print("***************************************\n");
  42.     return 1;
  43. }
  44.  
  45.  
  46. public OnPlayerConnect(playerid)
  47. {
  48.     SendClientMessage(playerid,0x004CB1AA,"Digite /criarcheckpoint para criar um checkpoint!");
  49.     SendClientMessage(playerid,0x004CB1AA,"Checkpoint Creator v1.0 by AleeFerreira - /creditoscreator");
  50.     return 1;
  51. }
  52.  
  53. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  54. {
  55.     if(dialogid == 9853)
  56.     {
  57.         if(response)
  58.         {
  59.             GetPlayerPos(playerid, PosX, PosY, PosZ);
  60.             CPS_AddCheckpoint(PosX,PosY,PosZ, 2.0, 40);
  61.             SendClientMessage(playerid,0x004CB1AA,"Checkpoint criado com sucesso!");
  62.             Arquivo = fopen("/Checkpoints.txt",io_append);
  63.             format(MSG,230,"CPS_AddCheckpoint(%f,%f,%f, 1.0, 40);\r\n",PosX,PosY,PosZ);
  64.             fwrite(Arquivo, MSG);
  65.             fclose(Arquivo);
  66.             ShowPlayerDialog(playerid,9854,DIALOG_STYLE_MSGBOX,"Checkpoint Creator by AleeFerreira","Você deseja adicionar um 3Dtext no checkpoint?","Sim","Nao");
  67.         }
  68.         else
  69.         {
  70.         }
  71.     }
  72.     if(dialogid == 9854)
  73.     {
  74.         if(response)
  75.         {
  76.             ShowPlayerDialog(playerid,9974,DIALOG_STYLE_INPUT,"Checkpoint Creator by AleeFerreira","Digite o texto a ser mostrado:","Continuar","Sair");
  77.         }
  78.         else
  79.         {
  80.         }
  81.     }
  82.    
  83.     if(dialogid == 9974)
  84.     {
  85.         if(response)
  86.         {
  87.             strmid( textoinput, ( inputtext ), 0, strlen( inputtext ), 255 );
  88.             ShowPlayerDialog(playerid,9645,DIALOG_STYLE_LIST,"Checkpoint Creator by AleeFerreira","{004CB1}COR AZUL\n{DB4CC0}COR ROSA\n{00020F}COR PRETA\n{FFFFFF}COR BRANCA\n{00AC00}COR VERDE\n{F6F62D}COR AMARELO","Selecionar","Sair");
  89.         }
  90.         else
  91.         {
  92.         }
  93.     }
  94.     if(dialogid == 9645)
  95.     {
  96.         if(response)
  97.         {
  98.             if(listitem == 0)
  99.             {
  100.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  101.                 Create3DTextLabel(textoinput, 0x004CB1AA, PosX, PosY, PosZ, 10, 0, -1);
  102.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  103.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  104.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0x004CB1AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  105.                 fwrite(Arquivo, MSG);
  106.                 fclose(Arquivo);
  107.             }
  108.             if(listitem == 1)
  109.             {
  110.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  111.                 Create3DTextLabel(textoinput, 0xDB4CC0AA, PosX, PosY, PosZ, 10, 0, -1);
  112.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  113.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  114.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0xDB4CC0AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  115.                 fwrite(Arquivo, MSG);
  116.                 fclose(Arquivo);
  117.             }
  118.             if(listitem == 2)
  119.             {
  120.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  121.                 Create3DTextLabel(textoinput, 0x00020FAA, PosX, PosY, PosZ, 10, 0, -1);
  122.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  123.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  124.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0x00020FAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  125.                 fwrite(Arquivo, MSG);
  126.                 fclose(Arquivo);
  127.             }
  128.             if(listitem == 3)
  129.             {
  130.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  131.                 Create3DTextLabel(textoinput, 0xFFFFFFAA, PosX, PosY, PosZ, 10, 0, -1);
  132.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  133.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  134.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0xFFFFFFAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  135.                 fwrite(Arquivo, MSG);
  136.                 fclose(Arquivo);
  137.             }
  138.             if(listitem == 4)
  139.             {
  140.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  141.                 Create3DTextLabel(textoinput, 0x00AC00AA, PosX, PosY, PosZ, 10, 0, -1);
  142.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  143.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  144.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0x00AC00AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  145.                 fwrite(Arquivo, MSG);
  146.                 fclose(Arquivo);
  147.             }
  148.             if(listitem == 5)
  149.             {
  150.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  151.                 Create3DTextLabel(textoinput, 0xF6F62DAA, PosX, PosY, PosZ, 10, 0, -1);
  152.                 SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
  153.                 Arquivo = fopen("/Checkpoints.txt",io_append);
  154.                 format(MSG,230,"Create3DTextLabel(\"%s\", 0xF6F62DAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
  155.                 fwrite(Arquivo, MSG);
  156.                 fclose(Arquivo);
  157.             }
  158.             if(listitem == 6)
  159.             {
  160.             }
  161.         }
  162.         else
  163.         {
  164.         }
  165.     }
  166.     return 1;
  167. }
  168.  
  169. //****************************** COMMANDS :) ******************************
  170.  
  171. CMD:criarcheckpoint(playerid)
  172. {
  173.     ShowPlayerDialog(playerid,9853,DIALOG_STYLE_MSGBOX,"Checkpoint Creator by AleeFerreira","Você deseja criar um checkpoint aqui?","Sim","Nao");
  174.     return true;
  175. }
  176.  
  177. CMD:creditoscreator(playerid)
  178. {
  179.     ShowPlayerDialog(playerid,9322,DIALOG_STYLE_MSGBOX,"Checkpoint Creator Créditos","AleeFerreira - Criador\nZeeX - Zcmd\n[MPA]matraka_IDG - cpstream\nEquipe SA-MP For All","OK","Sair");
  180.     return true;
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement