Guest User

Untitled

a guest
Oct 6th, 2011
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. /*
  2. ==================================================
  3. |FS By Christian_David |
  4. |Email: [email protected] |
  5. | |
  6. |Defina o IP do Teamspeak e do Servidor Abaixo |
  7. |Para nao haver conflitos ;) |
  8. | |
  9. |caso deseje editar e postar em algum blog |
  10. |por favor não retirar os creditos originais! |
  11. ==================================================
  12. */
  13. #define TS "127.0.0.1:7878"
  14. #define SV "127.0.0.1:7777"
  15.  
  16. #include <a_samp>
  17. forward AntiDivulguer(texto[]);
  18. forward IPDivulguerLog(playerid,string[]);
  19. public OnPlayerText(playerid,text[])
  20. {
  21. new str[256];
  22. if(AntiDivulguer(text))
  23. {
  24. SendClientMessageToAll(0xcc2d2dFF,"===============================");
  25. format(str,sizeof(str),"%s é Um Noob FDP e n Sabe Divulgar",pNome(playerid));
  26. SendClientMessageToAll(0x2d78ccFF,str);
  27. SendClientMessageToAll(0x2d78ccFF,"Ai Vem Divulga Aqui só pra dizer q é bomzão");
  28. SendClientMessageToAll(0x2d78ccFF,"Toma Um Ban ai fdp pra aprender!");
  29. SendClientMessageToAll(0x2d78ccFF,"e Volta pro seu server lixo!");
  30. SendClientMessageToAll(0xcc2d2dFF,"===============================");
  31. IPDivulguerLog(playerid,text);
  32. Ban(playerid);
  33. return 1;
  34. }
  35. return 1;
  36. }
  37. public AntiDivulguer(texto[])
  38. {
  39. new IPTent[4][128],IPTentPort[1][128],ipcompleto[256];
  40. split(texto,IPTent,'.');
  41. split(texto,IPTentPort,':');
  42. format(ipcompleto,sizeof(ipcompleto),"%d.%d.%d.%d:%d",strval(IPTent[0]),strval(IPTent[1]),strval(IPTent[2]),strval(IPTent[3]),strval(IPTentPort[0]));
  43. if(strval(IPTent[1])>0&&strval(IPTent[2])>0&&strval(IPTent[3])>0&&strcmp(SV,texto,true)==-1&&strcmp(TS,texto,true)==-1)
  44. {
  45. return 1;
  46. }
  47. return 0;
  48. }
  49. stock split(const strsrc[], strdest[][], delimiter)
  50. {
  51. new i, li;
  52. new aNum;
  53. new len;
  54. while(i <= strlen(strsrc)){
  55. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  56. len = strmid(strdest[aNum], strsrc, li, i, 128);
  57. strdest[aNum][len] = 0;
  58. li = i+1;
  59. aNum++;
  60. }
  61. i++;
  62. }
  63. return 1;
  64. }
  65. stock pNome(playerid)
  66. {
  67. new nome[MAX_PLAYER_NAME];
  68. GetPlayerName(playerid,nome,sizeof(nome));
  69. return nome;
  70. }
  71. public IPDivulguerLog(playerid,string[])
  72. {
  73. new entry[128],dia,mes,ano,hora,minuto,segundo;
  74. gettime(hora,minuto,segundo);
  75. getdate(ano,mes,dia);
  76. format(entry, sizeof(entry), "[%s][%d/%d/%d|%d:%d:%d]: %s\n",pNome(playerid),dia,mes,ano,hora,minuto,segundo,string);
  77. new File:hFile;
  78. hFile = fopen("ServidoresNbs.log", io_append);
  79. fwrite(hFile, entry);
  80. fclose(hFile);
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment