Advertisement
Guest User

Tec-Security

a guest
Jun 8th, 2014
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.97 KB | None | 0 0
  1. Link: http://samp-scripts.com/post/13552/T-Security_AntiHack_y_AntiAtaques_incluye_/sban/ScptProcura/filterscript/other
  2.  
  3.  
  4. FS Codigo
  5.  
  6. ////////////////////////////////////////////////////////////
  7. // ==}} ICE-SECURITY {{== //
  8. // Tec-Security Edicion Beta 1.0 //
  9. // **Creditos**: Creador del FS: Tec Manuel Garcia //////////////////
  10. //CleoFuck: Lorenc y Dicipulos Cessil, Infamous and [FeK]Drakins, JernejL//
  11. // IPS Proxys Baneadas: Tec Manuel Garcia ////////////////
  12. //Si este Sistema Cuenta con Funciones de FireSecurity Le doy Creditos//
  13. #include <a_samp>
  14. #include <CleoFuck>
  15. #include <a_vehicles>
  16. #include <sscanf2>
  17. #pragma tabsize 0
  18.  
  19. //DCMD PARA EL SBAN
  20. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  21. //=============//
  22. //SerialBan
  23. new Location[100] = "/Serial_Bans/%s.lock"; //
  24. //=============================================
  25. //Proteccion de RaKSamp Bot- Extraido de RaKSamp PRO R2 T-Security
  26. #define RakSAMP "DA0E5085558CCACC88ECCA40C4CEC49A9408EEE8" //Esta Funcion posiblemente este desabilitada en 0.3x, por la llegada de un Nuevo RakSamp
  27. //Control de Funciones ( 0 para desactivar, 1 para activar)
  28. #define AntiBotSerialBan 1 //Este Detiene ataques PingFlood, RaKSamp, y bots comunes en el server.
  29. #define AntiScoreHack 1 //Este evita el scoregratis incluido en el Nuevo RaKSamp 0.3x
  30. #define AntiCrash 1 //Este Evita los crash creados por Sobeit, Niex, RakSamp
  31. #define AntiRconBrute 1 //Este es un Comun desactivador de RCON EXTERNAS y evita la extracción de la Rcon Medianto los Comunes RconHacks
  32. #define AntiVisoresBug 1 //Evita los bugeros con los Binoculares Termicos
  33. #define ProxyBan 1 //Este Evita las entradas con los Proxys Mas concurridos.
  34. //Natives usados en T-Security
  35. native gpci(playerid,const serial[],maxlen);
  36. native IsValidVehicle(vehicleid);
  37. //Stocks de T-Security
  38. stock PlayerName2(playerid) {
  39. new name[MAX_PLAYER_NAME];
  40. GetPlayerName(playerid, name, sizeof(name));
  41. return name;
  42. }
  43. //Carros
  44. new legalmods[48][22] = {
  45. {400, 1024,1021,1020,1019,1018,1013,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  46. {401, 1145,1144,1143,1142,1020,1019,1017,1013,1007,1006,1005,1004,1003,1001,0000,0000,0000,0000},
  47. {404, 1021,1020,1019,1017,1016,1013,1007,1002,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  48. {405, 1023,1021,1020,1019,1018,1014,1001,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  49. {410, 1024,1023,1021,1020,1019,1017,1013,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
  50. {415, 1023,1019,1018,1017,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  51. {418, 1021,1020,1016,1006,1002,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  52. {420, 1021,1019,1005,1004,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  53. {421, 1023,1021,1020,1019,1018,1016,1014,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  54. {422, 1021,1020,1019,1017,1013,1007,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  55. {426, 1021,1019,1006,1005,1004,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  56. {436, 1022,1021,1020,1019,1017,1013,1007,1006,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
  57. {439, 1145,1144,1143,1142,1023,1017,1013,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
  58. {477, 1021,1020,1019,1018,1017,1007,1006,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  59. {478, 1024,1022,1021,1020,1013,1012,1005,1004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  60. {489, 1024,1020,1019,1018,1016,1013,1006,1005,1004,1002,1000,0000,0000,0000,0000,0000,0000,0000},
  61. {491, 1145,1144,1143,1142,1023,1021,1020,1019,1018,1017,1014,1007,1003,0000,0000,0000,0000,0000},
  62. {492, 1016,1006,1005,1004,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  63. {496, 1143,1142,1023,1020,1019,1017,1011,1007,1006,1003,1002,1001,0000,0000,0000,0000,0000,0000},
  64. {500, 1024,1021,1020,1019,1013,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  65. {516, 1021,1020,1019,1018,1017,1016,1015,1007,1004,1002,1000,0000,0000,0000,0000,0000,0000,0000},
  66. {517, 1145,1144,1143,1142,1023,1020,1019,1018,1017,1016,1007,1003,1002,0000,0000,0000,0000,0000},
  67. {518, 1145,1144,1143,1142,1023,1020,1018,1017,1013,1007,1006,1005,1003,1001,0000,0000,0000,0000},
  68. {527, 1021,1020,1018,1017,1015,1014,1007,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  69. {529, 1023,1020,1019,1018,1017,1012,1011,1007,1006,1003,1001,0000,0000,0000,0000,0000,0000,0000},
  70. {534, 1185,1180,1179,1178,1127,1126,1125,1124,1123,1122,1106,1101,1100,0000,0000,0000,0000,0000},
  71. {535, 1121,1120,1119,1118,1117,1116,1115,1114,1113,1110,1109,0000,0000,0000,0000,0000,0000,0000},
  72. {536, 1184,1183,1182,1181,1128,1108,1107,1105,1104,1103,0000,0000,0000,0000,0000,0000,0000,0000},
  73. {540, 1145,1144,1143,1142,1024,1023,1020,1019,1018,1017,1007,1006,1004,1001,0000,0000,0000,0000},
  74. {542, 1145,1144,1021,1020,1019,1018,1015,1014,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  75. {546, 1145,1144,1143,1142,1024,1023,1019,1018,1017,1007,1006,1004,1002,1001,0000,0000,0000,0000},
  76. {547, 1143,1142,1021,1020,1019,1018,1016,1003,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  77. {549, 1145,1144,1143,1142,1023,1020,1019,1018,1017,1012,1011,1007,1003,1001,0000,0000,0000,0000},
  78. {550, 1145,1144,1143,1142,1023,1020,1019,1018,1006,1005,1004,1003,1001,0000,0000,0000,0000,0000},
  79. {551, 1023,1021,1020,1019,1018,1016,1006,1005,1003,1002,0000,0000,0000,0000,0000,0000,0000,0000},
  80. {558, 1168,1167,1166,1165,1164,1163,1095,1094,1093,1092,1091,1090,1089,1088,0000,0000,0000,0000},
  81. {559, 1173,1162,1161,1160,1159,1158,1072,1071,1070,1069,1068,1067,1066,1065,0000,0000,0000,0000},
  82. {560, 1170,1169,1141,1140,1139,1138,1033,1032,1031,1030,1029,1028,1027,1026,0000,0000,0000,0000},
  83. {561, 1157,1156,1155,1154,1064,1063,1062,1061,1060,1059,1058,1057,1056,1055,1031,1030,1027,1026},
  84. {562, 1172,1171,1149,1148,1147,1146,1041,1040,1039,1038,1037,1036,1035,1034,0000,0000,0000,0000},
  85. {565, 1153,1152,1151,1150,1054,1053,1052,1051,1050,1049,1048,1047,1046,1045,0000,0000,0000,0000},
  86. {567, 1189,1188,1187,1186,1133,1132,1131,1130,1129,1102,0000,0000,0000,0000,0000,0000,0000,0000},
  87. {575, 1177,1176,1175,1174,1099,1044,1043,1042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  88. {576, 1193,1192,1191,1190,1137,1136,1135,1134,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  89. {580, 1023,1020,1018,1017,1007,1006,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  90. {589, 1145,1144,1024,1020,1018,1017,1016,1013,1007,1006,1005,1004,1000,0000,0000,0000,0000,0000},
  91. {600, 1022,1020,1018,1017,1013,1007,1006,1005,1004,0000,0000,0000,0000,0000,0000,0000,0000,0000},
  92. {603, 1145,1144,1143,1142,1024,1023,1020,1019,1018,1017,1007,1006,1001,0000,0000,0000,0000,0000}
  93. };
  94. iswheelmodel(modelid) {
  95. new wheelmodels[17] = {1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098};
  96. for(new wm; wm < sizeof(wheelmodels); wm++) {
  97. if (modelid == wheelmodels[wm])
  98. return true;
  99. }
  100. return false;
  101. }
  102.  
  103. IllegalCarNitroIde(carmodel) {
  104. new illegalvehs[29] = { 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 590, 569, 537, 538, 570, 449 };
  105. for(new iv; iv < sizeof(illegalvehs); iv++) {
  106. if (carmodel == illegalvehs[iv])
  107. return true;
  108. }
  109. return false;
  110. }
  111.  
  112. stock islegalcarmod(vehicleide, componentid) {
  113. new modok = false;
  114. if ( (iswheelmodel(componentid)) || (componentid == 1086) || (componentid == 1087) || ((componentid >= 1008) && (componentid <= 1010))) {
  115. new nosblocker = IllegalCarNitroIde(vehicleide);
  116. if (!nosblocker)
  117. modok = true;
  118. } else {
  119. for(new lm; lm < sizeof(legalmods); lm++) {
  120. if (legalmods[lm][0] == vehicleide) {
  121. for(new J = 1; J < 22; J++) {
  122. if (legalmods[lm][J] == componentid)
  123. modok = true;
  124. }
  125. }
  126. }
  127. }
  128. return modok;
  129. }
  130.  
  131. #define Seguridad_Color 0xFF9900AA
  132.  
  133. //Aqui empiesan las Funciones de Tec-Security con los Publics
  134. public OnFilterScriptInit()
  135. {
  136. print("| --------------------------------------");
  137. print(" ");
  138. print(" Has arrancado en tu servidor ICESECURITY- Tec-Security (Edicion 1.0 Beta).");
  139. print(" ");
  140. print(" --------------------------------------");
  141. #if defined AntiRconBrute 1
  142. SendRconCommand("rcon 0");
  143. #endif
  144. #if defined ProxyBan 1
  145. SendRconCommand("banip 62.173.43.73");
  146. SendRconCommand("banip 202.70.136.158");
  147. SendRconCommand("banip 190.189.114.41"); //Esta Proviene de Servidores Argentinos
  148. SendRconCommand("banip 218.108.114.140");
  149. SendRconCommand("banip 186.96.254.226");
  150. SendRconCommand("banip 68.55.148.148");
  151. SendRconCommand("banip 142.4.4.57");
  152. SendRconCommand("banip 128.127.46.192");
  153. SendRconCommand("banip 173.72.110.132");
  154. SendRconCommand("banip 190.85.37.115");
  155. SendRconCommand("banip 198.145.180.225");
  156. //Estas Son las Proxys mas Usadas si quieres agregar mas visita http://www.freeproxylists.net/ y/o http://hidemyass.com/proxy-list/
  157. //Siguiendo la Syntexis de los Codigos.
  158. #endif
  159. return 1;
  160. }
  161.  
  162. public OnFilterScriptExit()
  163. {
  164. print("| --------------------------------------");
  165. print(" ");
  166. print(" Has cerrado en tu servidor ICESECURITY- Tec-Security (Edicion 1.0 Beta).");
  167. print(" ");
  168. print(" --------------------------------------");
  169. return 1;
  170. }
  171.  
  172. public OnPlayerConnect(playerid)
  173. {
  174.  
  175. #if defined AntiBotSerialBan 1
  176. new string2[350];
  177. // Sban
  178. new Code[50], Line[256];
  179. SendClientMessage(playerid,0xFF9900AA," Este Servidor Cuenta con T-Security creado por Tec Manuel Garcia"); //Creditos
  180. //SerialBan
  181. gpci(playerid, Code, sizeof Code);
  182.  
  183. format(Line, sizeof(Line), Location, Code);
  184. if(fexist(Line)) return Kick(playerid);
  185. //Division en Antibots y Sban
  186. gpci(playerid,string2,sizeof(string2));
  187. if(!strcmp(string2,RakSAMP,true))
  188. {
  189. format(string2, sizeof(string2), "[T-Security]: {0000FF} Player %s Baneado [Motivo-RakSamp, Bots, Niex. ]",PlayerName2(playerid));
  190. SendClientMessageToAll(Seguridad_Color, string2);
  191. //Baneo del Jugador En Funcion, Puedes cambiar el Banex por Kick(playerid);
  192. BanEx(playerid,"ICESECURITY.-.T-Security Edicion Beta [EXPULSADO]");
  193. return 0;
  194. }
  195. #endif
  196. return 1;
  197. }
  198. //AntiCrasheo para el Servidor
  199. #if defined AntiCrash 1
  200. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  201. {
  202. if(!IsValidVehicle(vehicleid))
  203. {
  204. new string[300];
  205. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Expulsado [Razon: Sobeit-Crash/RakSamp Lag Detectado.]",PlayerName2(playerid));
  206. SendClientMessageToAll(Seguridad_Color, string);
  207. //Esta Funcion Desaparece el el vehiculo Ilegal
  208. DestroyVehicle(vehicleid);
  209. //En esta Funcion se kickea al Player puedes Cambiar esta Funcion por Baneo BanEx(playerid, "Mensaje");
  210. Kick(playerid);
  211. }
  212. return 1;
  213. }
  214. #endif
  215. //Este CallBack fue integrado Gracias a FuckCleo, y reconociendo una Funcion Muy Buena con la que contaba FireSecurity (CREDITOS A FUCKCLEO Y FIRESECURITY QUE HALLARON ESTA FUNCION MUY VALIOSA)
  216. public OnPlayerCleoDetected( playerid, cleoid )
  217. {
  218. switch( cleoid )
  219. {
  220. #if defined AntiScoreHack
  221. case CLEO_FAKEKILL:
  222. {
  223. new string[300];
  224. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Expulsado [Causa-ScoreHack. ]",PlayerName2(playerid));
  225. SendClientMessageToAll(Seguridad_Color, string);
  226. BanEx( playerid, "Gracias por Hacer Valer este Sistema de Seguridad" );
  227. }
  228. #endif
  229. case CLEO_CARWARP:
  230. {
  231. new string[300];
  232. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Baneado [Causa-CarWarping. ] ",PlayerName2(playerid));
  233. SendClientMessageToAll(Seguridad_Color, string);
  234. BanEx( playerid, "Lo siento No puedes Hacer esto aqui." );
  235. }
  236. case CLEO_CARSWING:
  237. {
  238. new string[300];
  239. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Baneado {FFDB70}[Causa-CarSwing. ]",PlayerName2(playerid));
  240. SendClientMessageToAll(Seguridad_Color, string);
  241. BanEx( playerid, "Me despido de Ti Cheto" );
  242. }
  243. //Esta Funcion evita el Flood de automoviles que causan lag y despues Crash
  244. case CLEO_CAR_PARTICLE_SPAM:
  245. {
  246. new string[300];
  247. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Baneado [Causa-Crasher]",PlayerName2(playerid));
  248. SendClientMessageToAll(Seguridad_Color, string);
  249. BanEx( playerid, "Vete a otro Lado Idiota" );
  250. }
  251. }
  252. return 1;
  253. }
  254. //Anti Bots, Funcion SA-MP
  255. public OnPlayerUpdate(playerid)
  256. {
  257. #if defined AntiBot 1
  258. //Detecta el Ping, y si el maximo es el marcado (Default: 5000MS), Lo Expulsa
  259. if(GetPlayerPing(playerid) >= 5000)
  260. {
  261. new string[300];
  262. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Expulsado [Causa-PingFlood/Bots ]",PlayerName2(playerid));
  263. SendClientMessageToAll(Seguridad_Color, string);
  264. Kick(playerid);
  265. return 1;
  266. }
  267. #endif
  268.  
  269. #if defined AntiVisoresBug 1
  270. if((GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45) && !IsPlayerInAnyVehicle(playerid))
  271. {
  272. new keys, ud, lr;
  273. GetPlayerKeys(playerid, keys, ud, lr);
  274. if(keys & KEY_FIRE)
  275. {
  276. return 0;
  277. }
  278. return 1;
  279. }
  280. #endif
  281. return 1;
  282. }
  283. //Esta Funcion Banea a los Crasheros que tienen Sobeit y usan TELEHACK para hacercarse al Player y Crashearlo.
  284. public OnVehicleMod(playerid, vehicleid, componentid) {
  285.  
  286. #if defined AntiCrash 1
  287. new vehicleide = GetVehicleModel(vehicleid);
  288. new modok = islegalcarmod(vehicleide, componentid);
  289.  
  290. if (!modok)
  291. {
  292. new string[300];
  293. format(string, sizeof(string), "[T-Security]: {0000FF} Player %s Baneado [Causa-CheatCrash ] ",PlayerName2(playerid));
  294. SendClientMessageToAll(Seguridad_Color, string);
  295. Ban(playerid);
  296. }
  297. return 1;
  298. #endif
  299. }
  300. public OnPlayerCommandText(playerid, cmdtext[])
  301. {
  302. dcmd(sban, 4, cmdtext);
  303. dcmd(detectarserial, 14, cmdtext);
  304. return 0;
  305. }
  306. dcmd_sban(playerid, params[])
  307. {
  308. if(!IsPlayerAdmin(playerid)) return 0;
  309.  
  310. new Code[50], Line[128], User, Nickname[MAX_PLAYER_NAME];
  311.  
  312. if(sscanf(params, "u", User)) return SendClientMessage(playerid, 0xFF0000FF, "[T-Security]: /sban <nickname> /sban <id>");
  313. if(!IsPlayerConnected(User)) return SendClientMessage(playerid, 0xFF0000FF, "[T-Security]: Ningun Jugador detectador con esa informacion");
  314.  
  315. gpci(User, Code, sizeof(Code));
  316. format(Line, sizeof(Line), Location, Code);
  317.  
  318. GetPlayerName(User, Nickname, sizeof(Nickname));
  319.  
  320. new File:Datoteka = fopen(Line, io_write);
  321. fwrite(Datoteka, Nickname);
  322. fclose(Datoteka);
  323.  
  324. Kick(User);
  325.  
  326. SendClientMessage(playerid, 0xFFFFFF, "[T-Security]:Usuario Añadido al Lista de SerialBaneado y fue expulsado del Server.");
  327. return 1;
  328. }
  329.  
  330.  
  331.  
  332.  
  333. dcmd_detectarserial(playerid, params[])
  334. {
  335. if(!IsPlayerAdmin(playerid)) return 0;
  336.  
  337. new Code[50], Line[128], User;
  338.  
  339. if(sscanf(params, "u", User)) return SendClientMessage(playerid, 0xFF0000FF, "[T-Security]: /detectarserial <Nickname / ID>");
  340. if(!IsPlayerConnected(User)) return SendClientMessage(playerid, 0xFF0000FF, "[T-Security]: No se encontro ningun usuario con esa Informacion");
  341.  
  342. gpci(User, Code, sizeof(Code));
  343. format(Line, sizeof(Line), "Serial del Usuario: %s", Code);
  344.  
  345.  
  346. SendClientMessage(playerid, 0xFFFFFF, Line);
  347. return 1;
  348. }
  349. //Final de T-Security
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement