Advertisement
Inkomp3tent

Untitled

Oct 28th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.49 KB | None | 0 0
  1. #define M_Bot_BOT_NAME "[SERVERGUARD]"
  2. #define M_BOT_COLOR 0xFF6347AA
  3.  
  4.  
  5. |+++++++++++++++++++++++++++++++++++++++++++++++++++++|
  6. |+++++++++ Maercells AntiCheat-Bot © 2009 ++++++++++|
  7. |++++++++++++++++++++++ v1.1 +++++++++++++++++++++++|
  8. |+++++++++++++++++++++++++++++++++++++++++++++++++++++|
  9. |+++++++++++++++++++++++++++++++++++++++++++++++++++++|
  10.  
  11.  
  12. native SendClientMessageToAdmins(color,message[]);
  13. native FreezePlayer(playerid);
  14. native UnFreezePlayer(playerid);
  15. native FreezeAll();
  16. native UnFreezeAll();
  17. native GetName(playerid);
  18. native GetIP(playerid);
  19. native GetWeaponSlot(wid);
  20. native GetVehicleDriver(vehicleid);
  21. native M_Kick(playerid);
  22. native M_Ban(playerid);
  23. native M_BanEx(playerid,reason[]);
  24. native M_Log(string[]):
  25. native M_GivePlayerWeapon(playerid,weapon,ammo);
  26. native M_ResetPlayerWeapons(playerid);
  27. native M_GetPlayerMoney(playerid);
  28. native M_ResetPlayerMoney(playerid);
  29. native M_GivePlayerMoney(playerid,summe);
  30. native M_SetPlayerMoney(playerid,summe);
  31. native M_GivePlayerHealth(playerid,Float:health);
  32. native M_GivePlayerArmour(playerid,Float:armour);
  33. native M_SetPlayerPos(playerid,Float:Xpos,Float:Ypos,Float:Zpos,Float:Angle); // Spielerteleport ( + Winkel/Angle)=> Muss nicht dabei sein
  34. native M_SetVehiclePos(playerid,Float:Xpos,Float:Ypos,Float:Zpos,Float:Angle); // Autoteleport ( + Winkel/Angle)=> Muss nicht dabei sein
  35.  
  36. native EnableM_Bot();
  37. native M_OnPlayerSpawn(playerid);
  38. native M_OnPlayerConnect(playerid);
  39. native M_OnPlayerDeath(playerid,killerid,reason);
  40. native M_OnPlayerUpdate(playerid);
  41. native M_OnPlayerCommandText(playerid,cmdtext[]);
  42.  
  43.  
  44.  
  45. forward KickHim(playerid);
  46. forward BanHim(playerid);
  47. forward BanHimEx(playerid,reason[]);
  48. forward Check();
  49. forward CheckIPFromList(playerid);
  50. forward EnableChecking(playerid);
  51. forward EnablePingWarnAgain(playerid);
  52. forward AFKOn(playerid);
  53.  
  54.  
  55. enum SysInfo
  56. {
  57. PMoney,
  58. PWeapon[13],
  59. PAmmo[13],
  60. PLastVehicleID,
  61. PLastInterior,
  62. PInactiveSeconds,
  63. PCheckHighPing,
  64. PHighPingWarns,
  65. PIPWarns,
  66. PBadWordWarns,
  67. PAFK,
  68. PAFKTimer,
  69. Float:PHealth,
  70. Float:PArmour,
  71. Float:PXpos,
  72. Float:PYpos,
  73. Float:PZpos,
  74. Float:PXpos2,
  75. Float:PYpos2,
  76. Float:PZpos2,
  77. PFrozen,
  78. PSpawned,
  79. PCheck
  80. }
  81.  
  82. new M_Bot[MAX_PLAYERS][SysInfo];
  83.  
  84. new BanWeaponIDs[] = {
  85. 35,
  86. 36,
  87. 37,
  88. 38,
  89. 39,
  90. 40,
  91. 44,
  92. 45
  93. };
  94.  
  95. new BanClanTags[][] = {
  96. "[LoH]",
  97. "[FoD]",
  98. "[LoG]"
  99. };
  100.  
  101. new BanNames[][] = {
  102. "Suppenhuhn",
  103. "Fabi",
  104. "MiniYoda",
  105. "Jude",
  106. "Fick",
  107. "Kack",
  108. "scheiss"
  109. };
  110.  
  111. new BadWords[][] = {
  112. "Fick",
  113. "Fresse",
  114. "Hurensohn",
  115. "Huso",
  116. "Schnauze",
  117. "Fotze",
  118. "Wixxer",
  119. "Wichser",
  120. "Kanacke",
  121. "Jude",
  122. "Arsch",
  123. "Hure",
  124. "Nigger",
  125. "verpiss",
  126. "Mistgeburt",
  127. "Fotze",
  128. "Missgeburt",
  129. "Hure",
  130. "Bastard",
  131. "Noob",
  132. "Drecks Server
  133. };
  134.  
  135. new Float:GettedHealth,
  136. Float:GettedArmour,
  137. AllFrozen,
  138. MaxPing = 300,
  139. MoneySpam[MAX_PLAYERS];
  140.  
  141.  
  142. public EnableChecking(playerid)
  143. {
  144. M_Bot[playerid][PCheck] = 1;
  145. return 1;
  146. }
  147.  
  148. public EnablePingWarnAgain(playerid)
  149. {
  150. M_Bot[playerid][PCheckHighPing] = 1;
  151. return 1;
  152. }
  153.  
  154. public AFKOn(playerid)
  155. {
  156. if(IsPlayerConnected(playerid) && M_Bot[playerid][PAFK] == 0)
  157. {
  158. new string[128];
  159. format(string,sizeof string,"*~ [AFK] %s ist in den AFK-Modus gegangen! /afklist ",GetName(playerid));
  160. SendClientMessageToAll(0xAFAFAFAA,string);
  161. M_Bot[playerid][PAFK] = 1;
  162. FreezePlayer(playerid);
  163. KillTimer(M_Bot[playerid][PAFKTimer]);
  164. }
  165. return 1;
  166. }
  167.  
  168. // ====================================================================================================================
  169.  
  170. stock SendClientMessageToAdmins(color,message[])
  171. {
  172. for(new i = 0; i < GetMaxPlayers(); i++)
  173. {
  174. if(IsPlayerConnected(i) && IsAnAdmin(i))
  175. {
  176. SendClientMessage(i,color,message);
  177. }
  178. }
  179. }
  180.  
  181.  
  182. stock FreezePlayer(playerid)
  183. {
  184. TogglePlayerControllable(playerid,false);
  185. M_Bot[playerid][PFrozen] = 1;
  186. }
  187.  
  188.  
  189. stock UnFreezePlayer(playerid)
  190. {
  191. TogglePlayerControllable(playerid,true);
  192. M_Bot[playerid][PFrozen] = 0;
  193. }
  194.  
  195.  
  196. stock FreezeAll()
  197. {
  198. for(new i = 0; i < GetMaxPlayers(); i++)
  199. {
  200. if(IsPlayerConnected(i))
  201. {
  202. TogglePlayerControllable(i,false);
  203. AllFrozen = 1;
  204. }
  205. }
  206. }
  207.  
  208. stock UnFreezeAll()
  209. {
  210. for(new i = 0; i < GetMaxPlayers(); i++)
  211. {
  212. if(IsPlayerConnected(i))
  213. {
  214. TogglePlayerControllable(i,true);
  215. AllFrozen = 0;
  216. }
  217. }
  218. }
  219.  
  220. stock GetName(playerid)
  221. {
  222. new getthename[MAX_PLAYER_NAME];
  223. GetPlayerName(playerid,getthename,sizeof(getthename));
  224. return getthename;
  225. }
  226.  
  227. stock GetIP(playerid)
  228. {
  229. new gettheip[15];
  230. GetPlayerIp(playerid,gettheip,sizeof(gettheip));
  231. return gettheip;
  232. }
  233.  
  234.  
  235. stock M_Kick(playerid)
  236. {
  237. SetTimerEx("KickHim",100,0,"d",playerid);
  238. }
  239.  
  240. public KickHim(playerid)
  241. {
  242. Kick(playerid);
  243. return 1;
  244. }
  245.  
  246.  
  247. stock M_Ban(playerid)
  248. {
  249. SetTimerEx("BanHim",100,0,"d",playerid);
  250. }
  251.  
  252. public BanHim(playerid)
  253. {
  254. Ban(playerid);
  255. return 1;
  256. }
  257.  
  258.  
  259. stock M_BanEx(playerid,reason[])
  260. {
  261. SetTimerEx("BanHimEx",100,0,"ds",playerid,reason);
  262. }
  263.  
  264. public BanHimEx(playerid,reason[])
  265. {
  266. BanEx(playerid,reason);
  267. return 1;
  268. }
  269.  
  270. stock GetVehicleDriver(vehicleid)
  271. {
  272. for(new i = 0; i < GetMaxPlayers(); i++)
  273. {
  274. if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == vehicleid)
  275. {
  276. return i;
  277. }
  278. }
  279. return -1;
  280. }
  281.  
  282.  
  283. stock M_WriteIPToBlacklist(ip[])
  284. {
  285. new File:BLACKLISTFILE;
  286. if(!fexist("/M_Bot/M_Black.cfg"))
  287. {
  288. BLACKLISTFILE = fopen("/M_Bot/M_Black.cfg",io_write);
  289. }
  290. else
  291. {
  292. BLACKLISTFILE = fopen("/M_Bot/M_Black.cfg",io_append);
  293. }
  294. if(BLACKLISTFILE)
  295. {
  296. new string[20];
  297. format(string,sizeof(string),"%s\n",ip);
  298. fwrite(BLACKLISTFILE,string);
  299. }
  300. fclose(BLACKLISTFILE);
  301. }
  302.  
  303. stock M_Log(string[])
  304. {
  305. new File:logfile, mhour, mminute, msecond, myear, mmonth, mday;
  306. if(!fexist("/M_Bot/M_Log.txt"))
  307. {
  308. logfile = fopen("/M_Bot/M_Log.txt",io_write);
  309. }
  310. else
  311. {
  312. logfile = fopen("/M_Bot/M_Log.txt",io_append);
  313. }
  314. gettime(mhour,mminute,msecond);
  315. getdate(myear,mmonth,mday);
  316. format(string,(strlen(string)+32),"Logged %02d.%02d.%d %d:%d:%d: %s\n",mday,mmonth,myear,mhour,mminute,msecond,string);
  317. fwrite(logfile,string);
  318. fclose(logfile);
  319. }
  320.  
  321.  
  322. stock M_PutPlayerInVehicle(playerid,vehicleid,seatid)
  323. {
  324. GetVehiclePos(vehicleid,M_Bot[playerid][PXpos],M_Bot[playerid][PYpos],M_Bot[playerid][PZpos]);
  325. PutPlayerInVehicle(playerid,vehicleid,seatid);
  326. }
  327.  
  328. stock M_SetPlayerPos(playerid,Float:Xpos,Float:Ypos,Float:Zpos,Float:Angle = -1.0)
  329. {
  330. M_Bot[playerid][PXpos] = Xpos;
  331. M_Bot[playerid][PYpos] = Ypos;
  332. M_Bot[playerid][PZpos] = Zpos;
  333. SetPlayerPos(playerid,Xpos,Ypos,Zpos);
  334. if(Angle != -1.0)
  335. {
  336. SetPlayerFacingAngle(playerid,Angle);
  337. }
  338. }
  339.  
  340. stock M_SetVehiclePos(vehicleid,Float:Xpos,Float:Ypos,Float:Zpos,Float:Angle = -1.0)
  341. {
  342. new playerid = GetVehicleDriver(vehicleid);
  343. if(playerid != -1)
  344. {
  345. M_Bot[playerid][PXpos] = Xpos;
  346. M_Bot[playerid][PYpos] = Ypos;
  347. M_Bot[playerid][PZpos] = Zpos;
  348. }
  349. SetVehiclePos(vehicleid,Xpos,Ypos,Zpos);
  350. if(Angle != -1.0)
  351. {
  352. SetVehicleZAngle(vehicleid,Angle);
  353. }
  354. return 1;
  355. }
  356.  
  357. stock M_GivePlayerWeapon(playerid,weaponid,ammo)
  358. {
  359. new slot = GetWeaponSlot(weaponid);
  360. if(ammo == 0)
  361. ammo = 1;
  362. M_Bot[playerid][PWeapon][slot] = weaponid;
  363. M_Bot[playerid][PAmmo][slot] += ammo;
  364. GivePlayerWeapon(playerid,weaponid,ammo);
  365. }
  366.  
  367. stock M_ResetPlayerWeapons(playerid)
  368. {
  369. for(new slot=0; slot<13; slot++)
  370. {
  371. M_Bot[playerid][PWeapon][slot] = -1;
  372. M_Bot[playerid][PAmmo][slot] = 0;
  373. }
  374. ResetPlayerWeapons(playerid);
  375. }
  376.  
  377.  
  378. stock M_GetPlayerMoney(playerid)
  379. {
  380. return M_Bot[playerid][PMoney];
  381. }
  382.  
  383. stock M_ResetPlayerMoney(playerid)
  384. {
  385. M_Bot[playerid][PMoney] = 0;
  386. ResetPlayerMoney(playerid);
  387. }
  388.  
  389. forward M_GivePlayerMoney(playerid,summe);
  390. public M_GivePlayerMoney(playerid,summe)
  391. {
  392. M_Bot[playerid][PMoney] += summe;
  393. GivePlayerMoney(playerid,summe);
  394. }
  395.  
  396. stock M_SetPlayerMoney(playerid,summe)
  397. {
  398. ResetPlayerMoney(playerid);
  399. M_Bot[playerid][PMoney] = summe;
  400. GivePlayerMoney(playerid,summe);
  401. }
  402.  
  403. public CheckIPFromList(playerid)
  404. {
  405. new playerip[15], read[32], TwoNumbersLength = 0, count = 0;
  406. GetPlayerIp(playerid,playerip,sizeof(playerip));
  407. for(new c=0; c<strlen(playerip); c++)
  408. {
  409. if(playerip[c] == '.')
  410. {
  411. count++;
  412. }
  413. if(count == 2)
  414. {
  415. TwoNumbersLength = c-1;
  416. break;
  417. }
  418. }
  419. new File:BLACKLISTFILE = fopen("/M_Bot/M_Black.cfg", io_read);
  420. if(BLACKLISTFILE)
  421. {
  422. while(fread(BLACKLISTFILE,read))
  423. {
  424. for(new x=0; x<strlen(read); x++)
  425. {
  426. if(read[x] == '\n')
  427. {
  428. read[x] = '\0';
  429. }
  430. }
  431. if(!strcmp(read,playerip,false,TwoNumbersLength) || !strcmp(read,playerip,false))
  432. {
  433. fclose(BLACKLISTFILE);
  434. return 1;
  435. }
  436. }
  437. }
  438. fclose(BLACKLISTFILE);
  439. /*new playerip[16], read[32], ipstr[4][8], ip[2], ipstr2[4][8], ip2[2];
  440.  
  441. GetPlayerIp(playerid,playerip,sizeof(playerip));
  442. split(playerip,ipstr2,'.');
  443. ip2[0] = strval(ipstr2[0]);
  444. ip2[1] = strval(ipstr2[1]);
  445.  
  446. new File:BLACKLISTFILE = fopen("/M_Bot/M_Black.cfg", io_read);
  447. if(BLACKLISTFILE)
  448. {
  449. while(fread(BLACKLISTFILE,read))
  450. {
  451. split(read,ipstr,'.');
  452. ip[0] = strval(ipstr[0]);
  453. ip[1] = strval(ipstr[1]);
  454.  
  455. if(ip[0] == ip2[0] && ip[1] == ip2[1])
  456. {
  457. fclose(BLACKLISTFILE);
  458. return 1;
  459. }
  460. }
  461. }
  462. fclose(BLACKLISTFILE);*/
  463. return 0;
  464. }
  465.  
  466. public Check()
  467. {
  468. for(new playerid=0; playerid<GetMaxPlayers(); playerid++)
  469. if(IsPlayerConnected(playerid))
  470. {
  471. new admstring[128], playername[MAX_PLAYER_NAME], weapon = -1, ammo = 0;
  472. GetPlayerName(playerid,playername,sizeof(playername));
  473. GetPlayerPos(playerid,M_Bot[playerid][PXpos2],M_Bot[playerid][PYpos2],M_Bot[playerid][PZpos2]);
  474. //distance = (((M_Bot[playerid][PXpos2]-M_Bot[playerid][PXpos])*(M_Bot[playerid][PXpos2]-M_Bot[playerid][PXpos]))+((M_Bot[playerid][PYpos2]-M_Bot[playerid][PYpos])*(M_Bot[playerid][PYpos2]-M_Bot[playerid][PYpos])))/100;
  475.  
  476. new differenz = (GetPlayerMoney(playerid) - M_Bot[playerid][PMoney]);
  477. if(differenz >= 4490)
  478. {
  479. format(admstring,sizeof(admstring)," %s: %s ist unter Moneyhackverdacht! Ercheateter Betrag: %d ",M_Bot_BOT_NAME,playername,differenz);
  480. SendClientMessageToAdmins(M_BOT_COLOR,admstring);
  481. M_SetPlayerMoney(playerid,M_Bot[playerid][PMoney]);
  482. M_Log(admstring);
  483. MoneySpam[playerid]++;
  484. }
  485. if(MoneySpam[playerid] >= 20)
  486. {
  487. format(admstring,sizeof(admstring)," %s wurde von %s gebannt! (GRUND: Money Hack)",playername,M_Bot_BOT_NAME);
  488. SendClientMessageToAll(M_BOT_COLOR,admstring);
  489. format(admstring,sizeof(admstring)," Bann von %s (GRUND: MoneyCheat | IP: %s) ",playername,GetIP(playerid));
  490. MoneySpam[playerid] = 0;
  491. M_Log(admstring);
  492. M_BanEx(playerid,"MoneyCheat");
  493. return 1;
  494. }
  495. if(M_Bot[playerid][PSpawned] && M_Bot[playerid][PCheck])
  496. {
  497. if(distance > 1000.0) // Hohe Distanz
  498. if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) // Nicht beim Spectaten
  499. if(!IsAPlaneForNoCheck(GetPlayerVehicleID(playerid))) // Nicht wenn man im Flugzeug ist
  500. {
  501. format(admstring,sizeof(admstring)," %s: %s ist unter Speedhack/Teleport-verdacht! ",M_Bot_BOT_NAME,playername);
  502. SendClientMessageToAdmins(M_BOT_COLOR,admstring);
  503. }
  504. }
  505. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  506. {
  507. format(admstring,sizeof(admstring)," %s wurde von %s gebannt! (GRUND: Jetpack) ",playername,M_Bot_BOT_NAME);
  508. SendClientMessageToAll(M_BOT_COLOR,admstring);
  509. format(admstring,sizeof(admstring)," Bann von %s (GRUND: Jetpack | IP: %s) ",playername,GetIP(playerid));
  510. M_Log(admstring);
  511. M_BanEx(playerid,"Jetpack");
  512. }
  513. for(new w=0; w<sizeof(BanWeaponIDs); w++)
  514. {
  515. GetPlayerWeaponData(playerid,GetWeaponSlot(BanWeaponIDs[w]),weapon,ammo);
  516. if(weapon == BanWeaponIDs[w] && ammo > 0)
  517. {
  518. format(admstring,sizeof(admstring)," %s wurde von %s gebannt! (GRUND: Waffenhack)",playername,M_Bot_BOT_NAME);
  519. SendClientMessageToAll(M_BOT_COLOR,admstring);
  520. format(admstring,sizeof(admstring)," Bann von %s (GRUND: Waffenhack | IP: %s) ",playername,GetIP(playerid));
  521. M_Log(admstring);
  522. M_BanEx(playerid,"Waffenhack");
  523. }
  524. }
  525. if(GetPlayerPing(playerid) >= MaxPing && M_Bot[playerid][PCheckHighPing] && M_Bot[playerid][PSpawned])
  526. {
  527. M_Bot[playerid][PHighPingWarns]++;
  528. if(M_Bot[playerid][PHighPingWarns] >= 5)
  529. {
  530. format(admstring,sizeof(admstring)," %s wurde von %s gekickt! (GRUND: PING: %d | MAXPING: %d) ",playername,M_Bot_BOT_NAME,GetPlayerPing(playerid),MaxPing);
  531. SendClientMessageToAll(M_BOT_COLOR,admstring);
  532. M_Kick(playerid);
  533. M_Log(admstring);
  534. }
  535. else
  536. {
  537. format(admstring,sizeof(admstring)," [!] Dein Ping ist zu hoch! (PING: %d | MAXPING: %d | WARNUNG: %d/5)",GetPlayerPing(playerid),MaxPing,M_Bot[playerid][PHighPingWarns]);
  538. SendClientMessage(playerid,M_BOT_COLOR,admstring);
  539. SetTimerEx("EnablePingWarnAgain",15000,0,"i",playerid);
  540. }
  541. }
  542.  
  543. if(M_Bot[playerid][PSpawned])
  544. {
  545. M_Bot[playerid][PInactiveSeconds]++;
  546. }
  547.  
  548. if(M_Bot[playerid][PFrozen] || AllFrozen)
  549. {
  550. FreezePlayer(playerid);
  551. }
  552.  
  553. if(M_Bot[playerid][PAFK] == 1)
  554. {
  555. GameTextForPlayer(playerid,"~y~Du bist AFK~n~~g~Um aus dem ~r~AFK-Modus~g~ zu gehen:~n~~y~/back",3500,3);
  556. }
  557.  
  558. M_Bot[playerid][PXpos] = M_Bot[playerid][PXpos2];
  559. M_Bot[playerid][PYpos] = M_Bot[playerid][PYpos2];
  560. M_Bot[playerid][PZpos] = M_Bot[playerid][PZpos2];
  561. M_Bot[playerid][PLastInterior] = GetPlayerInterior(playerid);
  562. }
  563. return 1;
  564. }
  565.  
  566.  
  567. stock IsAPlaneForNoCheck(vehicleid)
  568. {
  569. new modelid = GetVehicleModel(vehicleid);
  570. if(modelid == 417 || modelid == 425 || modelid == 447 || modelid == 460 || modelid == 469 || modelid == 476 || modelid == 487 || modelid == 488 || modelid == 497 || modelid == 511 || modelid == 512 || modelid == 513 || modelid == 519 || modelid == 520 || modelid == 548 || modelid == 553 || modelid == 563 || modelid == 577 || modelid == 593)
  571. {
  572. return 1;
  573. }
  574. return 0;
  575. }
  576.  
  577. stock GetWeaponSlot(wid) // Dank an [NSG]roschti für die Funktion
  578. {
  579. new id;
  580. switch(wid)
  581. {
  582. case 0,1: id=0;
  583. case 2,3,4,5,6,7,8,9: id=1;
  584. case 22,23,24: id=2;
  585. case 25,26,27: id=3;
  586. case 28,29,32: id=4;
  587. case 30,31: id=5;
  588. case 33,34: id=6;
  589. case 35,36,37,38: id=7;
  590. case 16,17,18,19,39: id=8;
  591. case 41,42,43: id=9;
  592. case 10,11,12,13,14,15: id=10;
  593. case 44,45,46: id=11;
  594. case 40: id=12;
  595. case 20,21,47,49,50,53,54: id=(-1);
  596. default: id=(-1);
  597. }
  598. return id;
  599. }
  600.  
  601.  
  602.  
  603. // ====================================================================================================================
  604.  
  605.  
  606.  
  607. EnableM_Bot()
  608. {
  609. SetTimer("Check",2500,1);
  610. AllFrozen = 0;
  611. return 1;
  612. }
  613.  
  614. M_OnPlayerSpawn(playerid)
  615. {
  616. M_Bot[playerid][PSpawned] = 1;
  617. M_Bot[playerid][PCheck] = 0;
  618. SetTimerEx("EnableChecking",3333,0,"i",playerid);
  619. if(AllFrozen)
  620. {
  621. FreezePlayer(playerid);
  622. }
  623. return 1;
  624. }
  625.  
  626. M_OnPlayerConnect(playerid)
  627. {
  628. if(!strcmp(M_Bot_BOT_NAME,GetName(playerid),true))
  629. {
  630. M_Kick(playerid);
  631. }
  632.  
  633. if(CheckIPFromList(playerid))
  634. {
  635. SendClientMessage(playerid,M_BOT_COLOR," Du hast einen PERM-BANN auf diesem Server !");
  636. GameTextForPlayer(playerid,"~r~BYE",60000,3);
  637. M_Kick(playerid);
  638. }
  639. for(new n=0; n<sizeof(BanClanTags); n++)
  640. {
  641. if(strfind(GetName(playerid),BanClanTags[n],false) == 0)
  642. {
  643. new banstring[128];
  644. format(banstring,sizeof(banstring)," Dein Clan %s ist von diesem Server gebannt!",BanClanTags[n]);
  645. SendClientMessage(playerid,M_BOT_COLOR,banstring);
  646. format(banstring,sizeof(banstring)," %s aus dem gebannten Clan %s hat den Server betreten und wurde gebannt!",GetName(playerid),BanClanTags[n]);
  647. SendClientMessageToAdmins(M_BOT_COLOR,banstring);
  648. M_Log(banstring);
  649. format(banstring,sizeof(banstring),"Clan %s",BanClanTags[n]);
  650. M_BanEx(playerid,banstring);
  651. }
  652. }
  653. for(new n=0; n<sizeof(BanNames); n++)
  654. {
  655. if(strcmp(GetName(playerid),BanNames[n],true) == 0)
  656. {
  657. new banstring[128];
  658. format(banstring,sizeof(banstring)," Dein Name %s ist von diesem Server gebannt!",GetName(playerid));
  659. SendClientMessage(playerid,M_BOT_COLOR,banstring);
  660. format(banstring,sizeof(banstring)," %s hat den Server betreten und wurde gebannt!",GetName(playerid));
  661. SendClientMessageToAdmins(M_BOT_COLOR,banstring);
  662. M_Log(banstring);
  663. format(banstring,sizeof(banstring),"Name %s",BanNames[n]);
  664. M_BanEx(playerid,banstring);
  665. }
  666. }
  667. // Reset Vars
  668. M_Bot[playerid][PMoney] = 0;
  669. M_Bot[playerid][PLastInterior] = 0;
  670. M_Bot[playerid][PInactiveSeconds] = 0;
  671. M_Bot[playerid][PIPWarns] = 0;
  672. M_Bot[playerid][PBadWordWarns] = 0;
  673. M_Bot[playerid][PHighPingWarns] = 0;
  674. M_Bot[playerid][PAFK] = 0;
  675. M_Bot[playerid][PFrozen] = 0;
  676. M_Bot[playerid][PSpawned] = 0;
  677. M_Bot[playerid][PCheck] = 0;
  678. M_Bot[playerid][PCheckHighPing] = 0;
  679. for(new slot=0; slot<13; slot++)
  680. {
  681. M_Bot[playerid][PWeapon][slot] = -1;
  682. M_Bot[playerid][PAmmo][slot] = 0;
  683. }
  684. return 1;
  685. }
  686.  
  687. M_OnPlayerDeath(playerid,killerid,reason)
  688. {
  689. M_Bot[playerid][PSpawned] = 0;
  690. if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && GetDistanceBetweenPlayers(playerid,killerid) < 20 && (reason == WEAPON_MP5 || reason == WEAPON_VEHICLE || reason == WEAPON_COLLISION))
  691. {
  692. new kickstring[128];
  693. format(kickstring,sizeof(kickstring)," %s wurde von %s gekickt! (GRUND: Fahrer-DriveBy)",GetName(killerid),M_Bot_BOT_NAME);
  694. SendClientMessageToAll(M_BOT_COLOR,kickstring);
  695. M_Kick(killerid);
  696. }
  697. return 1;
  698. }
  699.  
  700. M_OnPlayerUpdate(playerid)
  701. {
  702. M_Bot[playerid][PInactiveSeconds] = 0;
  703. return 1;
  704. }
  705.  
  706. M_OnPlayerStateChange(playerid, newstate, oldstate)
  707. {
  708. return 1;
  709. }
  710.  
  711. M_OnPlayerCommandText(playerid,cmdtext[])
  712. {
  713. new string[128];
  714.  
  715. /*if(strcmp("/afk",cmdtext,true) == 0)
  716. {
  717. if(!M_Bot[playerid][PAFK])
  718. {
  719. SendClientMessage(playerid,0x33AA33AA,"In 15 Sekunden wirst du in den AFK-Modus gebracht!");
  720. KillTimer(M_Bot[playerid][PAFKTimer]);
  721. M_Bot[playerid][PAFKTimer] = SetTimerEx("AFKOn",15000,0,"i",playerid);
  722. }
  723. else
  724. {
  725. SendClientMessage(playerid,0xAA3333AA,"Du bist schon AFK!");
  726. }
  727. return 1;
  728. }*/
  729. if(strcmp("/back",cmdtext,true) == 0)
  730. {
  731. if(M_Bot[playerid][PAFK])
  732. {
  733. format(string,sizeof string,"*~ [AFK] %s ist vom AFK-Modus zurück!",GetName(playerid));
  734. SendClientMessageToAll(0xAFAFAFAA,string);
  735. M_Bot[playerid][PAFK] = 0;
  736. UnFreezePlayer(playerid);
  737. KillTimer(M_Bot[playerid][PAFKTimer]);
  738. }
  739. else
  740. {
  741. SendClientMessage(playerid,0xAA3333AA,"Du bist nicht AFK!");
  742. }
  743. return 1;
  744. }
  745. if(strcmp("/afklist",cmdtext,true) == 0)
  746. {
  747. new countafk = 0;
  748. SendClientMessage(playerid,0x33AA33AA,"|---------------------- AFK-List -----------------------|");
  749. for(new i=0; i<GetMaxPlayers(); i++)
  750. {
  751. if(IsPlayerConnected(i) && M_Bot[i][PAFK])
  752. {
  753. format(string,sizeof string,"* [AFK] %s",GetName(i));
  754. SendClientMessage(playerid,0x33AA33AA,string);
  755. countafk++;
  756. }
  757. }
  758. if(countafk == 0) SendClientMessage(playerid,0x33AA33AA," Niemand ist AFK !");
  759. SendClientMessage(playerid,0x33AA33AA,"|----------------------------------------------------------|");
  760. return 1;
  761. }
  762.  
  763. return 1;
  764.  
  765. }
  766.  
  767.  
  768. #define GivePlayerWeapon M_GivePlayerWeapon
  769. #define ResetPlayerWeapons M_ResetPlayerWeapons
  770. #define GivePlayerMoney M_GivePlayerMoney
  771. #define GetPlayerMoney M_GetPlayerMoney
  772. #define ResetPlayerMoney M_ResetPlayerMoney
  773. #define PutPlayerInVehicle M_PutPlayerInVehicle
  774. #define SetVehiclePos M_SetVehiclePos
  775. #define SetPlayerPos M_SetPlayerPos
  776. #define Kick M_Kick
  777. #define Ban M_Ban
  778. #define BanEx M_BanEx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement