Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- .:: Hack Fighter AntiCheat ::.
- .:: Coded by Homer ::.
- .:: 2008 ::.
- .:: All Rights Reserved ::.
- */
- #include <a_samp>
- #include <HFunc>
- #define FILTERSCRIPT
- #define ORANGE 0xFF8C00AA
- #define GREEN 0x33AA33AA
- #define YELLOW 0xFFFF00AA
- #define HOMER 0xFF0000AA
- #define BLUE 0x33CCFFAA
- #define ABLUE 0x2641FEAA
- new MaxPing;
- new IsPlayerSpawned[MAX_PLAYERS];
- new DostanePrachy[MAX_PLAYERS];
- new StarePrachy[MAX_PLAYERS];
- forward CheckPing();
- forward CheckHacks();
- public OnFilterScriptInit()
- {
- print("\n-------------LOADING------------------");
- print(" Homer's Hack Fighter by PAWNTeam 2008");
- print("--------------------------------------\n");
- SetTimer("CheckHacks",2000,1);
- SetTimer("CheckPing",5000,1);
- MaxPing = 100;
- if(!fexist("hf.txt"))
- {
- print("WARNING! File hf.txt missing from scriptfiles!");
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n-------------UNLOADING----------------");
- print(" Homer's Hack Fighter by PAWNTeam 2008");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- IsPlayerSpawned[playerid] = 0;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- IsPlayerSpawned[playerid] = 1;
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new pName[MAX_PLAYER_NAME];
- new kName[MAX_PLAYER_NAME];
- new string[256];
- GetPlayerName(killerid, kName, sizeof(kName));
- GetPlayerName(playerid, pName, sizeof(pName));
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- format(string,256,"[HackFighter] %s[ID:%d] has killed %s[ID:%d] with Drive-By!",kName,killerid,pName,playerid);
- KickMessage(string);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[256];
- new tmp[256], cmd[256], idx;
- cmd = strtok(cmdtext, idx);
- new pName[MAX_PLAYER_NAME];
- if(strcmp(cmd, "/setping",true ) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,ORANGE,"[HackFighter] USAGE: /setping [MaxPing]");
- return 1;
- }
- if(strval(tmp) < 30 || strval(tmp) > 2000)
- {
- SendClientMessage(playerid,ORANGE,"[HackFighter] ERROR! Minimum is 30 and Maximum is 2000!");
- return 1;
- }
- MaxPing = strval(tmp);
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string,256,"[HackFighter] Admin %d[ID:%d] has set the Max ping to %d!",pName,playerid,MaxPing);
- SendClientMessageToAll(HOMER,string);
- }
- }else{
- SendClientMessage(playerid,ORANGE,"[HackFighter] You are not Admin!");
- return 1;
- }
- return 1;
- }
- return 0;
- }
- public CheckPing()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerPing(i) >= MaxPing && IsPlayerSpawned[i] == 1)
- {
- new Year,Month,Day;
- new Hour,Min,Sec;
- new pName[MAX_PLAYER_NAME];
- new string[256];
- getdate(Year,Month,Day);
- gettime(Hour,Min,Sec);
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: High Ping (Max. Allowed: %d)",pName,i,MaxPing);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- }
- }
- }
- public CheckHacks()
- {
- new pName[MAX_PLAYER_NAME];
- new string[256];
- new Float:HP,Float:ARM,Float:VehHP;
- new Ammo,VID,Money;
- new Year,Month,Day;
- new Hour,Min,Sec;
- for(new i; i < MAX_PLAYERS; i++)
- {
- GetPlayerHealth(i,HP);
- GetPlayerArmour(i,ARM);
- GetVehicleHealth(VID,VehHP);
- Ammo = GetPlayerAmmo(i);
- VID = GetPlayerVehicleID(i);
- Money = GetPlayerMoney(i);
- getdate(Year,Month,Day);
- gettime(Hour,Min,Sec);
- if(IsPlayerConnected(i))
- {
- if(GetPlayerWeapon(i) == 38) //Minigun
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Not Allowed Weapon (Minigun - %d Ammo)",pName,i,Ammo);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(GetPlayerWeapon(i) == 40) //Detonator
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Not Allowed Weapon (Detonator - %d Ammo)",pName,i,Ammo);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(GetPlayerWeapon(i) == 36) //RPG
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Not Allowed Weapon (RPG - %d Ammo)",pName,i,Ammo);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(GetPlayerWeapon(i) == 35) //Rocket Launcher
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Not Allowed Weapon (Rocket Launcher - %d Ammo)",pName,i,Ammo);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(GetPlayerSpecialAction(i) == 2) //JetPack
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Jet Pack",pName,i);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(HP > 100) //GodMode - Len ak m� health nad 100 - Nepou��va� /god
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: God Mode (%d HP)",pName,i,HP);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(ARM > 100) //GodMode - Len ak m� armour nad 100
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Armour Hack (%d HP)",pName,i,ARM);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(Ammo > 100000) //Viac ako 100000 Ammo - Prenastavte si ako potrebujete
- {
- GetPlayerName(i, pName, sizeof(pName));
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Ammo Hack (%d Ammo)",pName,i,Ammo);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(GetPlayerMoney(i) > StarePrachy[i] && !DostanePrachy[i]) //Money Cheat - Tak� pokus xD
- {
- format(string,256,"[HackFighter] %s[ID:%d] has been kicked. Reason: Money Hack ($%d)",pName,i,Money);
- SendClientMessageToAll(HOMER,string);
- format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds",pName,i,Day,Month,Year,Hour,Min,Sec);
- KickMessage(string);
- Kick(i);
- }
- if(VehHP > 1000) //Auto m� viac healthu ako 1000 - Maximum
- {
- RemovePlayerFromVehicle(i);
- DestroyVehicle(VID); //Auto sa proste zni��, preto�e sa nevie ktor� cheater to auto urobil
- }
- }
- }
- }
- stock KickMessage(const string[])
- {
- new File:HF = fopen("hf.txt",io_append);
- fwrite(HF, string);
- fclose(HF);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement