Advertisement
Guest User

TEPMUHATOP

a guest
Mar 25th, 2011
390
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <MXini>
  3. new Zatik[MAX_PLAYERS];
  4. new ZatikTimer[MAX_PLAYERS];
  5. new ZatikLold[MAX_PLAYERS];
  6. new AnekDotTimer;
  7. new string[1024];
  8. new BotOtveti[200][2][512];
  9. new AnekdotiOn;
  10. new schet;
  11. new bannedweapons[] = {35,36,38};
  12. public OnPlayerText(playerid,text[])
  13. {
  14. for(new i = 0;i<sizeof(BotOtveti);i++)
  15. {
  16. if(strfind(text,BotOtveti[i][0],true)!= -1)
  17. {
  18. SetTimerEx("BotOtvet",500,0,"i,i",playerid,i);
  19. break;
  20. }
  21. }
  22. if(Zatik[playerid] == 1)
  23. {
  24. SendClientMessage(playerid,-1,"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}Вы не можете говорить. Вы заткнуты");
  25. return 0;
  26. }
  27. ZatikLold[playerid] += 3;
  28. if(ZatikLold[playerid] >= 7)
  29. {
  30. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}Я заткнул %s на 15 секунд. Причина: Флуд",Name(playerid));
  31. ZatikTimer[playerid] = 15;
  32. SendClientMessageToAll(-1,string);
  33. Zatik[playerid] =1;
  34. return 0;
  35. }
  36. new zx;
  37. for(new i =0;i<strlen(text);i++)
  38. {
  39. if((text[i] >='A'&& text[i] <= 'Z') || (text[i]>='А' && text[i] <= 'Я'))
  40. {
  41. zx++;
  42. }
  43. }
  44. if(zx >3)
  45. {
  46. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}Я заткнул %s на 15 секунд. Причина: Капс",Name(playerid));
  47. ZatikTimer[playerid] = 15;
  48. SendClientMessageToAll(-1,string);
  49. Zatik[playerid] =1;
  50. return 0;
  51. }
  52. return 1;
  53. }
  54. forward BotOtvet(playerid,i);
  55. public BotOtvet(playerid,i)
  56. {
  57. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}%s",BotOtveti[i][1]);
  58. SendClientMessage(playerid,-1,string);
  59. }
  60. new Anekdoti[100][256];
  61. stock InitOtveti()
  62. {
  63. new File = iniOpen("BotAI.ini");
  64. new lightstring[256];
  65. if(File>=0)
  66. {
  67. for(new i =0;i<sizeof(BotOtveti);i++)
  68. {
  69. format(string,5,"q%d",i);
  70. new l = iniGet(File,string,lightstring);
  71. if(l < 0){ break;}
  72. split(lightstring,BotOtveti[i],'|');
  73. }
  74. }
  75. iniClose(File);
  76. File = iniOpen("BotAnek.ini");
  77. if(File>=0)
  78. {
  79. for(new i =0;i<sizeof(Anekdoti);i++)
  80. {
  81. format(string,5,"q%d",i);
  82. new l = iniGet(File,string,Anekdoti[i]);
  83. if(l>=0)schet ++;
  84. if(l < 0) break;
  85. }
  86. }
  87. iniClose(File);
  88. if(schet == 0) AnekdotiOn = 0;
  89. else AnekdotiOn = 1;
  90. }
  91. public OnFilterScriptInit()
  92. {
  93. InitOtveti();
  94. SetTimer("Timer",1000,1);
  95. }
  96. forward Timer();
  97. public Timer()
  98. {
  99. for(new playerid;playerid<MAX_PLAYERS;playerid++)
  100. {
  101. if(ZatikLold[playerid] >0) ZatikLold[playerid] --;
  102. if(ZatikTimer[playerid] >0)
  103. {
  104. ZatikTimer[playerid]--;
  105. if(ZatikTimer[playerid] ==0)
  106. {
  107. Zatik[playerid] =0;
  108. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000] {E0FFFF}Я разоткнул %s ",Name(playerid));
  109. SendClientMessageToAll(-1,string);
  110. }
  111. }
  112. }
  113. if(AnekdotiOn)
  114. {
  115. AnekDotTimer--;
  116. if(AnekDotTimer <=0){
  117. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}%s",Anekdoti[random(schet)]);
  118. SendClientMessageToAll(-1,string);
  119. AnekDotTimer =300;
  120. }
  121. }
  122. }
  123. public OnPlayerUpdate(playerid)
  124. {
  125. for(new i =0;i<sizeof(bannedweapons);i++)
  126. {
  127. if(GetPlayerWeapon(playerid) == bannedweapons[i])
  128. {
  129. ResetPlayerWeapons(playerid);
  130. format(string,sizeof(string),"{228B22}ТЕРМЕНАТОР[ID:1000]: {E0FFFF}Я отобрал оружие у %s[%d] причина: %s",Name(playerid),playerid,GetGunName(bannedweapons[i]));
  131. SendClientMessageToAll(-1,string);
  132. //Kick(playerid); //по желанию
  133. }
  134. }
  135. }
  136. stock split(const strsrc[], strdest[][], delimiter)
  137. {
  138. new i, li;
  139. new aNum;
  140. new len;
  141. while(i <= strlen(strsrc)){
  142. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  143. len = strmid(strdest[aNum], strsrc, li, i, 128);
  144. strdest[aNum][len] = 0;
  145. li = i+1;
  146. aNum++;
  147. }
  148. i++;
  149. }
  150. return 1;
  151. }
  152. stock GetGunName(weapon){new name[32]; GetWeaponName(weapon,name,32); return name;}
  153. stock Name(playerid) { new pl[24]; GetPlayerName(playerid,pl,24); return pl; }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement