Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Anti-Cheat by DaRkAnGeL[NBK]
- * Includes Cash hack, Airbreak hack, Weapon hack, Jetpack hack, Anti-Spam
- * Will release update shortly
- */
- #include <a_samp>
- #include <WeaponKick> //define if player is banned for hacking weapons
- //#include <WeaponBan> //define if player is banned for hacking weapons
- // Anti Cash Hack
- #define ResetMoneyBar ResetPlayerMoney
- #define UpdateMoneyBar GivePlayerMoney
- new Cash[MAX_PLAYERS];
- stock GivePlayerCash(playerid, money)
- {
- Cash[playerid] += money;
- ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
- UpdateMoneyBar(playerid,Cash[playerid]);//Sets the money in the moneybar to the serverside cash, Do not remove!
- return Cash[playerid];
- }
- stock SetPlayerCash(playerid, money)
- {
- Cash[playerid] = money;
- ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
- UpdateMoneyBar(playerid,Cash[playerid]);//Sets the money in the moneybar to the serverside cash, Do not remove!
- return Cash[playerid];
- }
- stock ResetPlayerCash(playerid)
- {
- Cash[playerid] = 0;
- ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
- UpdateMoneyBar(playerid,Cash[playerid]);//Sets the money in the moneybar to the serverside cash, Do not remove!
- return Cash[playerid];
- }
- stock GetPlayerCash(playerid)
- {
- return Cash[playerid];
- }
- forward MoneyTimer();
- public MoneyTimer()
- {
- new username[MAX_PLAYER_NAME];
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerCash(i) != GetPlayerMoney(i))
- {
- ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
- UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
- new hack = GetPlayerMoney(i) - GetPlayerCash(i);
- GetPlayerName(i,username,sizeof(username));
- printf("%s has picked up/attempted to spawn $%d.", username,hack);
- }
- }
- }
- }
- //anti teleport
- stock Float:GetDistanceBetweenPoints(Float:rx1,Float:ry1,Float:rz1,Float:rx2,Float:ry2,Float:rz2)
- {
- return floatadd(floatadd(floatsqroot(floatpower(floatsub(rx1,rx2),2)),floatsqroot(floatpower(floatsub(ry1,ry2),2))),floatsqroot(floatpower(floatsub(rz1,rz2),2)));
- }
- public OnFilterScriptInit()
- {
- SetTimer("MoneyTimer", 1000, 1);
- // Anti Weapon Hacking
- CheckForAll(); //Checks if any weapon is spawned
- //CheckForMeele(); //Checks if Meele weapons are spawned
- //CheckForHeavy(); //Checks if Heavy weapons are spawned
- //CheckForAssault(); //Checks if Assualt weapons are spawned
- //CheckForLight(); //Checks if Light weapons are spawned
- //CheckForShotgun(); //Checks if Shotguns are spawned
- //CheckForRifle(); //Checks if Rifles are spawned
- //CheckForRPG(); //Checks if RPG's and Heatseakers are spawned
- //CheckForMinigun(); //Checks if Miniguns are spawned
- //CheckForGrenade(); //Checks if Grenades are spawned
- //CheckForMolotov(); //Checks if Molotovs are spawned
- //CheckForStatchel(); //Checks if Statchel charges are spawned
- //CheckForVision(); //Checks if Night vision/Heat vision goggles are spawned
- // Anti Jetpack
- SetTimer("JetPack",1000,1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- // Anti-Airbreak
- SetPVarInt(playerid, "airbreak",0);
- ResetPlayerCash(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- DeletePVar( playerid, "airbreak" );
- return 1;
- }
- // Anti Spam
- public OnPlayerText(playerid, text[])
- {
- SetPVarInt(playerid,"textspam",GetPVarInt(playerid,"textspam")+1);
- if(GetPVarInt(playerid,"textspam") == 5) {
- new string[128];
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,tname,sizeof(tname));
- format(string,sizeof(string),"[SERVER]: %s(%d) Has Been Kicked For: Spam",tname,playerid);
- SendClientMessageToAll(0xAA3333AA,string);
- Kick(playerid);
- }
- else if(GetPVarInt(playerid,"textspam") == 4) {
- SendClientMessage(playerid,0xAA3333AA,"Do Not Spam You Must Wait: 5 Seconds");
- return 0;
- }
- return 1;
- }
- forward clearspam(playerid);
- public clearspam(playerid)
- {
- SetPVarInt(playerid,"textspam",0);
- }
- forward JetPack();
- public JetPack()
- {
- for(new i;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
- {
- new tname[MAX_PLAYER_NAME], string[128];
- GetPlayerName(i, tname, sizeof(tname));
- format(string, sizeof(string), "AC BAN: %s(%d) has been banned",tname,i);
- SendClientMessageToAll(0xAA3333AA, string);
- Ban(i);
- }
- }
- }
- }
- GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- GetXYBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- a = a - 180;
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- GetXYRightOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- a = a - 90;
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- GetXYLeftOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- a = a + 90;
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- public OnPlayerUpdate( playerid ) {
- new Keys,ud,lr;
- GetPlayerKeys(playerid,Keys,ud,lr);
- if( ud < 0 ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y;
- new Float:x2, Float:y2, Float:z2;
- GetXYInFrontOfPlayer( playerid, x, y, 1.5 );
- GetPlayerPos( playerid, x2, y2, z2 );
- #pragma unused x2
- #pragma unused y2
- SetPlayerPos( playerid, x, y, z2 );
- }
- }
- if( ud > 0 ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y;
- new Float:x2, Float:y2, Float:z2;
- GetXYBehindPlayer( playerid, x, y, 1.5 );
- GetPlayerPos( playerid, x2, y2, z2 );
- #pragma unused x2
- #pragma unused y2
- SetPlayerPos( playerid, x, y, z2 );
- }
- }
- if( lr > 0 ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y;
- new Float:x2, Float:y2, Float:z2;
- GetXYRightOfPlayer( playerid, x, y, 2.0 );
- GetPlayerPos( playerid, x2, y2, z2 );
- #pragma unused x2
- #pragma unused y2
- SetPlayerPos( playerid, x, y, z2 );
- }
- }
- if( lr < 0 ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y;
- new Float:x2, Float:y2, Float:z2;
- GetXYLeftOfPlayer( playerid, x, y, 2.0 );
- GetPlayerPos( playerid, x2, y2, z2 );
- #pragma unused x2
- #pragma unused y2
- SetPlayerPos( playerid, x, y, z2 );
- }
- }
- if( Keys & KEY_SPRINT ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y, Float:z;
- GetPlayerPos( playerid, x, y, z );
- SetPlayerPos( playerid, x, y, z + 2.0 );
- }
- }
- if( Keys & KEY_JUMP ) {
- if( GetPVarInt( playerid, "airbreak" ) == 1 ) {
- new Float:x, Float:y, Float:z;
- GetPlayerPos( playerid, x, y, z );
- SetPlayerPos( playerid, x, y, z - 2.0 );
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment