SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 15/01/2009, 05:41 PM   #1
shing19861006
Little Clucker
 
Join Date: Oct 2008
Posts: 2
Reputation: 0
Default I provide Webhk - Anti-Cheat 1.0 [new]

For GTA:MP
anticheat.pwn Only


Special features:
Anti Health Cheating
Anti Ammo Cheating
Anti Money Cheating

Work conditions in game:
Find the vehicle bump health cheater
Find the weapon to fire 10 times if ammo cheating
Set the money more than original money

Installation:
Copy the following code to create a new file
Rename the file to be anticheat.pwn
Copy file anticheat.pwn into folder filterscripts
Then using the pawno compile to be anticheat.amx
Open server.cfg and add the anticheat after the filterscripts line

pawn Code:
/*
Webhk - Anti-Cheat 1.0
*/


#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF

new ammos[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
new fires[MAX_PLAYERS];
new kills[MAX_PLAYERS];
new moneys[MAX_PLAYERS];
new waiting[MAX_PLAYERS];
new weapons[MAX_PLAYERS];
new Float:position_x[MAX_PLAYERS];
new Float:position_y[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    moneys[playerid] = 50000;
    waiting[playerid] = false;
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new keys, updown, leftright;
    GetPlayerKeys(playerid, keys, updown, leftright);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(playerid != -1){
        if(position_x[playerid] != x || position_y[playerid] != y){
          if(keys != 0 || updown != 0 || leftright != 0 || IsPlayerInAnyVehicle(playerid)){
                waiting[playerid] = false;
            }
        }
        else{
            waiting[playerid] = true;
        }
        if(waiting[playerid]){
          new Float:temp_x = position_x[playerid] - x;
          new Float:temp_y = position_y[playerid] - y;
            if(temp_x < 0){
                temp_x = temp_x * -1;
            }
            if(temp_y < 0){
                temp_y = temp_y * -1;
            }
            if(temp_x > 0.1 || temp_y > 0.1){
                if(temp_x < 10 && temp_y < 10){
                    SetPlayerHealth(playerid, health - 5);
                }
            }
        }
    }
    position_x[playerid] = x;
    position_y[playerid] = y;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(moneys[playerid] + 100 < GetPlayerMoney(playerid)){
        new message[256];
        GetPlayerName(playerid, message, sizeof(message));
        strcat(message, " has been kicked. - Money Cheating");
        SendClientMessageToAll(0xFFFF00AA, message);
        Kick(playerid);
    }
    if(oldkeys & KEY_FIRE){
      if(GetPlayerAmmo(playerid) != 65535){
        if(fires[playerid] == 0){
                weapons[playerid] = GetPlayerWeapon(playerid);
                ammos[playerid] = GetPlayerAmmo(playerid);
            }
            fires[playerid]++;
            if(fires[playerid] > 10){
                if(weapons[playerid] == GetPlayerWeapon(playerid) && ammos[playerid] == GetPlayerAmmo(playerid)){
                    new message[256];
                    GetPlayerName(playerid, message, sizeof(message));
                    strcat(message, " has been kicked. - Ammo Cheating");
                    SendClientMessageToAll(0xFFFF00AA, message);
                    Kick(playerid);
                }
                fires[playerid] = 0;
            }
            if(weapons[playerid] != GetPlayerWeapon(playerid)){
                fires[playerid] = 0;
            }
        }
    }
}

public OnPlayerDeath(playerid, killerid, reason)
{
    kills[killerid]++;
    deaths[playerid]++;
  new playercash;
    playercash = GetPlayerMoney(playerid);
    if(playercash > 0){
        moneys[killerid] = GetPlayerMoney(killerid) + playercash;
    }
    return 1;
}
shing19861006 is offline   Reply With Quote
Old 15/01/2009, 05:53 PM   #2
Lewwy
High-roller
 
Lewwy's Avatar
 
Join Date: Nov 2007
Location: Scotland
Posts: 1,043
Reputation: 5
Default Re: I provide Webhk - Anti-Cheat 1.0 [new]

Use pastebin or [ pawn ] [ /pawn ] tags for long bits of code.
Lewwy is offline   Reply With Quote
Old 15/01/2009, 06:06 PM   #3
shing19861006
Little Clucker
 
Join Date: Oct 2008
Posts: 2
Reputation: 0
Default Re: I provide Webhk - Anti-Cheat 1.0 [new]

What is your suggestion?
shing19861006 is offline   Reply With Quote
Old 15/01/2009, 06:08 PM   #4
Lewwy
High-roller
 
Lewwy's Avatar
 
Join Date: Nov 2007
Location: Scotland
Posts: 1,043
Reputation: 5
Default Re: I provide Webhk - Anti-Cheat 1.0 [new]

The pawn code highlighted in red.. Make it like this:

pawn Code:
/*
Webhk - Anti-Cheat 1.0
*/


#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF

new ammos[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
new fires[MAX_PLAYERS];
new kills[MAX_PLAYERS];
new moneys[MAX_PLAYERS];
new waiting[MAX_PLAYERS];
new weapons[MAX_PLAYERS];
new Float:position_x[MAX_PLAYERS];
new Float:position_y[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
 return 1;
}

public OnPlayerRequestSpawn(playerid)
{
 moneys[playerid] = 50000;
 waiting[playerid] = false;
 return 1;
}

public OnPlayerUpdate(playerid)
{
 new keys, updown, leftright;
 GetPlayerKeys(playerid, keys, updown, leftright);
 new Float:x, Float:y, Float:z;
 GetPlayerPos(playerid, x, y, z);
 new Float:health;
 GetPlayerHealth(playerid, health);
 if(playerid != -1){
   if(position_x[playerid] != x || position_y[playerid] != y){
     if(keys != 0 || updown != 0 || leftright != 0 || IsPlayerInAnyVehicle(playerid)){
      waiting[playerid] = false;
    }
   }
   else{
    waiting[playerid] = true;
   }
   if(waiting[playerid]){
     new Float:temp_x = position_x[playerid] - x;
     new Float:temp_y = position_y[playerid] - y;
    if(temp_x < 0){
      temp_x = temp_x * -1;
    }
    if(temp_y < 0){
      temp_y = temp_y * -1;
    }
    if(temp_x > 0.1 || temp_y > 0.1){
      if(temp_x < 10 && temp_y < 10){
       SetPlayerHealth(playerid, health - 5);
      }
    }
   }
 }
 position_x[playerid] = x;
 position_y[playerid] = y;
 return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
 if(moneys[playerid] + 100 < GetPlayerMoney(playerid)){
   new message[256];
   GetPlayerName(playerid, message, sizeof(message));
   strcat(message, " has been kicked. - Money Cheating");
   SendClientMessageToAll(0xFFFF00AA, message);
   Kick(playerid);
 }
 if(oldkeys & KEY_FIRE){
   if(GetPlayerAmmo(playerid) != 65535){
     if(fires[playerid] == 0){
      weapons[playerid] = GetPlayerWeapon(playerid);
      ammos[playerid] = GetPlayerAmmo(playerid);
    }
    fires[playerid]++;
    if(fires[playerid] > 10){
      if(weapons[playerid] == GetPlayerWeapon(playerid) && ammos[playerid] == GetPlayerAmmo(playerid)){
       new message[256];
       GetPlayerName(playerid, message, sizeof(message));
       strcat(message, " has been kicked. - Ammo Cheating");
       SendClientMessageToAll(0xFFFF00AA, message);
       Kick(playerid);
      }
      fires[playerid] = 0;
    }
    if(weapons[playerid] != GetPlayerWeapon(playerid)){
      fires[playerid] = 0;
    }
   }
 }
}

public OnPlayerDeath(playerid, killerid, reason)
{
 kills[killerid]++;
 deaths[playerid]++;
  new playercash;
 playercash = GetPlayerMoney(playerid);
 if(playercash > 0){
   moneys[killerid] = GetPlayerMoney(killerid) + playercash;
 }
  return 1;
}

[ pawn ] [ /pawn ] (Without the spaces following [)
Lewwy is offline   Reply With Quote
Old 15/01/2009, 09:05 PM   #5
Nimphious
Huge Clucker
 
Join Date: Dec 2008
Posts: 371
Reputation: 2
Default Re: I provide Webhk - Anti-Cheat 1.0 [new]

I'll give it a try
Nimphious is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] Anti Money Cheat, Anti Ban Weapon FreshKilla Includes 28 11/08/2014 04:05 PM
[FilterScript] [FS]Anti-Cheat viper_viper Filterscripts 19 23/07/2010 01:37 AM
[FilterScript] [FS] Gun Anti-Cheat by me DizeL-ZR- Filterscripts 5 14/02/2010 10:07 AM
Best anti-cheat? v0nz Help Archive 2 24/05/2009 05:06 AM
Anti-cheat help :( viper_viper Help Archive 2 18/05/2009 09:12 PM


All times are GMT. The time now is 05:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.