Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #define ANTICHEATER 0xFF912296
- forward AntiCheater();
- new
- ginvalidw[9] = {35, 36, 37, 38, 39, 40, 43, 44, 45},
- ginvalidv[3] = {520, 432, 425},
- ginvalidvn[3][0xF] = {"Hydra", "Rhino", "Hunter"},
- gspeedhw[MAX_PLAYERS][2],
- Float:gsppedhlc[MAX_PLAYERS][2],
- Float:gspeed[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- SetTimer("AntiCheater", 1000, 1);
- return 1;
- }
- public AntiCheater()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- new
- pname[0x18],
- string[0x80],
- Float:phealth;
- GetPlayerName(i, pname, sizeof pname);
- for(new j; j < sizeof ginvalidw; j++)
- {
- if(GetPlayerWeapon(i) == ginvalidw[j])
- {
- new
- wname[0x40];
- GetWeaponName(ginvalidw[j], wname, sizeof wname);
- format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de %s!", pname, wname);
- SendClientMessageToAll(ANTICHEATER, string);
- kick:
- Kick(i);
- return;
- }
- }
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- new
- Float:vhealth,
- Float:x,
- Float:y,
- Float:z;
- for(new j; j < sizeof ginvalidv; j++)
- {
- if(GetVehicleModel(GetPlayerVehicleID(i)) == ginvalidv[j])
- {
- format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de %s!", pname, ginvalidvn[j-0x190]);
- SendClientMessageToAll(ANTICHEATER, string);
- goto kick;
- }
- }
- GetVehicleHealth(i, vhealth);
- if(vhealth > 1000.0)
- {
- format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de GodCar!", pname);
- SendClientMessageToAll(ANTICHEATER, string);
- goto kick;
- }
- GetPlayerPos(i, x, y, z);
- gspeedhw[i][1]++;
- gspeed[i] = floatround(floatsqroot(
- floatpower(floatabs(floatsub(gsppedhlc[i][0], x)), 2) +
- floatpower(floatabs(floatsub(gsppedhlc[i][1], y)), 2)));
- gsppedhlc[i][0] = x;
- gsppedhlc[i][1] = y;
- new
- isaero, isnaval,
- aero[0x16] = {0x1A1, 0x1A9, 0x1BF, 0x1D1, 0x1D5, 0x1E7, 0x1E8, 0x1F1, 0x224, 0x223,
- 0x1CC, 0x1D0, 0x1DC, 0x1FF, 0x200, 0x201, 0x207, 0x208, 0x229, 0x241, 0x250, 0x251},
- naval[0x1A] = {0x1AE, 0x1BE, 0x1C4, 0x1C5, 0x1C6, 0x1D8, 0x1D9, 0x1E4, 0x1ED, 0x253,
- 0x192, 0x199, 0x19B, 0x19F, 0x1A8, 0x1AD, 0x1B2, 0x1C3, 0x1E0, 0x1FA, 0x215, 0x216,
- 0x218, 0x21D, 0x22B, 0x25A};
- for(new j; j < sizeof aero; j++)
- if(GetVehicleModel(GetPlayerVehicleID(i)) == aero[j])
- isaero = true;
- for(new j; j < sizeof naval; j++)
- if(GetVehicleModel(GetPlayerVehicleID(i)) == naval[j])
- isnaval = true;
- if((gspeed[i] > 0xA0 && !isaero) || (!isnaval && gspeed[i] > 0xB4) || (gspeed[i] > 0xD0))
- gspeedhw[i][0]++;
- if(gspeedhw[i][1] > 0x03)
- {
- if(gspeedhw[i][0] > 0x03)
- {
- format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de SpeedHack!", pname);
- SendClientMessageToAll(ANTICHEATER, string);
- for(new j; j < 2; j++)
- gspeedhw[i][j] = 0;
- goto kick;
- }
- for(new j; j < 2; j++)
- gspeedhw[i][j] = 0;
- }
- }
- GetPlayerHealth(i, phealth);
- if(phealth > 100.0)
- {
- format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de GodMode!", pname);
- SendClientMessageToAll(ANTICHEATER, string);
- goto kick;
- }
- }
- }
Add Comment
Please, Sign In to add comment