Guest User

[FS] Add/Changed/Deleted Word Above Char

a guest
Feb 26th, 2011
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.96 KB | None | 0 0
  1. //                    CRÉDITOS:
  2.  
  3. //[iPs]Av4stizin e a [iPs]Team
  4.  
  5. //                    IDEIA:
  6.  
  7. // A Ideia veio do Ragnarok online,Eu estava a jogar lá e no mercado poderia digitar /algumcmd [frase] e ficaria o chatbubble lá encima
  8. // da cabeça do cara...
  9. //                    CONCLUSÃO:
  10.  
  11. //Tive a ideia de criar o projeto pelo Ragnarok Brasil Online [RBO]
  12.  
  13. //                      META:
  14.  
  15. //Tem como meta criar uma frase acima da cabeça da pessoa. ^^
  16.  
  17. // Includes
  18. #include <a_samp>
  19.  
  20. // Pragmas
  21. #pragma tabsize 0
  22.  
  23. //Cores
  24. #define Cor1    0xFF0000AA
  25. #define Cor2    0xFFFF00AA
  26. #define Cor3    0x0080FFAA
  27. #define Cor4    0xFF80C0AA
  28. #define Cor5    0xFF80FFAA
  29. #define Cor6    0xFFFFFFAA
  30. #define Cor7    0x808080AA
  31. #define Cor8    0x000000AA
  32. #define Cor9    0x804000AA
  33. #define Cor10   0x00FFFFAA
  34.  
  35. //Defines
  36. #if defined FILTERSCRIPT
  37.  
  38. public OnFilterScriptInit()
  39. {
  40.     print("\n--------------------------------------");
  41.     print(" [FS] Texto Acima da Cabeça");
  42.     print(" Por: [iPs]Av4stizin e [iPs]Team");
  43.     print("--------------------------------------\n");
  44.     return 1;
  45. }
  46.  
  47. public OnFilterScriptExit()
  48. {
  49.     return 1;
  50. }
  51.  
  52. #else
  53.  
  54. new TextoColocado[MAX_PLAYERS];
  55. new TextoTirado[MAX_PLAYERS];
  56. new Texto[MAX_PLAYERS];
  57.  
  58. main()
  59. {
  60.     print("\n----------------------------------");
  61.     print(" [FS] Texto Acima da Cabeça");
  62.     print(" Por: [iPs]Av4stizin e [iPs]Team");
  63.     print("----------------------------------\n");
  64. }
  65.  
  66. #endif
  67.  
  68. public OnPlayerConnect(playerid)
  69. {
  70.     SendClientMessage(playerid, Cor6, "[Av4stChat] Sistema de Texto acima da Cabeça feito por [iPs]Av4stizin e [iPs]Team");
  71.     return 1;
  72. }
  73.  
  74. public OnPlayerSpawn(playerid)
  75. {
  76.     SendClientMessage(playerid, Cor6, "[Av4stChat] Sistema de Texto acima da Cabeça feito por [iPs]Av4stizin e [iPs]Team");
  77.     return 1;
  78. }
  79.  
  80. strtok(const string[], &index)
  81. {
  82.     new length = strlen(string);
  83.     while ((index < length) && (string[index] <= ' '))
  84.     {
  85.         index++;
  86.     }
  87.  
  88.     new offset = index;
  89.     new result[20];
  90.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  91.     {
  92.         result[index - offset] = string[index];
  93.         index++;
  94.     }
  95.     result[index - offset] = EOS;
  96.     return result;
  97. }
  98.  
  99. public OnPlayerText(playerid, text[])
  100. {
  101.     if(TextoTirado[playerid] == 1)
  102.     {
  103.      return 1;
  104.     }
  105.     if(TextoColocado[playerid] == 1)
  106.     {
  107.      SetPlayerChatBubble(playerid, Texto, 0xFF0000FF, 100.0, 10000);
  108.      return 1;
  109.     }
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerCommandText(playerid, cmdtext[])
  114. {
  115.     new tmp[256];
  116.     new cmd[256];
  117.     new idx;
  118.     new string[256];
  119.     new nomefdp[MAX_PLAYER_NAME];
  120.     cmd = strtok(cmdtext, idx);
  121.     //-----------------------
  122.     if (strcmp("/creditos", cmdtext, true, 10) == 0)
  123.     {
  124.         if(!IsPlayerConnected(playerid))
  125.         {
  126.          SendClientMessage(playerid, Cor6, "[ERRO] Não estás conectado!");
  127.          return 1;
  128.         }
  129.         SendClientMessage(playerid, Cor1, "~. Créditos .~");
  130.         SendClientMessage(playerid, Cor2, "- [iPs]Av4stizin");
  131.         SendClientMessage(playerid, Cor2, "- [iPs]Team");
  132.         return 1;
  133.     }
  134.     if (strcmp("/cmdsfs", cmdtext, true, 10) == 0)
  135.     {
  136.         if(!IsPlayerConnected(playerid))
  137.         {
  138.          SendClientMessage(playerid, Cor6, "[ERRO] Não estás conectado!");
  139.          return 1;
  140.         }
  141.         SendClientMessage(playerid, Cor6, "~. Comandos Texto Acima da Cabeça .~");
  142.         SendClientMessage(playerid, Cor1, "/addfrase /mudarfrase /tirarfrase /minhafrase /creditos");
  143.         return 1;
  144.     }
  145.     if (strcmp("/tirarfrase", cmdtext, true, 10) == 0)
  146.     {
  147.         if(!IsPlayerConnected(playerid))
  148.         {
  149.          SendClientMessage(playerid, Cor6, "[ERRO] Não estás conectado!");
  150.          return 1;
  151.         }
  152.         TextoTirado[playerid] = 1;
  153.         SendClientMessage(playerid, Cor2, "Tiraste a frase que estava acima de seu char!");
  154.         return 1;
  155.     }
  156.     if (strcmp("/mudarfrase", cmdtext, true, 10) == 0)
  157.     {
  158.         if(!IsPlayerConnected(playerid))
  159.         {
  160.          SendClientMessage(playerid, Cor6, "[ERRO] Não estás conectado!");
  161.          return 1;
  162.         }
  163.         tmp = strtok(cmdtext, idx);
  164.         if(!strlen(tmp))
  165.         {
  166.          SendClientMessage(playerid, Cor6, "USE: /mudarfrase [Nova Frase]");
  167.          return 1;
  168.         }
  169.         TextoColocado[playerid] = 1;
  170.         GetPlayerName(playerid,nomefdp,sizeof(nomefdp));
  171.         format(string, sizeof(string), "[Av4sChat] %s adicionou a frase: [%s]!",nomefdp,Texto);
  172.         SendClientMessageToAll(Cor6,string);
  173.         return 1;
  174.     }
  175.     if (strcmp("/addfrase", cmdtext, true, 10) == 0)
  176.     {
  177.         new k=0;
  178.         if(!IsPlayerConnected(playerid))
  179.         {
  180.          SendClientMessage(playerid, Cor6, "[ERRO] Não estás conectado!");
  181.          return 1;
  182.         }
  183.         tmp = strtok(cmdtext, idx);
  184.         if(!strlen(tmp))
  185.         {
  186.          SendClientMessage(playerid, Cor6, "USE: /addfrase [Frase]");
  187.          return 1;
  188.         }
  189.         format(string, sizeof(string), "[Av4sChat] Frase Adicionada: [%s]!", Texto);
  190.         SendClientMessage(k,Cor3,string);
  191.         return 1;
  192.     }
  193.     if(strcmp("/minhafrase",cmdtext, true, 10) == 0)
  194.     {
  195.      new k=0;
  196.      format(string, sizeof(string), "[Av4sChat] Sua frase é [%s]!", Texto);
  197.      SendClientMessage(k,Cor3,string);
  198.      return 1;
  199.     }
  200.     return 0;
  201. }
Advertisement
Add Comment
Please, Sign In to add comment