Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* BadyX Security */
- /* Notas adicionales:
- Fecha de inicio del script: <====> Martes, 30 de Julio de 2013
- ========================== ¿Que detecta? ==========================
- 1) - Hack de dinero.
- 2) - Hack de vida.
- 3) - Hack de chaleco.
- 4) - Jeckpack.
- 5) - Hack de armas.
- 6) - Teleport interior coches.
- ============================== Debug ==============================
- Martes, 30 de Julio de 2013:
- - Comienzo del script.
- - Echo sistema de advertencias.
- - Sistema de logs para poder revisar las advertencias (Advertencias y baneados).
- - Sistema anticheats de dinero en funcionamiento ( 100 x 100 ).
- - Sistema anticheats de vida en funcionamiento ( Falta que detecte al perder vida ).
- - Sistema anticheats de chaleco en funcionamiento ( Falta que detecte al perder chaleco ).
- Miercoles, 31 de Julio de 2013:
- - Se a comenzado con el anticheats de armas (Por ahora sin exito).
- - Sistema anticheats de jeckpack. ( 100 x 100 ).
- Viernes, 2 de Agosto de 2013:
- - Se a terminado el sistema de anticheats de armas (Las pruebas realizadas son positivas) (Probar a retornar en 0 para que no puedan usarlas o que expulse dando una advertencia)
- - Se a comenzado con el sistema de anti hack de municion (Sin terminar)
- - Se a comenzado con el sistema de anti hack de anti healt car (Sin terminar)
- ========================================================================
- =========================== Instalacion ===========================
- - Para utilizar el anticheats de dinero:
- Se usara la siguiente funcion "DarDinero(playerid, Cantidad);"
- DarDinero sera el nombre de la funcion
- playerid al usuario que se le dara el dinero
- Cantidad sera la cantidad que queramos dar ( en numero ).
- - Para utilizar el anticheats de Vida:
- Se usara la siguiente funcion "VidaPlayer(playerid, Cantidad);"
- VidaPlayer sera el nombre de la funcion
- playerid al usuario que se le dara el dinero
- Cantidad sera la cantidad que queramos dar ( en numero ).
- - Para utilizar el anticheats de Chaleco:
- Se usara la siguiente funcion "ChalecoPlayer(playerid, Cantidad)"
- ChalecoPlayer sera el nombre de la funcion
- playerid al usuario que se le dara el dinero
- Cantidad sera la cantidad que queramos dar ( en numero ).
- - Para utilizar el anticheats de Armas:
- Se usara la siguiente funcion "DarArma(playerid,Arma,Municion);"
- DarArma sera el nombre de la funcion.
- playerid al usuario que se le dara el dinero.
- Arma sera la ID del arma a dar ( en numero ).
- Municion sera la cantidad de municion a dar ( en numero ).
- Nota:
- En este sistema se contempla tambien el anticheats de municion.
- ========================================================================
- */
- #include <a_samp>
- /* Macros */
- #define funcion%0(%1) \
- forward %0(%1); \
- public %0(%1)
- /* Colores */
- #define Azul 0x33CCFFAA
- /* Timers */
- //new TimerCheatsDinero;
- //new TimerCheatsCoches;
- /* Variables */
- /* Dinero */
- new Dinero[MAX_PLAYERS]; /* Variable con la cantidad de dinero de cada usuario */
- /* AntiHackVida */
- new Float:VidaUsuario[MAX_PLAYERS];
- new Float:ChalecoUsuario[MAX_PLAYERS];
- /* AntiHack de armas y municion */
- new ArmasUsuario[MAX_PLAYERS][47];
- new MunicionUsuario[MAX_PLAYERS][47];
- /* Variables coches */
- new Float:VidaCoches[MAX_VEHICLES];
- //new Float:VidaCoches[MAX_VEHICLES];
- /* Variables globales */
- new Advertencias[MAX_PLAYERS]; /* Si llega a 3 el usuario sera baneado automaticamente */
- new bool:EsAdministrador; /* Para poder acceder al menu rcon */
- new Spawn[MAX_PLAYERS]; /* Evita que se den advertencias al entrar */
- new Motivos[MAX_PLAYERS][6];
- new Advertido[MAX_PLAYERS];
- /* 0) - Hack dinero.
- 1) - Hack de vida.
- 2) - Hack de chaleco.
- 3) - JeckPack.
- 4) - Hack de armas.
- 5) - Municion.
- */
- //new Activador[MAX_PLAYERS][3];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n\n\n[Anticheats] --==== BadyX Security activado ====--");
- SetTimer("ComprobarCheats", 1000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(TimerCheatsDinero);
- KillTimer(TimerCheatsCoches);
- print("\n\n\n[Anticheats] --==== BadyX Security desactivado ====--");
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- funcion OnPlayerConnect(playerid)
- {
- SetearVariables(playerid);
- ComprobarAdmin(playerid);
- return 1;
- }
- funcion OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- funcion OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- funcion OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- funcion OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- funcion OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- funcion OnPlayerSpawn(playerid)
- {
- new DineroLegal;
- DineroLegal = GetPlayerMoney(playerid);
- Dinero[playerid] = DineroLegal;
- VidaPlayer(playerid, 50); /* Con esto evitaremos errores al spawnear */
- ChalecoPlayer(playerid, 50); /* Con esto evitaremos errores al spawnear */
- SetTimerEx("RealSpawn",3000,false,"i",playerid);
- return 1;
- }
- funcion OnPlayerStateChange(playerid, newstate, oldstate)
- {
- }
- funcion OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/Dararma", cmdtext, true, 10) == 0)
- {
- DarArma(playerid,24,50);
- return 1;
- }
- if (strcmp("/darcha", cmdtext, true, 10) == 0)
- {
- ChalecoPlayer(playerid, 50);
- return 1;
- }
- if (strcmp("/vervida", cmdtext, true, 10) == 0)
- {
- new Float:HP;
- GetPlayerHealth(playerid, HP);
- if(HP == VidaUsuario[playerid])
- {
- SendClientMessage(playerid, -1, # [Anticheats] Vida legal);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, # [Anticheats] Deja de chetarte vida);
- /* ReestablecerDinero(playerid, Dinero[playerid]);
- DarAdvertencia(playerid);
- break;*/
- return 1;
- }
- // return 1;
- }
- if (strcmp("/DarDinero", cmdtext, true, 10) == 0)
- {
- DarDinero(playerid, 5000);
- return 1;
- }
- if (strcmp("/darvida", cmdtext, true, 10) == 0)
- {
- VidaPlayer(playerid, 50);
- return 1;
- }
- if (strcmp("/RepararVehiculo", cmdtext, true, 10) == 0)
- {
- new IDCoche;
- IDCoche = GetPlayerVehicleID(playerid);
- VidaAuto(IDCoche, 0);
- return 1;
- }
- return 0;
- }
- funcion ChalecoPlayer(playerid, Float:Chaleco)
- {
- ChalecoUsuario[playerid] =Chaleco;
- SetPlayerArmour(playerid, Chaleco);
- return 1;
- }
- funcion ReestablecerChaleco(playerid, Float:Chaleco)
- {
- SetPlayerArmour(playerid, Chaleco);
- ChalecoUsuario[playerid] =Chaleco;
- return 1;
- }
- funcion VidaPlayer(playerid, Float:Vida)
- {
- VidaUsuario[playerid] =Vida;
- SetPlayerHealth(playerid, Vida);
- return 1;
- }
- funcion VidaAuto(IDCoche, Float:Vehicle_Health)
- {
- GetVehicleHealth(IDCoche, Vehicle_Health);
- SetVehicleHealth(IDCoche, Vehicle_Health);
- VidaCoches[IDCoche] = Vehicle_Health;
- return 1;
- }
- funcion ReestablecerVida(playerid, Float:Vida)
- {
- SetPlayerHealth(playerid, Vida);
- VidaUsuario[playerid] =Vida;
- return 1;
- }
- funcion DarDinero(playerid, Cantidad)
- {
- GivePlayerMoney(playerid, Cantidad);
- Dinero[playerid] += Cantidad;
- SendClientMessage(playerid, -1, # Pasta legal entregada);
- return 1;
- }
- funcion ReestablecerDinero(playerid, Cantidad)
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, Cantidad);
- Dinero[playerid] = Cantidad;
- return 1;
- }
- funcion RealSpawn(playerid)
- {
- Spawn[playerid] = 0;
- SendClientMessage(playerid, -1, # El tiempo a terminado );
- return 1;
- }
- funcion DarArma(playerid,Arma,Municion)
- {
- ArmasUsuario[playerid][Arma]=true;
- MunicionUsuario[playerid][Arma] += Municion;
- GivePlayerWeapon(playerid,Arma,Municion);
- return 1;
- }
- funcion ComprobarCheats()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(Spawn[i] == 1) continue;
- if(GetPlayerSpecialAction(i) == 2)
- {
- SendClientMessage(i , -1, # [Anticheats] Se te detecto un jeckpack );
- Motivos[i][3] = 1;
- DarAdvertencia(i);
- break;
- }
- new Float:aX,Float:aY,Float:aZ;
- GetPlayerVelocity(i, aX, aY, aZ);
- if(aX <= -0.800000 || aY <= -0.800000 || aZ <= -0.800000)
- {
- SendClientMessage(i , -1, # [Anticheats] Se a detectado AirBreak);
- break;
- }
- new Float:fX, Float:fY, Float:fZ;
- new animacion = GetPlayerAnimationIndex(i);
- GetPlayerPos(i, fX, fY, fZ);
- if((animacion >= 1538) && (animacion <= 1542) && fZ > 5)
- {
- SendClientMessage(i , -1, # [Anticheats] Se a detectado AirBreak);
- break;
- }
- if(GetPlayerMoney(i) == Dinero[i]) /* Anti hack de dinero */
- {
- }
- else
- {
- ReestablecerDinero(i, Dinero[i]);
- Motivos[i][0] = 1;
- DarAdvertencia(i);
- break;
- }
- new Float:HP;
- GetPlayerHealth(i, HP);
- if(HP == VidaUsuario[i]) /* Anti hack de vida */
- {
- }
- else
- {
- ReestablecerVida(i, VidaUsuario[i]);
- Motivos[i][1] = 1;
- DarAdvertencia(i);
- break;
- }
- new Float:armor;
- GetPlayerArmour(i, armor);
- if(armor == ChalecoUsuario[i]) /* Anti hack de chaleco */
- {
- }
- else
- {
- ReestablecerChaleco(i, ChalecoUsuario[i]);
- Motivos[i][2] = 1;
- DarAdvertencia(i);
- break;
- }
- }
- return 1;
- }
- /*
- funcion ComprobarCoches(playerid)
- {
- for(new i; i < MAX_VEHICLES; i++)
- {
- if(Spawn[i] == 1) continue;
- }
- return 1;
- }*/
- funcion DarAdvertencia(playerid)
- {
- new string[200];
- Advertencias[playerid] += 1;
- new hour,minuite,second;
- gettime(hour,minuite,second);
- new year, month,day;
- getdate(year, month, day);
- BorrarChat(playerid,20);
- new Motivo[20];
- if(Motivos[playerid][0] == 1) { Motivo = "Cheat de dinero"; }
- else if(Motivos[playerid][1] == 1) { Motivo = "Cheat de vida"; }
- else if(Motivos[playerid][2] == 1) { Motivo = "Cheat de chaleco"; }
- else if(Motivos[playerid][3] == 1) { Motivo = "Jetpack"; }
- else if(Motivos[playerid][4] == 1) { Motivo = "Cheat de armas"; }
- else if(Motivos[playerid][5] == 1) { Motivo = "Cheat de Municion"; }
- SendClientMessage(playerid, Azul, # [Anticheats] Recibiste una advertencia );
- format(string, sizeof(string), "Motivo %s.\nTienes un total de %d advertencias", Motivo, Advertencias[playerid]);
- SendClientMessage(playerid, Azul, string);
- format(string, sizeof(string), "[Anticheats] El Usuario %s fue advertido\n[(A las %d Minuto %d Segundo %d) Dia %d Mes %d Año %d)]", NombreEx(playerid) , hour, minuite,second , day, month, year);
- LogAdvertencias(string);
- /* if(Advertencias[playerid] > 2)
- {
- BorrarChat(playerid,20);
- format(string, sizeof(string), "[Anticheats] Fuiste baneado del servidor por una acumulación total de %d advertencias", Advertencias[playerid]);
- SendClientMessage(playerid, Azul, string);
- format(string, sizeof(string), "[Anticheats] El Usuario %s fue baneado", NombreEx(playerid));
- LogBaneados(string);
- return 1;
- }*/
- for(new slot = 0; slot != 6; slot++)
- {
- Motivos[playerid][slot] = 0;
- }
- return 1;
- }
- funcion SetearVariables(playerid)
- {
- for(new slot = 0; slot != 6; slot++)
- {
- Motivos[playerid][slot] = 0;
- }
- for(new i=0;i<47;i++)
- {
- ArmasUsuario[playerid][i]=false;
- MunicionUsuario[playerid][i]=0;
- }
- Dinero[playerid] = 0;
- Advertencias[playerid] = 0;
- Spawn[playerid] = 1;
- Advertido[playerid] = 0;
- return 1;
- }
- funcion LogAdvertencias(string[])
- {
- new entry[256];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("Logs/Advertidos.ini", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- funcion LogBaneados(string[])
- {
- new entry[256];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("Logs/Baneados.ini", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- funcion ComprobarAdmin(playerid)
- {
- EsAdministrador = false;
- new nick[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nick, sizeof(nick));
- if(!strcmp(nick, "BadyX", true)) { EsAdministrador = true; return 1; }
- //else if(!strcmp(nick, "Soporte_Metropolis", true))
- return 1;
- }
- funcion OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- funcion OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- funcion OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- funcion OnRconCommand(cmd[])
- {
- return 1;
- }
- funcion OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- funcion OnObjectMoved(objectid)
- {
- return 1;
- }
- funcion OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- funcion OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- funcion OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- funcion OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- funcion OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- funcion OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- funcion OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- funcion OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- funcion OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new string[128];
- if(newkeys & KEY_FIRE)
- {
- new IDArma = GetPlayerWeapon(playerid);
- if(IDArma != 0 && !ArmasUsuario[playerid][IDArma] && IDArma != 40)
- {
- Motivos[playerid][4] = 1;
- DarAdvertencia(playerid);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- else
- {
- return 1;
- }
- }
- if(newkeys & KEY_FIRE)
- {
- new IDArma = GetPlayerWeapon(playerid);
- new gunAmmo = GetPlayerAmmo(playerid);
- if(gunAmmo !=0 && !MunicionUsuario[playerid][IDArma] && IDArma != 40)
- {
- Motivos[playerid][4] = 1;
- DarAdvertencia(playerid);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- else
- {
- return 1;
- }
- }
- if(newkeys & KEY_WALK)
- {
- if(ObtenerVelocidad(playerid) > 50)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
- {
- case 0,460,476,511..513,519,520,553,577,592,593: printf("[ID: %d] Sobrepasó la velocidad de 230km/h pero utilizando un vehículo válido.");
- default:
- {
- new Float:sX, Float:sY, Float:sZ;
- GetPlayerPos(playerid, sX, sY, sZ);
- format(string, sizeof(string), "[ANTICHEAT] El jugador [ID: %d] ha sido golpeado. Razón: Utilización de Sobeit (Speed Hack).", playerid);
- SendClientMessageToAll(-1, string);
- RemovePlayerFromVehicle(playerid);
- SetPlayerPos(playerid, sX, sY, sZ+5);
- return 1;
- }
- }
- }
- }
- return 1;
- }
- funcion OnRconLoginAttempt(ip[], password[], success)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(EsAdministrador == false)
- {
- SendClientMessage(i, Azul, #[Anticheats] Usted no esta autorizado a usar el sistema Rcon);
- break;
- }
- }
- return 1;
- }
- funcion OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- new Float:Vehicle_Health;
- GetVehicleHealth(vehicleid, Vehicle_Health);
- if(Vehicle_Health == VidaCoches[vehicleid])
- {
- VidaCoches[vehicleid] = Vehicle_Health;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Azul, #[Anticheats] Hack vida coche);
- return 1;
- }
- }
- funcion OnPlayerUpdate(playerid)
- {
- new Float:HP;
- GetPlayerHealth(playerid, HP);
- if(HP >= VidaUsuario[playerid])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Azul, #[Anticheats] Variable vida actualizada);
- VidaPlayer(playerid, HP);
- return 1;
- }
- new Float:Chaleco;
- GetPlayerArmour(playerid, Chaleco);
- if(Chaleco >= ChalecoUsuario[playerid])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Azul, #[Anticheats] Variable chaleco actualizada);
- ChalecoPlayer(playerid, Chaleco);
- return 1;
- }
- }
- funcion OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- funcion OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- funcion OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- funcion OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- funcion OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- funcion OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- /* Funciones variadas */
- stock NombreEx(playerid)
- {
- new string[24];
- GetPlayerName(playerid,string,24);
- new str[24];
- strmid(str,string,0,strlen(string),24);
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (str[i] == '_') str[i] = ' ';
- }
- return str;
- }
- funcion BorrarChat(playerid, lineas)
- {
- if (IsPlayerConnected(playerid))
- {
- for(new i=0; i<lineas; i++)
- {
- SendClientMessage(playerid, -1, " ");
- }
- }
- return 1;
- }
- stock ObtenerVelocidad(playerid)
- {
- new Float:vX, Float:vY, Float:vZ, Float:Velocidad;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
- Velocidad = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)), floatpower(vZ, 2))), 100.0);
- return floatround(floatdiv(Velocidad, 0.75), floatround_floor);
- }
- //============================================================================//
- // //
- // //
- // //
- // //
- //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment