Guest User

ANTIB0

a guest
Feb 2nd, 2017
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.44 KB | None | 0 0
  1. /*
  2. AntiB0 ( Anti Cheat )
  3. Version: 1.0.0
  4. Made by: Jevtic
  5.  
  6. DETEKCIJE:
  7. - Anti Speed Hack - Reseno (100%)
  8. - Anti Bunny Hop - Reseno (100%)
  9. - Anti DriveBy - Reseno (100%)
  10. - Anti Health Hack - Reseno (85%)
  11. - Anti Car Teleport - Reseno (95%)
  12. - Anti Weapon Hack - Reseno (100%)
  13. - Anti Armour Hack - Reseno (100%)
  14. - Anti Money Hack - Reseno (100%)
  15. - Anti Jetpack - Reseno (100%)
  16. - Anti Swear - Reseno (100%)
  17. - Anti Spawn - Reseno (100%)
  18. - Anti Bot - Reseno (100%)
  19. - Anti Caps Lock - Reseno (100%)
  20. - Anti Bullet Crasher - Reseno (95%)
  21.  
  22.  
  23. */
  24.  
  25. #define IsValidWeapon(%0) (%0>=1 && %0<=18 || %0>=21 && %0<=46)
  26.  
  27. #include < YSI\y_ini >
  28. #include < a_samp >
  29. #include < YSI\y_commands >
  30. #include < foreach >
  31.  
  32. #define SCMA SendClientMessageToAll
  33. #define SCM SendClientMessage
  34.  
  35. #define AC "{F5052D}"
  36. #define WHITE "{FFFFFF}"
  37.  
  38. #define ANTIB0(%0,%1) \
  39. SCM(%0, -1, "{F5052D}ANTIB0: {FFFFFF} "%1)
  40.  
  41. #pragma tabsize 0
  42.  
  43. new PlayerIP[MAX_PLAYERS][256];
  44. new BotIP[MAX_PLAYERS][256];
  45. new RegistrovanLogovan[MAX_PLAYERS];
  46. new Skocio[MAX_PLAYERS];
  47. new Oruzje[MAX_PLAYERS][50], municija[MAX_PLAYERS][50];
  48. new OldMoney[MAX_PLAYERS];
  49. new NewMoney[MAX_PLAYERS];
  50.  
  51. /*
  52.  
  53. Ukoliko nadjete neki bug prijavite:
  54. www.zbsamp.com - Jevtic Script
  55. www.balkan-samp.com - Jevtic Script
  56.  
  57. Pre nego sto udjete u FS procitajte instalacioni postupak
  58.  
  59. ** Uzivajte **
  60.  
  61. */
  62.  
  63. enum zAC
  64. {
  65. zAdmin,
  66. zLevel
  67. }
  68. new zAntiCheat[MAX_PLAYERS][zAC];
  69.  
  70. new AntiSwear[][] =
  71. {
  72. "jebem","sestra","majka","tetka","otac","crkva","dzamija","pop","hodza","musliman",
  73. "pravoslavac","katolik","papa","svrsim","j e b e m","mater","konj","svinja","picka",
  74. "kurac","crkva","manastir"
  75. };
  76.  
  77.  
  78.  
  79. public OnFilterScriptInit()
  80. {
  81. print("========================================");
  82. print(" ANTIB0 LOADING PROCCES ");
  83. print(" CREATED: JEVTIC ");
  84. print(" VERSION: v1.0.0 ");
  85. print("========================================");
  86.  
  87. SetTimer("CheckMoney",2000,true);
  88. return 1;
  89. }
  90.  
  91. public OnFilterScriptExit()
  92. {
  93. return 1;
  94. }
  95.  
  96.  
  97. public OnPlayerRequestClass(playerid, classid)
  98. {
  99. return 1;
  100. }
  101.  
  102. public OnPlayerConnect(playerid)
  103. {
  104.  
  105. NewMoney[playerid] = GetPlayerMoney(playerid);
  106.  
  107. foreach(Player,i)
  108. {
  109. GetPlayerIp(i,PlayerIP[playerid],256);
  110. GetPlayerIp(playerid,BotIP[playerid],256);
  111. if(i == playerid) return 0;
  112. if(strcmp(PlayerIP[ i],BotIP[playerid], true) == 0)
  113. {
  114. Kick(playerid);
  115. Kick(i);
  116. }
  117. }
  118.  
  119. ANTIB0(playerid,"Podizanje detekcija u toku...");
  120.  
  121. SCM(playerid,-1," ");
  122. SCM(playerid,-1," ");
  123. SCM(playerid,-1," ");
  124.  
  125. ANTIB0(playerid,"Detekcije su uspesno podignute...");
  126.  
  127. SCM(playerid,-1," ");
  128. SCM(playerid,-1," ");
  129. SCM(playerid,-1," ");
  130.  
  131. ANTIB0(playerid,"Anti Cheat spreman da hvata citere...");
  132.  
  133. Skocio[playerid] = 0;
  134. RegistrovanLogovan[playerid] = 0;
  135. return 1;
  136. }
  137.  
  138. public OnPlayerDisconnect(playerid, reason)
  139. {
  140. return 1;
  141. }
  142.  
  143. public OnPlayerSpawn(playerid)
  144. {
  145.  
  146. return 1;
  147. }
  148.  
  149. public OnPlayerDeath(playerid, killerid, reason)
  150. {
  151. if(IsPlayerConnected(killerid) && zAntiCheat[playerid][zLevel] >= 1)
  152. {
  153. new string[256];
  154. format(string,sizeof(string), ""AC"ANTIB0: "WHITE"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", Ime(killerid), killerid, Ime(playerid), playerid);
  155. AdminMessage(-1, string);
  156. }
  157. return 1;
  158. }
  159.  
  160. public OnVehicleSpawn(vehicleid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnVehicleDeath(vehicleid, killerid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerText(playerid, text[])
  171. {
  172. if(KoristiCaps(text))
  173. {
  174. ANTIB0(playerid,"Nije dozvoljeno koriscenje Caps-Lock-a u chatu!");
  175. return 0;
  176. }
  177. for(new words; words < sizeof(AntiSwear); words++)
  178. {
  179. if(strfind(text,AntiSwear[words],true) != -1 ) { ANTIB0(playerid,"Zabranjeno je vredjanje!"); return 0; }
  180. }
  181. return 1;
  182. }
  183.  
  184. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnPlayerExitVehicle(playerid, vehicleid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerStateChange(playerid, newstate, oldstate)
  195. {
  196. if((newstate == PLAYER_STATE_DRIVER) || (newstate == PLAYER_STATE_PASSENGER))
  197. {
  198. for(new j=0; j<11; j++) GetPlayerWeaponData(playerid, j, Oruzje[playerid][j], municija[playerid][j]);
  199. ResetPlayerWeapons(playerid);
  200. }
  201. if((newstate == PLAYER_STATE_ONFOOT) && ((oldstate == PLAYER_STATE_DRIVER) || (oldstate == PLAYER_STATE_PASSENGER)))
  202. {
  203. for(new j=0; j<11; j++) GivePlayerWeapon(playerid, Oruzje[playerid][j], municija[playerid][j]);
  204. }
  205. return 1;
  206. }
  207.  
  208. public OnPlayerEnterCheckpoint(playerid)
  209. {
  210. return 1;
  211. }
  212.  
  213. public OnPlayerLeaveCheckpoint(playerid)
  214. {
  215. return 1;
  216. }
  217.  
  218. public OnPlayerEnterRaceCheckpoint(playerid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnPlayerLeaveRaceCheckpoint(playerid)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnRconCommand(cmd[])
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnPlayerRequestSpawn(playerid)
  234. {
  235. new string[128];
  236. if(RegistrovanLogovan[playerid] == 0) return ANTIB0(playerid,"Izbacen si zbog: "AC"Spawn Hacka"); Kick(playerid);
  237. format(string, sizeof(string), ""AC"ANTIB0: "WHITE"Igrac je izbacen zbog: "AC"Spawn Hacka "WHITE"(/offban)",Ime(playerid));
  238. AdminMessage(-1, string);
  239.  
  240. return 1;
  241. }
  242.  
  243. public OnObjectMoved(objectid)
  244. {
  245. return 1;
  246. }
  247.  
  248. public OnPlayerObjectMoved(playerid, objectid)
  249. {
  250. return 1;
  251. }
  252.  
  253. public OnPlayerPickUpPickup(playerid, pickupid)
  254. {
  255. return 1;
  256. }
  257.  
  258. public OnVehicleMod(playerid, vehicleid, componentid)
  259. {
  260. return 1;
  261. }
  262.  
  263. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  264. {
  265. return 1;
  266. }
  267.  
  268. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  269. {
  270. return 1;
  271. }
  272.  
  273. public OnPlayerSelectedMenuRow(playerid, row)
  274. {
  275. return 1;
  276. }
  277.  
  278. public OnPlayerExitedMenu(playerid)
  279. {
  280. return 1;
  281. }
  282.  
  283. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  284. {
  285. return 1;
  286. }
  287.  
  288. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  289. {
  290. if((newkeys & KEY_JUMP) && !IsPlayerInAnyVehicle(playerid))
  291. {
  292. Skocio[playerid] ++;
  293. SetTimerEx("SkociReset", 3000, false, "i", playerid);
  294. if(Skocio[playerid] == 3)
  295. {
  296. ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
  297. ANTIB0(playerid,"Zabranjeno je raditi Bunny Hop (Freezovani ste)!");
  298. SetTimerEx("KeyJump", 3000, false, "i", playerid);
  299. Freeze(playerid);
  300. }
  301. }
  302. return 1;
  303. }
  304.  
  305. public OnRconLoginAttempt(ip[], password[], success)
  306. {
  307. return 1;
  308. }
  309.  
  310. public OnPlayerUpdate(playerid)
  311. {
  312. if(UzmiBrzinu(playerid) > 280)
  313. {
  314. new string[128];
  315. ANTIB0(playerid,"Izbacen si zbog: "AC"Car Teleport"); Kick(playerid);
  316. format(string, sizeof(string), ""AC"ANTIB0: "WHITE"Igrac je izbacen zbog: "AC"Car Teleport "WHITE"(/offban)",Ime(playerid));
  317. AdminMessage(-1, string);
  318. return 1;
  319. }
  320. new Float:Armour; GetPlayerArmour(playerid, Armour);
  321. if(Armour > 99.0)
  322. {
  323. new string[128];
  324. ANTIB0(playerid,"Izbacen si zbog: "AC"Armour Hacka");
  325. format(string, sizeof(string), ""AC"ANTIB0: "WHITE"Igrac je izbacen zbog: "AC"Armour Hacka "WHITE"(/offban)",Ime(playerid));
  326. AdminMessage(-1, string);
  327. Kick(playerid);
  328. return 1;
  329. }
  330. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  331. {
  332. new string[128];
  333. ANTIB0(playerid,"Izbacen si zbog: "AC"Jetpack Hacka");
  334. format(string, sizeof(string), ""AC"ANTIB0: "WHITE"Igrac je izbacen zbog: "AC"Jetpack Hacka "WHITE"(/offban)",Ime(playerid));
  335. AdminMessage(-1, string);
  336. Kick(playerid);
  337. return 1;
  338. }
  339. switch(GetPlayerWeapon(playerid))
  340. {
  341. case 1,2,3,9,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
  342. {
  343. new string[128];
  344. ANTIB0(playerid,"Izbacen si zbog koriscenja: "AC"Weapon Hacka");
  345. format(string, sizeof(string), ""AC"ANTIB0: "WHITE"Igrac %s je izbacen zbog koriscenja: "AC"Weapon Hacka "WHITE"(/offban)", Ime(playerid));
  346. AdminMessage(-1, string);
  347. Kick(playerid);
  348. }
  349. }
  350. return 1;
  351. }
  352.  
  353. public OnPlayerStreamIn(playerid, forplayerid)
  354. {
  355. return 1;
  356. }
  357.  
  358. public OnPlayerStreamOut(playerid, forplayerid)
  359. {
  360. return 1;
  361. }
  362.  
  363. public OnVehicleStreamIn(vehicleid, forplayerid)
  364. {
  365. return 1;
  366. }
  367.  
  368. public OnVehicleStreamOut(vehicleid, forplayerid)
  369. {
  370. return 1;
  371. }
  372.  
  373. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  374. {
  375. return 1;
  376. }
  377.  
  378. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  379. {
  380. return 1;
  381. }
  382.  
  383.  
  384. forward AdminMessage(color, string[]);
  385. public AdminMessage(color, string[])
  386. {
  387. foreach(Player,i)
  388. {
  389. if(zAntiCheat[i][zAdmin] >= 1)
  390. {
  391. SCM(i, color, string);
  392. }
  393. }
  394. }
  395.  
  396. forward Freeze(playerid);
  397. public Freeze(playerid)
  398. {
  399. TogglePlayerControllable(playerid, 1);
  400. return 1;
  401. }
  402.  
  403. stock KoristiCaps(text[])
  404. {
  405. for( new i, j = strlen( text )-1; i < j; i ++ )
  406. {
  407. if( ( 'A' <= text[ i ] <= 'Z' ) && ( 'A' <= text[ i+1 ] <= 'Z' ) )
  408. return true;
  409. }
  410. return false;
  411. }
  412.  
  413. stock Ime(playerid)
  414. {
  415. new name[MAX_PLAYER_NAME];
  416. GetPlayerName(playerid, name, sizeof(name));
  417. return name;
  418. }
  419.  
  420. stock UzmiBrzinu(playerid)
  421. {
  422. new Float:ST[4];
  423. if(IsPlayerInAnyVehicle(playerid))
  424. GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  425. else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  426. ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 178.8617875;
  427. return floatround(ST[3]);
  428. }
  429.  
  430. forward KeyJump(playerid);
  431. public KeyJump(playerid)
  432. {
  433. Skocio[playerid] = 0;
  434. ClearAnimations(playerid);
  435. return 1;
  436. }
  437.  
  438. forward SkociReset(playerid);
  439. public SkociReset(playerid)
  440. {
  441. Skocio[playerid] = 0;
  442. return 1;
  443. }
  444.  
  445. public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
  446. {
  447. if( hittype != BULLET_HIT_TYPE_NONE )
  448. {
  449. if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) )
  450. {
  451. Kick(playerid);
  452. return 0;
  453. }
  454. }
  455. if( hittype == BULLET_HIT_TYPE_PLAYER )
  456. {
  457. if(hitid == playerid)
  458. {
  459. Kick(playerid);
  460. return 0;
  461. }
  462. }
  463. if( hittype == BULLET_HIT_TYPE_PLAYER )
  464. {
  465. if( fX == 0.000000 && fY == 0.000000 && fZ == 0.500000 && weaponid == 0)
  466. {
  467. Kick(playerid);
  468. return 0;
  469. }
  470. }
  471. if( hittype == 0 && !IsValidWeapon(weaponid) )
  472. {
  473. if( fX == 0.000000 && fY == 0.000000 && fZ == 0.000000 )
  474. {
  475. Kick(playerid);
  476. return 0;
  477. }
  478. }
  479. return 1;
  480. }
  481.  
  482. forward GivePlayerMoneyEx(playerid,ammount);
  483. public GivePlayerMoneyEx(playerid,ammount)
  484. {
  485. OldMoney[playerid] = GetPlayerMoney(playerid);
  486. NewMoney[playerid] = ammount;
  487. GivePlayerMoney(playerid,ammount);
  488.  
  489. return 1;
  490. }
  491.  
  492. forward CheckMoney();
  493. public CheckMoney()
  494. {
  495. foreach(Player,i)
  496. {
  497. if(IsPlayerConnected(i))
  498. {
  499. if(GetPlayerMoney(i) > NewMoney[i])
  500. {
  501. ResetPlayerMoney(i);
  502. GivePlayerMoney(i,OldMoney[i]);
  503. Ban(i);
  504. }
  505. }
  506. }
  507. return 1;
  508. }
Advertisement
Add Comment
Please, Sign In to add comment