21.12.2012, 12:20
(
Last edited by Luxorz; 21/12/2012 at 01:05 PM.
)
Description: - Anti-Health Cheating (Detects v-0gelz)
- Anti-BannedWeapon Detection (Inventory Check)
- Anti-Spawn Killing
- Anti-DriveBy Abuse
- Anti-Prolong Inactivity (Pausers)
- Anti-Interior Kill
- Clone Detection
include:
PWN:
Regards.
NOTE:- Anti-BannedWeapon Detection (Inventory Check)
- Anti-Spawn Killing
- Anti-DriveBy Abuse
- Anti-Prolong Inactivity (Pausers)
- Anti-Interior Kill
- Clone Detection
include:
PHP Code:
/*
==============================
FuckIt Anti-Cash-Cheat
Include File
==============================
*/
#pragma unused EZ_DeleteProperty
#pragma unused EZ_ExistProperty
new cashb[MAX_PLAYERS];
FcukIt_ResetPlayerMoney(playerid)
{
ResetPlayerMoney(playerid);
new gptmp[32], id[8], tmpcash[32] = "0";
valstr(id, playerid, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
EZ_SetProperty(gptmp, tmpcash);
}
FcukIt_GivePlayerMoney(playerid, amount)
{
GivePlayerMoney(playerid, amount);
cashb[playerid] += amount;
new gptmp[32], id[8], tmpcash[32];
valstr(id, playerid, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
valstr(tmpcash, (strval(EZ_GetProperty(gptmp)) + amount), false);
EZ_SetProperty(gptmp, tmpcash);
}
stock EZ_SetProperty(name[], string[])
{
strpack(string, string, 256);
setproperty(0, "", hash(name), string);
}
stock EZ_GetProperty(name[])
{
new string[256];
getproperty(0, "", hash(name), string);
strunpack(string, string, 256);
return string;
}
stock EZ_DeleteProperty(name[])
{
if(existproperty(0, "", hash(name))){
deleteproperty(0,"",hash(name));}
else {
printf("<EZ-GSP> Property Does Not Exist (%s)", name);
}
}
stock EZ_ExistProperty(name[])
{
if(existproperty(0, "", hash(name))) return 1;
return 0;
}
stock hash(etmp[])
{
new i;
new s1 = 1;
new s2 = 0;
new length=strlen(etmp);
for (i=0; i<length; i++)
{
s1 = (s1 + etmp[i]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
PHP Code:
/*
=================================
FuckIt Anti-Cheat V1
=================================
======================================================
- Improved Stability and Efficiency
- Decreased Chances of False Health-Detection (Paused)
- Removed Spoof-Detection (Outdated)
- Intergrated FuckIt++
- Overhauled Anti-Lagg to increase efficiency
======================================================
Notes
This filterscript is designed with efficiency, reliability
and stability as core factors.
In my opinion, due to the fact filterscripts are processed
in addition to gamemodes, anticheats often run resource hungry
loops and calculations very often and stability is a well known
issue with Scripts/SA:MP. I have ommited any detection that
isn't accurate enough, too resource hungry or unneccesary.
=======================================================
*/
#include <a_samp>
#include <ezgsp>
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
forward MaxInterval(); aBan(playerid); aKick(playerid); pCheck(); pLoop(); hLoop2(); pausetest(); pauseresult(); hSelect(); pausetest1(); pausetest2(); pausetest3(); vCheck(); cLoop(); //SpoofLoop(playerid, killerid);
// IMPORTANT: Change "50" to your servers set maximum players for MAXIMUM EFFICIENCY
#define MP 50
// IMPORTANT: DECLARE YOUR DESIRED "STUNTCASH" LIMIT
new stuntcash = 1999;
#pragma unused EZ_ExistProperty
#pragma unused EZ_DeleteProperty
/*
======================
Declarations
======================
*/
// Settings
new aWa, aCashInc, aDbkills, aHealth, aCash, aDrive, aInac, aItime, cCheck,
hCheck, aIkill, aSkill, aStime, aSlimit, /*aSpoof,*/ aClone, aLog, aLagg, aOnKill;
new Float:Health, Float:HealthB, hcStage, rp; // Health Check
new Float:hx, Float:hy, Float:hz, Float:thx, Float:thy, Float:thz;
new Cashb[MP], Cash[MP]; // Cash Check
new dbcount[MP]; // Anti Drive-By-Abuse
new settimer = 0;
new aWpn1, aWpn2, aWpn3, aWpn4, aWpn5, aWpn6, aWpn7, aWpn8, aWpn9, aWpn10, aWpn11, aWpn12; // Anti-BannedWeapons
new Float:Xb[MP], Float:Yb[MP], Float:Zb[MP], Float:Xa[MP], Float:Ya[MP], Float:Za[MP];
new sTime[MP], sCount[MP];
new gString[128];
new hTIME, cTIME, iTIME, sTIME, wTIME;
new Kicks=0, Bans=0, Disarms=0;
enum CD_ENUM
{
PlayerIP[32]
}
new CloneData[MP][CD_ENUM];
new bWeapons[12];
#pragma unused aWpn1
/*
=================
Anti-LaGG
=================
*/
new pLimit;
new pIntervals;
new pTime;
new pTolerance;
new pWarning;
new pWarnings[MP];
/*
======================
Main
======================
*/
stock PlayerName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}
public OnFilterScriptInit()
{
rConfig();
pTime = (pIntervals*2);
bWeapons[0] = -1; bWeapons[1] = aWpn2; bWeapons[2] = aWpn3; bWeapons[3] = aWpn4;
bWeapons[4] = aWpn5; bWeapons[5] = aWpn6; bWeapons[6] = aWpn7; bWeapons[7] = aWpn8;
bWeapons[8] = aWpn9; bWeapons[9] = aWpn10; bWeapons[10] = aWpn11; bWeapons[11] = aWpn12;
print("\n FuckIt Anti-Cheat V1 by [DRuG]Scarface ");
print(" Loading Configuration......\n");
print(" Configuration: ");
if(aWa > 0){ print(" |Anti-BWeapons [Activated]"); }else{ print(" |Anti-BWeapons [Disabled]"); }
if(aHealth > 0){ print(" |Anti-HealthHack [Activated]"); }else{ print(" |Anti-HealthHack [Disabled]"); }
if(aCash > 0){ print(" |Anti-MoneyHack [Activated]"); }else{ print(" |Anti-MoneyHack [Disabled]"); }
if(aDrive > 0){ print(" |Anti-DriveBy [Activated]"); }else{ print(" |Anti-DriveBy [Disabled]"); }
if(aInac > 0){ print(" |Anti-Inactivity [Activated]"); }else{ print(" |Anti-Inactivity [Disabled]"); }
if(aIkill > 0){ print(" |Anti-IntKills [Activated]"); }else{ print(" |Anti-IntKills [Disabled]"); }
if(aSkill > 0){ print(" |Anti-SpawnKill [Activated]"); }else{ print(" |Anti-SpawnKill [Disabled]"); }
// if(aSpoof > 0){ print(" |Anti-Spoofing [Activated]"); }else{ print(" |Anti-Spoofing [Disabled]"); }
if(aClone > 0){ print(" |Anti-Cloning [Activated]"); }else{ print(" |Anti-Cloning [Disabled]"); }
if(aLog > 0){ print(" |IP-Log [Activated]"); }else{ print(" |IP-Log [Disabled]"); }
if(aCash > 0){ printf(" |Max-Cash-Inc [%d]",aCashInc); }
if(aDrive > 0){ printf(" |Max-DB-Kills [%d]",aDbkills); }
if(aInac > 0){ printf(" |Inactive-Time [%d]",aItime); }
if(aHealth > 0){ printf(" |CashCheck-Time [%d]",cCheck); }
if(aCash > 0){ printf(" |HealthCheck-Time [%d]",hCheck); }
if(aSkill > 0){ printf(" |Spawn-Kill-Time [%d]",aStime); }
if(aCash > 0){ printf(" |Max-Spawn-Kills [%d]\n",aSlimit); }
if(aLagg > 0){ print(" |Anti-LaGG [Activated]"); }else{ print(" |Anti-LaGG [Disabled]"); }
printf(" |Ping Limit = %d",pLimit);
printf(" |Check Intervals = %d",pIntervals);
if(pWarning == 1)
{
printf(" |Ping Tolerance = %d\n",pTolerance);
}
print("------------------------------------------------------");
print(" Server Monitored by FuckIt V1");
print("------------------------------------------------------");
return 1;
}
public OnPlayerDisconnect(playerid)
{
dbcount[playerid] = 0;
Cashb[playerid] = 0;
Cash[playerid] = 0;
sTime[playerid] = 0;
sCount[playerid] = 0;
pWarnings[playerid] = 0;
ClearIPData(playerid);
if(playerid == rp) hcStage = 0;
// Cash Detection
new gptmp[32], id[8], tmpcash[32] = "0";
valstr(id, playerid, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
EZ_SetProperty(gptmp, tmpcash);
return 1;
}
public OnPlayerConnect(playerid)
{
GetIPData(playerid);
if(aLog > 0) Log(playerid);
dbcount[playerid] = 0;
pWarnings[playerid] = 0;
Xb[playerid]=4000.0, Yb[playerid]=4000.0, Zb[playerid]=4.0;
Cashb[playerid] = 500;
if(settimer!=1)
{
SetTimer("MaxInterval",500,1);
hTIME = (hCheck*2);
cTIME = (cCheck*2);
iTIME = (aItime*2);
wTIME = 9;
sTIME = 2;
settimer=1;
}
SendClientMessage(playerid, 0xFFFF00AA, "*** Server Monitored by FuckIt V1! [by[DRuG]Scarface]");
if(pWarning == 0 && aLagg != 0)
{
format(gString, sizeof(gString), "Ping Limit: %dms", pLimit);
SendClientMessage(playerid, 0xFFFF00AA, gString);
}
if(pWarning > 0 && aLagg != 0)
{
format(gString, sizeof(gString), "Ping Limit: %dms Tolerance: %dms", pLimit, pTolerance);
SendClientMessage(playerid, 0xFFFF00AA, gString);
}
return 1;
}
public MaxInterval()
{
hTIME--; cTIME--; iTIME--; sTIME--; pTime--; wTIME--;
if(aHealth > 0 && hTIME == 0){ hSelect(); hTIME = (hCheck*2);} /*print("hLoop Started...");*/
if(aWa > 0 && wTIME == 0){ rWeapon(); wTIME = (hCheck*2);} /*print("wLoop Started...");*/
if(aCash > 0 && cTIME == 0){ cLoop(); cTIME = (cCheck*2);} /*print("cLoop Started...");*/
if(aInac > 0 && iTIME == 0){ iLoop(); iTIME = (aItime*2);} /*print("iLoop Started...");*/
if(aSkill > 0 && sTIME == 0){ sLoop(); sTIME = 2;} /*print("sLoop Started...");*/
if(pTime == 0){ pLoop(); pTime = (pIntervals*2);} /*print("pingLoop Started...");*/
}
public OnPlayerSpawn(playerid)
{
sTime[playerid] = aStime;
return 1;
}
stock ActivePlayerCount()
{
new players=0;
for(new pc=0; pc<MP; pc++)
{
if(IsPlayerConnected(pc))
{
players++;
}
}
return players;
}
/*
====================
Health Check
====================
*/
stock hSelect()
{
if(ActivePlayerCount() != 0)
{
rp = random(MP);
if(IsPlayerConnected(rp))
{
hcStage = 0;
Health = 0.0;
HealthB = 0.0;
hcStage = 1;
pausetest();
}
else
{
hSelect();
return 1;
}
}
return 1;
}
public pausetest()
{
if(IsPlayerConnected(rp) && hcStage == 1 && CorrectState(rp))
{
GetPlayerPos(rp, hx, hy, hz);
SetTimer("pausetest1", 1200,0);
return 1;
}
return 0;
}
public pausetest1()
{
if(IsPlayerConnected(rp) && hcStage == 1 && CorrectState(rp))
{
hcStage = 2;
GetPlayerPos(rp, thx, thy, thz);
if(thx != hx || thy != hy || thz != hz)
{
pauseresult();
}
else {
hcStage = 0;
}
}
return 0;
}
public pauseresult()
{
if(IsPlayerConnected(rp) && hcStage == 2)
{
new Float:hx2, Float:hy2, Float:hz2;
GetPlayerPos(rp, hx2, hy2, hz2);
if(hx2 == hx && hy2 == hy && hz == hz2)
{
hcStage = 0;
return 1;
}
else
{
if(aHealth > 0)
{
if(IsPlayerConnected(rp) && CorrectState(rp))
{
new Float:tmpVal;
GetPlayerHealth(rp, tmpVal);
HealthB = tmpVal;
SetPlayerHealth(rp, (tmpVal-1.0));
hcStage = 3;
SetTimer("hLoop2",1000,0);
}
}
}
}
return 0;
}
public hLoop2()
{
if(IsPlayerConnected(rp) && hcStage == 3 && CorrectState(rp))
{
GetPlayerHealth(rp, Health);
new Float:hx2, Float:hy2, Float:hz2;
GetPlayerPos(rp, hx2, hy2, hz2);
if(Health == HealthB && CorrectState(rp) && HealthB != 0.0)
{
{
if(aHealth == 1)
{
FcukKick(rp, "Health Cheating");
}
else if(aHealth == 2)
{
FcukBan(rp, "Health Cheating");
}
}
return 1;
}
else {
new Float:testh2;
GetPlayerHealth(rp,testh2);
SetPlayerHealth(rp,(testh2+1.0));
hcStage = 0;
}
}
return 0;
}
stock CorrectState(playerid)
{
if(GetPlayerState(playerid) == 0) return 0;
if(GetPlayerState(playerid) == 7) return 0;
if(GetPlayerState(playerid) == 8) return 0;
if(GetPlayerState(playerid) == 9) return 0;
return 1;
}
/*
====================
Cash Check
====================
*/
public cLoop()
{
for(new c=0;c<MAX_PLAYERS;c++)
{
new rCash = GetPlayerMoney(c);
if(IsPlayerConnected(c))
{
new gptmp[32], id[8], trans[32];
valstr(id, c, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
new CashCount = strval(EZ_GetProperty(gptmp));
if(rCash != CashCount)
{
new tcash2;
tcash2 = rCash-CashCount;
if(tcash2 > stuntcash && CashCount < rCash)
{
if(!IsPlayerGambling(c))
{
if(rCash > CashCount)
{
if(aCash == 1)
{
FcukKick(c, "Money Cheating");
}
else if(aCash == 2)
{
FcukBan(c, "Money Cheating");
}
}
else {
valstr(id, c, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
valstr(trans, rCash, false);
EZ_SetProperty(gptmp, trans);
}
}
else {
valstr(id, c, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
valstr(trans, rCash, false);
EZ_SetProperty(gptmp, trans);
}
}
else {
valstr(id, c, false);
strins(gptmp, "c", 0, 32);
strins(gptmp, id, 1, 32);
valstr(trans, rCash, false);
EZ_SetProperty(gptmp, trans);
}
}
}
}
}
IsPlayerGambling(playerid)
{
new Float:bX;
new Float:bY;
new Float:bZ;
GetPlayerPos(playerid, Float:bX, Float:bY, Float:bZ);
if((Float:bX > 1925.1527 && Float:bX < 1975.8721) && (Float:bY > 968.2526 && Float:bY < 1052.2089)){
return 1;
}
if((Float:bX > 2161.6980 && Float:bX < 2281.1763) && (Float:bY > 1557.5767 && Float:bY < 1630.5237)){
return 1;
}
return 0;
}
/*
========================
Inactivity Check
========================
*/
stock iLoop()
{
for(new i=0;i<MP;i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, Float:Xa[i], Float:Ya[i], Float:Za[i]);
if((Float:Xa[i] == Float:Xb[i]) && (Float:Ya[i] == Float:Yb[i]))
{
if(aInac == 1)
{
FcukKick(i, "Prolonged Inactivity");
}
else if(aInac == 2)
{
FcukBan(i, "Prolonged Inactivity");
}
}
else {
Xb[i] = Xa[i];
Yb[i] = Ya[i];
}
}
}
}
/*
========================
S-Kill Detection
========================
*/
stock sLoop()
{
for(new s=0;s<MP;s++)
{
if(IsPlayerConnected(s))
{
if(sTime[s] > 0)
{
sTime[s]--;
}
}
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
/* if(aSpoof > 0)
{
if(IsPlayerConnected(killerid) && IsPlayerConnected(playerid) && reason != INVALID_PLAYER_ID)
{
SetTimerEx("SpoofLoop", 500, 0, "i", playerid, killerid);
print("SpoofLoop Started...");
}
}*/
if(aDrive > 0)
{
if(IsPlayerInAnyVehicle(killerid) && reason != WEAPON_VEHICLE)
{
dbcount[killerid]++;
}
else if(IsPlayerInAnyVehicle(killerid) == 0)
{
dbcount[killerid] = 0;
}
if(dbcount[killerid] >= aDbkills)
{
if(aDrive == 1)
{
FcukKick(killerid, "Repeatative Drive-By's");
dbcount[killerid] = 0;
}
else if(aDrive == 2)
{
FcukBan(killerid, "Repeatative Drive-By's");
dbcount[killerid] = 0;
}
else if(aDrive == 3)
{
FcukDisarm(killerid, "Repeatative Drive-By's");
dbcount[killerid] = 0;
}
}
}
if(aIkill > 0)
{
if(IsPlayerConnected(killerid))
{
if(GetPlayerInterior(killerid) != 0)
{
if(!IsPlayerInAnyVehicle(killerid))
{
if(aIkill == 1)
{
FcukKick(killerid, "Interior Weapon Use");
}
else if(aIkill == 2)
{
FcukBan(killerid, "Interior Weapon Use");
}
}
}
}
}
if(aSkill > 0)
{
if(IsPlayerConnected(playerid) && IsPlayerConnected(killerid))
{
if(sTime[playerid] > 0)
{
sCount[killerid]++;
if(sCount[killerid] >= aSlimit)
{
if(aSkill == 1)
{
FcukKick(killerid, "Repeatative Spawn Killing");
sCount[killerid] = 0;
}
else if(aSkill == 2)
{
FcukBan(killerid, "Repeatative Spawn Killing");
sCount[killerid] = 0;
}
else if(aSkill == 3)
{
FcukDisarm(killerid, "Repeatative Spawn Killing");
sCount[killerid] = 0;
}
}
}
}
}
if(aWa > 0)
{
if(reason == aWpn1 || reason == aWpn2 || reason == aWpn3 || reason == aWpn4 || reason == aWpn5 || reason == aWpn6 || reason == aWpn7 || reason == aWpn8 || reason == aWpn9 || reason == aWpn10 || reason == aWpn11 || reason == aWpn12)
{
format(gString, sizeof(gString), "Used a Banned Weapon (%s)", reason);
if(aOnKill == 1)
{
FcukKick(killerid, gString);
}
else if(aOnKill == 2)
{
FcukBan(killerid, gString);
}
}
}
}
return 1;
}
/*
====================
Spoof Check
====================
*/
/*
public SpoofLoop(playerid, killerid)
{
new Float:spoofhealth;
spoofhealth = GetPlayerHealth(playerid, spoofhealth);
if(spoofhealth > 5.0)
{
if(aSpoof == 1)
{
FcukKick(playerid, "ID Spoofing");
return 1;
}
else if(aSpoof == 2)
{
FcukBan(playerid, "ID Spoofing");
return 1;
}
}
return 1;
}*/
/*
====================
Weapon Check
====================
*/
rWeapon()
{
new ra = random(MP);
if(ActivePlayerCount() != 0)
{
if(IsPlayerConnected(ra))
{
WeaponCheck(ra);
}
else
{
rWeapon();
}
}
return 1;
}
stock WeaponCheck(playerid)
{
if(IsPlayerConnected(playerid))
{
for(new slot=0;slot<14;slot++)
{
new tmpwpn, ammo;
GetPlayerWeaponData(playerid, slot, tmpwpn, ammo);
for(new s=0;s<12;s++)
{
if(tmpwpn == bWeapons[s])
{
new wname[32];
GetWeaponName(tmpwpn, wname, sizeof(wname));
format(gString, sizeof(gString), "'s inventory contains a Banned Weapon (%s)", wname);
if(aWa == 1)
{
FcukKick(playerid, gString);
return 1;
}
else if(aWa == 2)
{
FcukBan(playerid, gString);
return 1;
}
}
}
}
}
return 1;
}
/*
====================
Clone Check
====================
*/
GetIPData(playerid)
{
new tmpip[32];
GetPlayerIp(playerid, tmpip,32);
strins(CloneData[playerid][PlayerIP],tmpip,0,32);
CloneCheck(playerid);
return 1;
}
ClearIPData(playerid)
{
strdel(CloneData[playerid][PlayerIP],0,32);
}
CloneCheck(playerid)
{
if(aClone > 0)
{
for(new c=0;c<MP;c++)
{
if(playerid != c)
{
new tmpIP[32];
GetPlayerIp(playerid, tmpIP,32);
if(CloneData[c][PlayerIP] == strval(tmpIP))
{
//Detected Clone
if(aClone == 1)
{
format(gString, sizeof(gString), "<FuckIt> Detected %s and %s are Clones (Warned)", PlayerName(playerid),PlayerName(c));
SendClientMessageToAll(COLOR_YELLOW, gString);
}
else if(aClone == 2)
{
format(gString, sizeof(gString), "is a Clone of %s",PlayerName(playerid));
FcukKick(playerid, gString);
}
}
}
}
}
}
/*
===================
Kick/Ban Timers
===================
*/
public aBan(playerid)
{
if(IsPlayerConnected(playerid))
{
Ban(playerid);
}
}
public aKick(playerid)
{
if(IsPlayerConnected(playerid))
{
Kick(playerid);
}
}
/*
===================
Kick/Ban Messages
===================
*/
FcukKick(playerid, message[])
{
Kicks++;
format(gString, sizeof(gString),"<FuckIt> Detected %s %s (Kicked)", PlayerName(playerid), message);
SendClientMessageToAll(COLOR_YELLOW, gString);
SaveKDetails(playerid, message);
SetTimerEx("aKick",750,false,"i",playerid);
printf("<FuckIt> Successful Kick (%s) - %s", PlayerName(playerid), message);
}
FcukBan(playerid, message[])
{
Bans++;
format(gString, sizeof(gString),"<FuckIt> Detected %s %s (Banned)", PlayerName(playerid), message);
SendClientMessageToAll(COLOR_YELLOW, gString);
SaveBDetails(playerid, message);
SetTimerEx("aBan",750,false,"i",playerid);
printf("<FuckIt> Successful Ban (%s) - %s", PlayerName(playerid), message);
}
FcukDisarm(playerid, message[])
{
Disarms++;
format(gString, sizeof(gString),"<FuckIt> Detected %s %s (Disarmed)", PlayerName(playerid), message);
SendClientMessageToAll(COLOR_YELLOW, gString);
ResetPlayerWeapons(playerid);
}
/*
=========================
Config Function
=========================
*/
rConfig()
{
new File:fhandle;
new cname[64];
new temp[64];
new value[64];
fhandle = fopen("ficonfig.txt",io_readwrite);
while(fread(fhandle,temp,sizeof(temp),false))
{
cname = strtok(temp,0);
value = strtok(temp,(strlen(cname)+1));
if(strcmp(cname,"Weapon1",true) == 0) aWpn1 = strval(value);
else if(strcmp(cname,"Weapon2",true) == 0) aWpn2 = strval(value);
else if(strcmp(cname,"Weapon3",true) == 0) aWpn3 = strval(value);
else if(strcmp(cname,"Weapon4",true) == 0) aWpn4 = strval(value);
else if(strcmp(cname,"Weapon5",true) == 0) aWpn5 = strval(value);
else if(strcmp(cname,"Weapon6",true) == 0) aWpn6 = strval(value);
else if(strcmp(cname,"Weapon7",true) == 0) aWpn7 = strval(value);
else if(strcmp(cname,"Weapon8",true) == 0) aWpn8 = strval(value);
else if(strcmp(cname,"Weapon9",true) == 0) aWpn9 = strval(value);
else if(strcmp(cname,"Weapon10",true) == 0) aWpn10 = strval(value);
else if(strcmp(cname,"Weapon11",true) == 0) aWpn11 = strval(value);
else if(strcmp(cname,"Weapon12",true) == 0) aWpn12 = strval(value);
else if(strcmp(cname,"Max-Cash-Increase",true) == 0) aCashInc = strval(value);
else if(strcmp(cname,"DB-Kills",true) == 0) aDbkills = strval(value);
else if(strcmp(cname,"A-Health",true) == 0) aHealth = strval(value);
else if(strcmp(cname,"A-Cash",true) == 0) aCash = strval(value);
else if(strcmp(cname,"A-DriveBy",true) == 0) aDrive = strval(value);
else if(strcmp(cname,"A-Inactivity",true) == 0) aInac = strval(value);
else if(strcmp(cname,"A-BWeapons",true) == 0) aWa = strval(value);
else if(strcmp(cname,"Inactive-Period",true) == 0) aItime = strval(value);
else if(strcmp(cname,"hCheck-Time",true) == 0) hCheck = strval(value);
else if(strcmp(cname,"cCheck-Time",true) == 0) cCheck = strval(value);
else if(strcmp(cname,"A-InteriorKill",true) == 0) aIkill = strval(value);
else if(strcmp(cname,"A-SpawnKill",true) == 0) aSkill = strval(value);
else if(strcmp(cname,"Spawn-Kill-Time",true) == 0) aStime = strval(value);
else if(strcmp(cname,"Max-Spawn-Kills",true) == 0) aSlimit = strval(value);
// else if(strcmp(cname,"A-Spoofing",true) == 0) aSpoof = strval(value);
else if(strcmp(cname,"A-Cloning",true) == 0) aClone = strval(value);
else if(strcmp(cname,"Log-Enabled",true) == 0) aLog = strval(value);
else if(strcmp(cname,"Ping-Limit",true) == 0) pLimit = strval(value);
else if(strcmp(cname,"Ping-Intervals",true) == 0) pIntervals = strval(value);
else if(strcmp(cname,"Ping-Warning(0/1)",true) == 0) pWarning = strval(value);
else if(strcmp(cname,"Ping-Tolerance",true) == 0) pTolerance = strval(value);
else if(strcmp(cname,"A-Lagg",true) == 0) aLagg = strval(value);
else if(strcmp(cname,"A-OnKill",true) == 0) aOnKill = strval(value);
}
fclose(fhandle);
return 1;
}
/*
========================
Save Details
========================
*/
Log(playerid)
{
new File:fhandle;
new temp[32];
new IP[32], tIP[32];
GetPlayerIp(playerid, IP, sizeof(IP));
fhandle = fopen("FcukIPlog.txt",io_readwrite);
while(fread(fhandle,temp,sizeof(temp),false))
{
tIP = strtok(temp,0);
if(strcmp(tIP,IP,true,32)==0)
{
fclose(fhandle);
return 0;
}
else
{
format(temp,sizeof(temp),"%s %s\r\n",IP,PlayerName(playerid));
fwrite(fhandle,temp);
fclose(fhandle);
}
}
return 1;
}
SaveKDetails(playerid, reason[])
{
new File:fhandle;
new month, day, year, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
fhandle = fopen("Fcukkick.txt",io_append);
format(gString,sizeof(gString),"%s %s Date: %d/%d/%d Time: %d:%d\r\n",PlayerName(playerid),reason,day,month,year,hour,minute);
fwrite(fhandle,gString);
fclose(fhandle);
}
SaveBDetails(playerid, reason[])
{
new File:fhandle;
new month, day, year, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
fhandle = fopen("Fcukban.txt",io_append);
format(gString,sizeof(gString),"%s %s Date: %d/%d/%d Time: %d:%d\r\n",PlayerName(playerid),reason,day,month,year,hour,minute);
fwrite(fhandle,gString);
fclose(fhandle);
}
/*
========================
Commands
========================
*/
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(fhealth,7,cmdtext);
dcmd(fcash,5,cmdtext);
dcmd(finactive,9,cmdtext);
dcmd(fbweapons,9,cmdtext);
dcmd(fskill,6,cmdtext);
dcmd(fclone,6,cmdtext);
dcmd(frestart,8,cmdtext);
dcmd(fshutdown,9,cmdtext);
dcmd(fhelp,5,cmdtext);
dcmd(fdriveby,8,cmdtext);
dcmd(FuckIt,6,cmdtext);
return 0;
}
/*
========================
Command Functions
========================
*/
stock dcmd_fhealth(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aHealth == 1)
{
aHealth=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Health Check Shutdown");
}
else {
aHealth=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Health Check Activated");
}
}
return 1;
}
stock dcmd_fcash(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aCash == 1)
{
aCash=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Cash Check Shutdown");
}
else {
aCash=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Cash Check Activated");
}
}
return 1;
}
stock dcmd_finactive(playerid,params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aInac == 1)
{
aInac=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Inactivity Check Shutdown");
}
else {
aInac=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Inactivity Check Activated");
}
}
return 1;
}
stock dcmd_fbweapons(playerid,params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aWa == 1)
{
aWa=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Banned Weapons Shutdown");
}
else {
aWa=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Banned Weapons Activated");
}
}
return 1;
}
stock dcmd_fskill(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aSkill == 1)
{
aSkill=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Spawn-Killing Shutdown");
}
else {
aSkill=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Spawn-Killing Activated");
}
}
return 1;
}
stock dcmd_fclone(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(aClone == 1)
{
aClone=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Clone-Detection Shutdown");
}
else {
aClone=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Clone-Detection Activated");
}
}
return 1;
}
stock dcmd_frestart(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
rConfig();
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> FuckIt Anti-Cheat Successfully Restarted!");
}
return 1;
}
stock dcmd_fshutdown(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
aHealth=0, aCash=0, aInac=0, aSkill=0, aIkill=0, aWa=0, aDrive=0;
aWa=0, /*aSpoof=0,*/ aClone=0, aLog=0, aLagg=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Emergency Shutdown Successful");
}
return 1;
}
stock dcmd_fhelp(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_YELLOW, "FuckIt V1 Administrator Command List");
SendClientMessage(playerid, COLOR_YELLOW, "Main: /frestart, /fshutdown, /FuckIt");
SendClientMessage(playerid, COLOR_YELLOW, "Toggle Checks:");
SendClientMessage(playerid, COLOR_YELLOW, "/fclone, /fskill, /fbweapons, /finactive");
SendClientMessage(playerid, COLOR_YELLOW, "/fdriveby, /fhealth, /fcash");
}
return 1;
}
stock dcmd_FuckIt(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_RED, ">> This server is Monitored by FuckIt Anti-Cheat");
SendClientMessage(playerid, COLOR_YELLOW, ">> Version: V1 [Build 27]");
format(gString, sizeof(gString), ">> Session: Kicks: %d Bans: %d Disarms:%d", Kicks, Bans, Disarms);
SendClientMessage(playerid, COLOR_YELLOW, gString);
SendClientMessage(playerid, COLOR_YELLOW, ">> Coded by [DRuG]Scarface);
}
return 1;
}
stock dcmd_fdriveby(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid) && IsPlayerAdmin(playerid))
{
if(aDrive == 1)
{
aDrive=0;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Drive-By Shutdown");
return 1;
}
else {
aDrive=1;
SendClientMessage(playerid, COLOR_YELLOW, "<FuckIt> Anti-Drive-By Activated");
}
}
return 1;
}
/*
=================
Anti-LaGG
=================
*/
public pLoop()
{
for(new i=0;i<MP;i++)
{
if(IsPlayerConnected(i))
{
new tPing = GetPlayerPing(i);
new PingL = (pLimit + pTolerance);
if((tPing > pLimit) && (tPing > PingL) && pWarning > 0)
{
FcukKick(i, "High Ping");
}
if((tPing > pLimit) && (pWarning < 1))
{
FcukKick(i, "High Ping");
}
if((tPing <= PingL) && (tPing > pLimit))
{
if(pWarnings[i] < 2)
{
pWarnings[i]++;
format(gString, sizeof(gString), "<FuckIt> Warning: Your ping is close to the Limit of %d (%d/3)", pLimit, pWarnings[i]);
SendClientMessage(i, 0xFFFF00AA, gString);
}
else {
SendClientMessage(i, 0xFFFF00AA, "<FuckIt> You have reached your Third Warning!");
FcukKick(i, "High Ping");
pWarnings[i] = 0;
}
}
}
}
}
/*
========================
String Defines
========================
*/
strtok(const string[],valve)
{
new index=valve;
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
This is not mine. just translated it and want to show you it.
Again THIS IS NOT MINE!