I provide Webhk - Anti-Cheat 1.0 [new] -
shing19861006 - 15.01.2009
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;
}
Re: I provide Webhk - Anti-Cheat 1.0 [new] -
Lewwy - 15.01.2009
Use pastebin or [ pawn ] [ /pawn ] tags for long bits of code.
Re: I provide Webhk - Anti-Cheat 1.0 [new] -
shing19861006 - 15.01.2009
What is your suggestion?
Re: I provide Webhk - Anti-Cheat 1.0 [new] -
Lewwy - 15.01.2009
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 [)
Re: I provide Webhk - Anti-Cheat 1.0 [new] -
Nimphious - 15.01.2009
I'll give it a try