Advertisement
Guest User

Badwords & Badnames & Badtags Update

a guest
Mar 26th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.36 KB | None | 0 0
  1. /*
  2. Gecodet von Chris.
  3. Ihr dürfet den Code
  4. verändern, aber die
  5. Credit nicht.
  6. */
  7.  
  8. #include <a_samp>
  9. #include <zcmd>
  10.  
  11. #define FILTERSCRIPT
  12. #define COLOR_ROT 0xFF0000FF
  13.  
  14. //Bösse wörter (darf Erweitert werden.)
  15. new Boesewoerter[111] = {
  16. "Ficken",
  17. "Hurensohn",
  18. "Arschloch",
  19. "Schlampe"
  20. };
  21.  
  22. //Bösse Namen (darf Erweitert werden.)
  23. new boesenamen[101] = {
  24. "Mutterficker",
  25. "Im_a_Bitch",
  26. "Hure",
  27. "Adolf_Hitler"
  28. };
  29.  
  30. //Bösse Tags (darf Erweitert werden.)
  31. new bosetags[111] = {
  32. "[LoG]"
  33. };
  34. //Info: Tags sind z.b [GTA]Hallo Gta ist der Tag
  35.  
  36. enum SpielerDaten
  37. {
  38. Verwarnung,
  39. Admin
  40. };
  41. new Warn[MAX_PLAYERS][SpielerDaten];
  42. public OnFilterScriptInit()
  43. {
  44. print("\n--------------------------------------");
  45. print(" Badwords & BadNames & BanTagst by Chriss");
  46. print("--------------------------------------\n");
  47. return 1;
  48. }
  49.  
  50. public OnFilterScriptExit()
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnPlayerConnect(playerid)
  56. {
  57. new Spieler[128];
  58. GetPlayerName(playerid, Spieler, 128);
  59. if(strfind(Spieler, bosetags, true) == 0)
  60. {
  61. if(Warn[playerid][Verwarnung] == 0)
  62. {
  63. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Nametag");
  64. Kick(playerid);
  65. Warn[playerid][Verwarnung] = 1;
  66. }
  67. if(Warn[playerid][Verwarnung] == 1)
  68. {
  69. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Nametag");
  70. Kick(playerid);
  71. Warn[playerid][Verwarnung] = 2;
  72. }
  73. if(Warn[playerid][Verwarnung] == 2)
  74. {
  75. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Nametag");
  76. Kick(playerid);
  77. Warn[playerid][Verwarnung] = 3;
  78. }
  79. if(Warn[playerid][Verwarnung] == 3)
  80. {
  81. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gebant: 4 Verwarnungen");
  82. Ban(playerid);
  83. }
  84. }
  85. if(strfind(Spieler, boesenamen, true) == 0)
  86. {
  87. if(Warn[playerid][Verwarnung] == 0)
  88. {
  89. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Name");
  90. Kick(playerid);
  91. Warn[playerid][Verwarnung] = 1;
  92. }
  93. if(Warn[playerid][Verwarnung] == 1)
  94. {
  95. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Name");
  96. Kick(playerid);
  97. Warn[playerid][Verwarnung] = 2;
  98. }
  99. if(Warn[playerid][Verwarnung] == 2)
  100. {
  101. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gekickt+Verwarnung Grund: Illigaler Name");
  102. Kick(playerid);
  103. Warn[playerid][Verwarnung] = 3;
  104. }
  105. if(Warn[playerid][Verwarnung] == 3)
  106. {
  107. SendClientMessage(playerid, COLOR_ROT, "Du wurdest Gebant: 4 Verwarnungen");
  108. Ban(playerid);
  109. }
  110. }
  111. return 1;
  112. }
  113.  
  114. public OnPlayerText(playerid, text[])
  115. {
  116. if(Warn[playerid][Verwarnung] == 0)
  117. {
  118. if(!strfind(text,Boesewoerter,true))
  119. {
  120. SendClientMessage(playerid, COLOR_ROT, "[Anti-Wörts] Du hast 1 Verwarnung Grund: Böse wörter");
  121. Warn[playerid][Verwarnung] = 1;
  122. }
  123. }
  124. if(Warn[playerid][Verwarnung] == 1)
  125. {
  126. if(!strfind(text,Boesewoerter,true))
  127. {
  128. SendClientMessage(playerid, COLOR_ROT, "[Anti-Wörts] Du hast 2 Verwarnungen Grund: Böse wörter");
  129. Warn[playerid][Verwarnung] = 2;
  130. }
  131. }
  132. if(Warn[playerid][Verwarnung] == 2)
  133. {
  134. if(!strfind(text,Boesewoerter,true))
  135. {
  136. SendClientMessage(playerid, COLOR_ROT, "[Anti-Wörts] Du wurdest Gekickt Grund: 3 Verwarnungen.");
  137. Warn[playerid][Verwarnung] = 3;
  138. Kick(playerid);
  139. }
  140. }
  141. if(Warn[playerid][Verwarnung] == 3)
  142. {
  143. if(!strfind(text,Boesewoerter,true))
  144. {
  145. SendClientMessage(playerid, COLOR_ROT, "[Anti-Wörts] Du wurdest Gebannt Grund: 4 Verwarnungen.");
  146. BanEx(playerid, "4 Verwarnungen");
  147. }
  148. }
  149. return 1;
  150. }
  151.  
  152. //ZCMD
  153. COMMAND:Verwarnungen(playerid, params[])
  154. {
  155. new string[128];
  156. format(string, 128, "Du hast %d Verwarnungen.", Warn[playerid][Verwarnung]);
  157. SendClientMessage(playerid, COLOR_ROT, string);
  158. return 1;
  159. }
  160.  
  161. COMMAND:GebeV(playerid, params[])
  162. {
  163. new string[128], pID, Anzahl;
  164. if(sscanf(params, "ud", pID, Anzahl))return SendClientMessage(playerid, COLOR_ROT, "Fehler: /gebeV [playerid][Anzahl]");
  165. if(Warn[playerid][Admin] != 1)SendClientMessage(playerid, COLOR_ROT, "Du bist kein Admin !");
  166. Warn[pID][Verwarnung] = Anzahl;
  167. format(string, 128, "Du hast %s %d Verwarnungen gegeben.", spielername(pID), Anzahl);
  168. SendClientMessage(playerid, COLOR_ROT, string);
  169. format(string, 128, "Du hast von %s %d Verwarnungen bekommen", spielername(playerid), Anzahl);
  170. SendClientMessage(pID, COLOR_ROT, string);
  171. if(Warn[pID][Verwarnung] == 4)
  172. {
  173. BanEx(playerid, "4 Verwarnungen");
  174. format(string, 128, "[ASystem] %s wurde Gebannt, Grund: 4 Verwarnungen", spielername(pID));
  175. }
  176. return 1;
  177. }
  178. stock SpielerLaden(playerid)
  179. {
  180. new Verwarnung[64];
  181. new Sname[MAX_PLAYER_NAME];
  182. GetPlayerName(playerid,Sname,sizeof(Sname));
  183. format(Verwarnung,sizeof(Verwarnung),"/Verwarnung/%s.txt",Sname);
  184. if(dini_Exists(Verwarnung))
  185. {
  186. Warn[playerid][Verwarnung] = dini_Int(Verwarnung,"Verwarnungen");
  187. Warn[playerid][Admin] = dini_Int(Verwarnung,"Admin");
  188. }
  189. return 1;
  190. }
  191. //Sscanf
  192. stock sscanf(string[], format[], {Float,_}:...)
  193. {
  194. #if defined isnull
  195. if (isnull(string))
  196. #else
  197. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  198. #endif
  199. {
  200. return format[0];
  201. }
  202. #pragma tabsize 4
  203. new
  204. formatPos = 0,
  205. stringPos = 0,
  206. paramPos = 2,
  207. paramCount = numargs(),
  208. delim = ' ';
  209. while (string[stringPos] && string[stringPos] <= ' ')
  210. {
  211. stringPos++;
  212. }
  213. while (paramPos < paramCount && string[stringPos])
  214. {
  215. switch (format[formatPos++])
  216. {
  217. case '\0':
  218. {
  219. return 0;
  220. }
  221. case 'i', 'd':
  222. {
  223. new
  224. neg = 1,
  225. num = 0,
  226. ch = string[stringPos];
  227. if (ch == '-')
  228. {
  229. neg = -1;
  230. ch = string[++stringPos];
  231. }
  232. do
  233. {
  234. stringPos++;
  235. if ('0' <= ch <= '9')
  236. {
  237. num = (num * 10) + (ch - '0');
  238. }
  239. else
  240. {
  241. return -1;
  242. }
  243. }
  244. while ((ch = string[stringPos]) > ' ' && ch != delim);
  245. setarg(paramPos, 0, num * neg);
  246. }
  247. case 'h', 'x':
  248. {
  249. new
  250. num = 0,
  251. ch = string[stringPos];
  252. do
  253. {
  254. stringPos++;
  255. switch (ch)
  256. {
  257. case 'x', 'X':
  258. {
  259. num = 0;
  260. continue;
  261. }
  262. case '0' .. '9':
  263. {
  264. num = (num << 4) | (ch - '0');
  265. }
  266. case 'a' .. 'f':
  267. {
  268. num = (num << 4) | (ch - ('a' - 10));
  269. }
  270. case 'A' .. 'F':
  271. {
  272. num = (num << 4) | (ch - ('A' - 10));
  273. }
  274. default:
  275. {
  276. return -1;
  277. }
  278. }
  279. }
  280. while ((ch = string[stringPos]) > ' ' && ch != delim);
  281. setarg(paramPos, 0, num);
  282. }
  283. case 'c':
  284. {
  285. setarg(paramPos, 0, string[stringPos++]);
  286. }
  287. case 'f':
  288. {
  289.  
  290. new changestr[16], changepos = 0, strpos = stringPos;
  291. while(changepos < 16 && string[strpos] && string[strpos] != delim)
  292. {
  293. changestr[changepos++] = string[strpos++];
  294. }
  295. changestr[changepos] = '\0';
  296. setarg(paramPos,0,_:floatstr(changestr));
  297. }
  298. case 'p':
  299. {
  300. delim = format[formatPos++];
  301. continue;
  302. }
  303. case '\'':
  304. {
  305. new
  306. end = formatPos - 1,
  307. ch;
  308. while ((ch = format[++end]) && ch != '\'') {}
  309. if (!ch)
  310. {
  311. return -1;
  312. }
  313. format[end] = '\0';
  314. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  315. {
  316. if (format[end + 1])
  317. {
  318. return -1;
  319. }
  320. return 0;
  321. }
  322. format[end] = '\'';
  323. stringPos = ch + (end - formatPos);
  324. formatPos = end + 1;
  325. }
  326. case 'u':
  327. {
  328. new
  329. end = stringPos - 1,
  330. id = 0,
  331. bool:num = true,
  332. ch;
  333. while ((ch = string[++end]) && ch != delim)
  334. {
  335. if (num)
  336. {
  337. if ('0' <= ch <= '9')
  338. {
  339. id = (id * 10) + (ch - '0');
  340. }
  341. else
  342. {
  343. num = false;
  344. }
  345. }
  346. }
  347. if (num && IsPlayerConnected(id))
  348. {
  349. setarg(paramPos, 0, id);
  350. }
  351. else
  352. {
  353. #if !defined foreach
  354. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  355. #define __SSCANF_FOREACH__
  356. #endif
  357. string[end] = '\0';
  358. num = false;
  359. new
  360. name[MAX_PLAYER_NAME];
  361. id = end - stringPos;
  362. foreach (Player, playerid)
  363. {
  364. GetPlayerName(playerid, name, sizeof (name));
  365. if (!strcmp(name, string[stringPos], true, id))
  366. {
  367. setarg(paramPos, 0, playerid);
  368. num = true;
  369. break;
  370. }
  371. }
  372. if (!num)
  373. {
  374. setarg(paramPos, 0, INVALID_PLAYER_ID);
  375. }
  376. string[end] = ch;
  377. #if defined __SSCANF_FOREACH__
  378. #undef foreach
  379. #undef __SSCANF_FOREACH__
  380. #endif
  381. }
  382. stringPos = end;
  383. }
  384. case 's', 'z':
  385. {
  386. new
  387. i = 0,
  388. ch;
  389. if (format[formatPos])
  390. {
  391. while ((ch = string[stringPos++]) && ch != delim)
  392. {
  393. setarg(paramPos, i++, ch);
  394. }
  395. if (!i)
  396. {
  397. return -1;
  398. }
  399. }
  400. else
  401. {
  402. while ((ch = string[stringPos++]))
  403. {
  404. setarg(paramPos, i++, ch);
  405. }
  406. }
  407. stringPos--;
  408. setarg(paramPos, i, '\0');
  409. }
  410. default:
  411. {
  412. continue;
  413. }
  414. }
  415. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  416. {
  417. stringPos++;
  418. }
  419. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  420. {
  421. stringPos++;
  422. }
  423. paramPos++;
  424. }
  425. do
  426. {
  427. if ((delim = format[formatPos++]) > ' ')
  428. {
  429. if (delim == '\'')
  430. {
  431. while ((delim = format[formatPos++]) && delim != '\'') {}
  432. }
  433. else if (delim != 'z')
  434. {
  435. return delim;
  436. }
  437. }
  438. }
  439. while (delim > ' ');
  440. return 0;
  441. }
  442.  
  443. stock SpielerSpeichern(playerid)
  444. {
  445. new Verwarnung[64];
  446. new Sname[MAX_PLAYER_NAME];
  447. GetPlayerName(playerid,Sname,sizeof(Sname));
  448. format(Spieler,sizeof(Verwarnung),"/Verwarnung/%s.txt",Sname);
  449. if(dini_Exists(Verwarnung))
  450. {
  451. dini_IntSet(Verwarnung,"Verwarnungen",Warn[playerid][Verwarnung]);
  452. dini_IntSet(Verwarnung,"Admin",Warn[playerid][Admin]);
  453. }
  454. return 1;
  455. }
  456.  
  457. spielername(playerid)
  458. {
  459. new xname[MAX_PLAYER_NAME];
  460. GetPlayerName(playerid,xname,sizeof xname);
  461. return xname;
  462. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement